@agentforge-io/sdk-server 4.66.0 → 4.68.0

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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { AgentForgeClientOptions, RequestOptions } from './client';
3
3
  export { AgentForgeError, AgentForgeAuthError, AgentForgeNotFoundError, AgentForgeNetworkError, AgentForgeDuplicateContactError, } from './errors';
4
4
  export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
5
5
  export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
6
- export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
6
+ export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
7
7
  export { AgentsResource } from './resources/agents';
8
8
  export { AnalyticsResource } from './resources/analytics';
9
9
  export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
@@ -1,10 +1,15 @@
1
1
  import type { AgentForgeClient } from '../client';
2
- import type { DeliveryQuote, DeliveryQuoteInput, DeliveryRoute, DeliveryRouteInput } from '../types';
2
+ import type { DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryQuote, DeliveryQuoteInput, DeliveryRoute, DeliveryRouteInput } from '../types';
3
3
  export declare class DeliveryResource {
4
4
  private readonly client;
5
5
  constructor(client: AgentForgeClient);
6
6
  /** `POST /api/v1/delivery/quote` — 404 when the workspace has no delivery settings. */
7
7
  quote(input: DeliveryQuoteInput): Promise<DeliveryQuote>;
8
+ /**
9
+ * `POST /api/v1/delivery/pricing-preview` — the local price at some distances for a DRAFT delivery value,
10
+ * computed by the platform with the same math as `quote` (nothing is saved, no maps call). 400 when the draft is invalid.
11
+ */
12
+ pricingPreview(input: DeliveryPricingPreviewInput): Promise<DeliveryPricingPreview>;
8
13
  /**
9
14
  * `POST /api/v1/delivery/route` — the road through some stops, from `from` (else the
10
15
  * business), to draw on a Google map (Google's terms bar other maps). Google orders the
@@ -12,6 +12,13 @@ class DeliveryResource {
12
12
  async quote(input) {
13
13
  return this.client.request('POST', '/api/v1/delivery/quote', input);
14
14
  }
15
+ /**
16
+ * `POST /api/v1/delivery/pricing-preview` — the local price at some distances for a DRAFT delivery value,
17
+ * computed by the platform with the same math as `quote` (nothing is saved, no maps call). 400 when the draft is invalid.
18
+ */
19
+ async pricingPreview(input) {
20
+ return this.client.request('POST', '/api/v1/delivery/pricing-preview', input);
21
+ }
15
22
  /**
16
23
  * `POST /api/v1/delivery/route` — the road through some stops, from `from` (else the
17
24
  * business), to draw on a Google map (Google's terms bar other maps). Google orders the
package/dist/types.d.ts CHANGED
@@ -659,6 +659,8 @@ export interface PublicProfileBlock {
659
659
  kind: string;
660
660
  enabled: boolean;
661
661
  title?: string;
662
+ /** PDK-PAGE-BLOCKS — absent = inline. */
663
+ placement?: ProfileBlockPlacement;
662
664
  [field: string]: unknown;
663
665
  }
664
666
  export interface PublicTeamLanding {
@@ -686,6 +688,12 @@ export interface PublicTeamLanding {
686
688
  }>;
687
689
  /** Platform-page ChatToken. Hosts that chat through `sk_live_` must not expose it. */
688
690
  chatToken: string | null;
691
+ /**
692
+ * The business's connected WhatsApp number (digits as stored). Set only when the
693
+ * page has an enabled `whatsapp` block without its own `phone` and a live
694
+ * channel exists; otherwise `null`/absent.
695
+ */
696
+ whatsappPhone?: string | null;
689
697
  }
690
698
  /** `POST /api/v1/teams` body. The team's hidden orchestrator agent is created with it. */
691
699
  export interface CreateTeamInput {
@@ -787,11 +795,26 @@ export interface TeamTheme {
787
795
  inputFg?: string;
788
796
  avatarBg?: string;
789
797
  }
798
+ /**
799
+ * PDK-PAGE-BLOCKS — where a block is drawn. Absent = `inline` (every block saved before this existed).
800
+ * Only `socials`, `whatsapp` and `links` with at most 2 items may be `floating`; at most 2 floating
801
+ * blocks per page and one per column (left / center / right). The platform normalizes a violation to
802
+ * inline (the later block loses `placement`) instead of rejecting the write.
803
+ */
804
+ export interface ProfileBlockPlacement {
805
+ mode: 'inline' | 'floating';
806
+ /** Required when `mode === 'floating'`; a floating block without a valid position is stored inline. */
807
+ position?: ProfileBlockPosition;
808
+ }
809
+ export type ProfileBlockPosition = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
810
+ /** Products a catalog block draws inline; the rest sit behind «Ver todo». Absent = `'all'`. */
811
+ export type CatalogBlockPreview = 3 | 6 | 9 | 12 | 'all';
790
812
  /** One block of a public page. `id` is minted by the platform when omitted. */
791
813
  export type TeamProfileBlock = {
792
814
  id?: string;
793
815
  enabled?: boolean;
794
816
  title?: string;
817
+ placement?: ProfileBlockPlacement;
795
818
  } & ({
796
819
  kind: 'links';
797
820
  links: Array<{
@@ -833,8 +856,20 @@ export type TeamProfileBlock = {
833
856
  } | {
834
857
  kind: 'catalog';
835
858
  catalogId: string;
859
+ preview?: CatalogBlockPreview;
836
860
  [field: string]: unknown;
837
861
  }
862
+ /**
863
+ * PDK-PAGE-BLOCKS — a WhatsApp button. `phone` is normalized to `+<7-15 digits>` (an invalid one is
864
+ * dropped); absent = the business's connected WhatsApp number, resolved by the host App at render time.
865
+ * `label` <= 40 chars, `message` (prefilled text) <= 500.
866
+ */
867
+ | {
868
+ kind: 'whatsapp';
869
+ label?: string;
870
+ phone?: string;
871
+ message?: string;
872
+ }
838
873
  /** AGF-AGENDA — the business's agenda: free times of its bookable services (the host computes them). */
839
874
  | {
840
875
  kind: 'agenda';
@@ -1974,10 +2009,13 @@ export interface AddressValue {
1974
2009
  export type DeliveryLocalPricing = {
1975
2010
  kind: 'fixed';
1976
2011
  amount: number;
1977
- } | {
2012
+ }
2013
+ /** `includedKm`: the base covers up to here; each km counts from there, or from the free radius if it is further. */
2014
+ | {
1978
2015
  kind: 'distance';
1979
2016
  base: number;
1980
2017
  perKm: number;
2018
+ includedKm?: number;
1981
2019
  roundTo?: number;
1982
2020
  };
1983
2021
  /** Delivery coverage and prices (SDD AGF-PDK-DELIVERY §3.2). */
@@ -2103,6 +2141,21 @@ export type StructuredConfigEntry = ({
2103
2141
  updatedAt: string;
2104
2142
  };
2105
2143
  export type DeliveryQuoteStatus = 'free' | 'paid' | 'national' | 'pickup_only' | 'out_of_coverage' | 'no_delivery' | 'needs_confirmation';
2144
+ /** `delivery.pricingPreview` input: a draft delivery value and up to 20 distances (0..300 km). */
2145
+ export interface DeliveryPricingPreviewInput {
2146
+ value: DeliverySettings;
2147
+ km: number[];
2148
+ }
2149
+ export interface DeliveryPricePreview {
2150
+ km: number;
2151
+ /** The local delivery price at `km` (0 inside the free radius); null when there is none. */
2152
+ price: number | null;
2153
+ reason?: 'out_of_radius' | 'local_disabled';
2154
+ }
2155
+ export interface DeliveryPricingPreview {
2156
+ currency: string;
2157
+ prices: DeliveryPricePreview[];
2158
+ }
2106
2159
  export interface DeliveryRouteInput {
2107
2160
  /** Where the courier is now; default: the business. */
2108
2161
  from?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.66.0",
3
+ "version": "4.68.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",