@siglume/api-sdk 1.0.0 → 1.2.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.cts CHANGED
@@ -169,6 +169,7 @@ declare const PriceModel: {
169
169
  readonly PER_ACTION: "per_action";
170
170
  };
171
171
  type PriceModel = (typeof PriceModel)[keyof typeof PriceModel];
172
+ type BillingTiming = "post" | "prepay";
172
173
  declare const AppCategory: {
173
174
  readonly COMMERCE: "commerce";
174
175
  readonly BOOKING: "booking";
@@ -190,6 +191,7 @@ declare const ListingCurrency: {
190
191
  readonly JPY: "JPY";
191
192
  };
192
193
  type ListingCurrency = (typeof ListingCurrency)[keyof typeof ListingCurrency];
194
+ declare const MINIMUM_JPY_OPERATION_PRICE_MINOR = 15;
193
195
  declare const PersistenceMode: {
194
196
  readonly NONE: "none";
195
197
  readonly LOCAL: "local";
@@ -224,6 +226,8 @@ interface AppManifest {
224
226
  permission_scopes?: string[];
225
227
  price_model?: PriceModel;
226
228
  price_value_minor?: number;
229
+ pricing_plan?: PricingPlan;
230
+ billing_timing?: BillingTiming;
227
231
  currency: ListingCurrency;
228
232
  allow_free_trial: boolean;
229
233
  free_trial_duration_days?: number;
@@ -375,6 +379,28 @@ interface EnvelopeMeta {
375
379
  request_id?: string | null;
376
380
  trace_id?: string | null;
377
381
  }
382
+ interface PricingPlanItem {
383
+ key?: string | null;
384
+ label?: string | null;
385
+ price_minor?: number | null;
386
+ amount_minor?: number | null;
387
+ currency?: string | null;
388
+ unit_label?: string | null;
389
+ description?: string | null;
390
+ conditions?: unknown;
391
+ receipt_code?: string | null;
392
+ }
393
+ interface PricingPlan {
394
+ billing_model?: string | null;
395
+ display_name?: string | null;
396
+ summary?: string | null;
397
+ description?: string | null;
398
+ currency?: string | null;
399
+ unit_label?: string | null;
400
+ free_upfront_invocation?: boolean | null;
401
+ fallback_note?: string | null;
402
+ items?: PricingPlanItem[];
403
+ }
378
404
  interface CursorPage<T> {
379
405
  items: T[];
380
406
  next_cursor?: string | null;
@@ -396,6 +422,8 @@ interface AppListingRecord {
396
422
  dry_run_supported: boolean;
397
423
  price_model?: string | null;
398
424
  price_value_minor: number;
425
+ pricing_plan?: PricingPlan | null;
426
+ billing_timing?: BillingTiming | string | null;
399
427
  currency: string;
400
428
  allow_free_trial: boolean;
401
429
  free_trial_duration_days: number;
@@ -2807,7 +2835,7 @@ interface MeteringSimulationResult {
2807
2835
  }
2808
2836
  type MeterClientOptions = SiglumeClientOptions;
2809
2837
  /**
2810
- * Experimental analytics / pre-billing wrapper for usage-event ingest.
2838
+ * Analytics wrapper for usage-event ingest and invoice previews.
2811
2839
  */
2812
2840
  declare class MeterClient {
2813
2841
  readonly experimental = true;
@@ -3073,4 +3101,4 @@ declare function validate_tool_manual(manualInput: ManualInput): [boolean, ToolM
3073
3101
 
3074
3102
  declare function renderJson(value: unknown): string;
3075
3103
 
3076
- export { type AccessGrantRecord, type AccountAlert, type AccountContentDeleteResult, type AccountContentPostResult, type AccountDigest, type AccountDigestItem, type AccountDigestSummary, type AccountFeedbackSubmission, type AccountPlan, type AccountPlanCancellation, type AccountPreferences, type AccountWatchlist, type AdsBilling, type AdsBillingSettlement, type AdsCampaignPostRecord, type AdsCampaignRecord, type AdsProfile, type AgentCharter, type AgentRecord, type AgentThreadRecord, type AgentTopicSubscription, AnthropicProvider, type AnthropicToolDefinition, AppAdapter, AppCategory, type AppListingRecord, type AppManifest, AppTestHarness, ApprovalMode, type ApprovalPolicy, type ApprovalRequestHint, type AutoRegistrationReceipt, type Awaitable, type BillingPortalLink, BreakingChange, type BudgetPolicy, type BundleListingRecord, type BundleMember, type CapabilityBindingRecord, type CapabilityDelistedEvent, type CapabilityEventData, type CapabilityListing, type CapabilityPersistencePolicy, type CapabilityPublishedEvent, type CapabilitySaveStateRecord, type CassetteFile, type CassetteInteraction, type Change, ChangeLevel, type CompanyPublisherRecord, type CrossCurrencyQuote, type CursorPage, DEFAULT_OPERATION_AGENT_ID, DEFAULT_SIGLUME_API_BASE, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type DeveloperPortalSummary, type EmbeddedWalletCharge, type EnvelopeMeta, Environment, type ExecutionArtifact, type ExecutionCompletedEvent, type ExecutionCompletedEventData, type ExecutionContext, type ExecutionFailedEvent, type ExecutionFailedEventData, ExecutionKind, type ExecutionResult, type ExpressLikeRequest, type ExpressLikeResponse, type FavoriteAgent, type FavoriteAgentMutation, type GrantBindingResult, type HeaderLike, type HealthCheckResult, InMemoryWebhookDedupe, type InstalledToolBindingPolicyRecord, type InstalledToolConnectionReadiness, type InstalledToolExecutionRecord, type InstalledToolPolicyUpdateResult, type InstalledToolReceiptRecord, type InstalledToolReceiptStepRecord, type InstalledToolRecord, type JsonObject, type JsonPrimitive, type JsonValue, LLMProvider, ListingCurrency, type MarketNeedRecord, type MarketProposalActionResult, type MarketProposalRecord, type McpToolDescriptor, MeterClient, type MeterClientOptions, type MeterRecordResult, type MeteringInvoiceLinePreview, type MeteringSimulationResult, type NetworkClaimRecord, type NetworkContentDetail, type NetworkContentSummary, type NetworkEvidenceRecord, type NetworkRepliesPage, type OpenAIFunctionDefinition, OpenAIProvider, type OpenAIResponsesToolDefinition, type OperationExecution, type OperationMetadata, type PartnerApiKeyHandle, type PartnerApiKeyRecord, type PartnerDashboard, type PartnerUsage, type PaymentEventData, type PaymentFailedEvent, type PaymentSucceededEvent, PermissionClass, PersistenceMode, type PlanCheckoutSession, type PlanWeb3Mandate, type PolygonMandate, PriceModel, type QueuedWebhookEvent, type ReceiptRef, RecordMode, Recorder, type RecorderOptions, type RegistrationConfirmation, type RegistrationQuality, type SandboxSession, SettlementMode, type SettlementReceipt, type SideEffectRecord, SiglumeAPIError, SiglumeAssistError, SiglumeBuyerClient, type SiglumeBuyerClientOptions, SiglumeClient, SiglumeClientError, type SiglumeClientOptions, type SiglumeClientShape, SiglumeError, SiglumeExperimentalError, SiglumeExperimentalWarning, SiglumeNotFoundError, SiglumeProjectError, SiglumeValidationError, SiglumeWebhookError, type SiglumeWebhookEvent, SiglumeWebhookPayloadError, SiglumeWebhookReplayError, SiglumeWebhookSignatureError, StoreVertical, type StructuredGenerationUsage, StubProvider, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionLifecycleEventData, type SubscriptionPausedEvent, type SubscriptionReinstatedEvent, type SubscriptionRenewedEvent, type SupportCaseRecord, TOOL_MANUAL_DRAFT_PROMPT, type ToolManual, type ToolManualAssistAttempt, type ToolManualAssistMetadata, type ToolManualAssistResult, type ToolManualGrade, type ToolManualIssue, type ToolManualIssueSeverity, ToolManualPermissionClass, type ToolManualQualityReport, type ToolSchemaExport, type UsageEventRecord, type UsageRecord, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookCallback, type WebhookDeliveryRecord, type WebhookDispatchResult, type WebhookEventBase, type WebhookEventType, WebhookHandler, type WebhookSignatureVerification, type WebhookSubscriptionRecord, type WorksCategoryRecord, type WorksOwnerDashboard, type WorksOwnerDashboardAgent, type WorksOwnerDashboardOrder, type WorksOwnerDashboardPitch, type WorksOwnerDashboardStats, type WorksPosterDashboard, type WorksPosterDashboardJob, type WorksPosterDashboardOrder, type WorksPosterDashboardStats, type WorksRegistrationRecord, buildOperationMetadata, build_webhook_signature_header, compute_webhook_signature, defaultCapabilityKeyForOperation, defaultOperationOutputSchema, diff_manifest, diff_tool_manual, draft_tool_manual, fallbackOperationCatalog, fill_tool_manual_gaps, normalizeUsageRecord, parse_cross_currency_quote, parse_embedded_wallet_charge, parse_polygon_mandate, parse_queued_webhook_event, parse_settlement_receipt, parse_webhook_delivery, parse_webhook_event, parse_webhook_subscription, renderJson as render_json, score_tool_manual_offline, score_tool_manual_remote, simulate_embedded_wallet_charge, simulate_polygon_mandate, to_anthropic_tool, to_mcp_tool, to_openai_function, to_openai_responses_tool, tool_manual_to_dict, validate_tool_manual, verify_webhook_signature };
3104
+ export { type AccessGrantRecord, type AccountAlert, type AccountContentDeleteResult, type AccountContentPostResult, type AccountDigest, type AccountDigestItem, type AccountDigestSummary, type AccountFeedbackSubmission, type AccountPlan, type AccountPlanCancellation, type AccountPreferences, type AccountWatchlist, type AdsBilling, type AdsBillingSettlement, type AdsCampaignPostRecord, type AdsCampaignRecord, type AdsProfile, type AgentCharter, type AgentRecord, type AgentThreadRecord, type AgentTopicSubscription, AnthropicProvider, type AnthropicToolDefinition, AppAdapter, AppCategory, type AppListingRecord, type AppManifest, AppTestHarness, ApprovalMode, type ApprovalPolicy, type ApprovalRequestHint, type AutoRegistrationReceipt, type Awaitable, type BillingPortalLink, type BillingTiming, BreakingChange, type BudgetPolicy, type BundleListingRecord, type BundleMember, type CapabilityBindingRecord, type CapabilityDelistedEvent, type CapabilityEventData, type CapabilityListing, type CapabilityPersistencePolicy, type CapabilityPublishedEvent, type CapabilitySaveStateRecord, type CassetteFile, type CassetteInteraction, type Change, ChangeLevel, type CompanyPublisherRecord, type CrossCurrencyQuote, type CursorPage, DEFAULT_OPERATION_AGENT_ID, DEFAULT_SIGLUME_API_BASE, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type DeveloperPortalSummary, type EmbeddedWalletCharge, type EnvelopeMeta, Environment, type ExecutionArtifact, type ExecutionCompletedEvent, type ExecutionCompletedEventData, type ExecutionContext, type ExecutionFailedEvent, type ExecutionFailedEventData, ExecutionKind, type ExecutionResult, type ExpressLikeRequest, type ExpressLikeResponse, type FavoriteAgent, type FavoriteAgentMutation, type GrantBindingResult, type HeaderLike, type HealthCheckResult, InMemoryWebhookDedupe, type InstalledToolBindingPolicyRecord, type InstalledToolConnectionReadiness, type InstalledToolExecutionRecord, type InstalledToolPolicyUpdateResult, type InstalledToolReceiptRecord, type InstalledToolReceiptStepRecord, type InstalledToolRecord, type JsonObject, type JsonPrimitive, type JsonValue, LLMProvider, ListingCurrency, MINIMUM_JPY_OPERATION_PRICE_MINOR, type MarketNeedRecord, type MarketProposalActionResult, type MarketProposalRecord, type McpToolDescriptor, MeterClient, type MeterClientOptions, type MeterRecordResult, type MeteringInvoiceLinePreview, type MeteringSimulationResult, type NetworkClaimRecord, type NetworkContentDetail, type NetworkContentSummary, type NetworkEvidenceRecord, type NetworkRepliesPage, type OpenAIFunctionDefinition, OpenAIProvider, type OpenAIResponsesToolDefinition, type OperationExecution, type OperationMetadata, type PartnerApiKeyHandle, type PartnerApiKeyRecord, type PartnerDashboard, type PartnerUsage, type PaymentEventData, type PaymentFailedEvent, type PaymentSucceededEvent, PermissionClass, PersistenceMode, type PlanCheckoutSession, type PlanWeb3Mandate, type PolygonMandate, PriceModel, type PricingPlan, type PricingPlanItem, type QueuedWebhookEvent, type ReceiptRef, RecordMode, Recorder, type RecorderOptions, type RegistrationConfirmation, type RegistrationQuality, type SandboxSession, SettlementMode, type SettlementReceipt, type SideEffectRecord, SiglumeAPIError, SiglumeAssistError, SiglumeBuyerClient, type SiglumeBuyerClientOptions, SiglumeClient, SiglumeClientError, type SiglumeClientOptions, type SiglumeClientShape, SiglumeError, SiglumeExperimentalError, SiglumeExperimentalWarning, SiglumeNotFoundError, SiglumeProjectError, SiglumeValidationError, SiglumeWebhookError, type SiglumeWebhookEvent, SiglumeWebhookPayloadError, SiglumeWebhookReplayError, SiglumeWebhookSignatureError, StoreVertical, type StructuredGenerationUsage, StubProvider, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionLifecycleEventData, type SubscriptionPausedEvent, type SubscriptionReinstatedEvent, type SubscriptionRenewedEvent, type SupportCaseRecord, TOOL_MANUAL_DRAFT_PROMPT, type ToolManual, type ToolManualAssistAttempt, type ToolManualAssistMetadata, type ToolManualAssistResult, type ToolManualGrade, type ToolManualIssue, type ToolManualIssueSeverity, ToolManualPermissionClass, type ToolManualQualityReport, type ToolSchemaExport, type UsageEventRecord, type UsageRecord, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookCallback, type WebhookDeliveryRecord, type WebhookDispatchResult, type WebhookEventBase, type WebhookEventType, WebhookHandler, type WebhookSignatureVerification, type WebhookSubscriptionRecord, type WorksCategoryRecord, type WorksOwnerDashboard, type WorksOwnerDashboardAgent, type WorksOwnerDashboardOrder, type WorksOwnerDashboardPitch, type WorksOwnerDashboardStats, type WorksPosterDashboard, type WorksPosterDashboardJob, type WorksPosterDashboardOrder, type WorksPosterDashboardStats, type WorksRegistrationRecord, buildOperationMetadata, build_webhook_signature_header, compute_webhook_signature, defaultCapabilityKeyForOperation, defaultOperationOutputSchema, diff_manifest, diff_tool_manual, draft_tool_manual, fallbackOperationCatalog, fill_tool_manual_gaps, normalizeUsageRecord, parse_cross_currency_quote, parse_embedded_wallet_charge, parse_polygon_mandate, parse_queued_webhook_event, parse_settlement_receipt, parse_webhook_delivery, parse_webhook_event, parse_webhook_subscription, renderJson as render_json, score_tool_manual_offline, score_tool_manual_remote, simulate_embedded_wallet_charge, simulate_polygon_mandate, to_anthropic_tool, to_mcp_tool, to_openai_function, to_openai_responses_tool, tool_manual_to_dict, validate_tool_manual, verify_webhook_signature };
package/dist/index.d.ts CHANGED
@@ -169,6 +169,7 @@ declare const PriceModel: {
169
169
  readonly PER_ACTION: "per_action";
170
170
  };
171
171
  type PriceModel = (typeof PriceModel)[keyof typeof PriceModel];
172
+ type BillingTiming = "post" | "prepay";
172
173
  declare const AppCategory: {
173
174
  readonly COMMERCE: "commerce";
174
175
  readonly BOOKING: "booking";
@@ -190,6 +191,7 @@ declare const ListingCurrency: {
190
191
  readonly JPY: "JPY";
191
192
  };
192
193
  type ListingCurrency = (typeof ListingCurrency)[keyof typeof ListingCurrency];
194
+ declare const MINIMUM_JPY_OPERATION_PRICE_MINOR = 15;
193
195
  declare const PersistenceMode: {
194
196
  readonly NONE: "none";
195
197
  readonly LOCAL: "local";
@@ -224,6 +226,8 @@ interface AppManifest {
224
226
  permission_scopes?: string[];
225
227
  price_model?: PriceModel;
226
228
  price_value_minor?: number;
229
+ pricing_plan?: PricingPlan;
230
+ billing_timing?: BillingTiming;
227
231
  currency: ListingCurrency;
228
232
  allow_free_trial: boolean;
229
233
  free_trial_duration_days?: number;
@@ -375,6 +379,28 @@ interface EnvelopeMeta {
375
379
  request_id?: string | null;
376
380
  trace_id?: string | null;
377
381
  }
382
+ interface PricingPlanItem {
383
+ key?: string | null;
384
+ label?: string | null;
385
+ price_minor?: number | null;
386
+ amount_minor?: number | null;
387
+ currency?: string | null;
388
+ unit_label?: string | null;
389
+ description?: string | null;
390
+ conditions?: unknown;
391
+ receipt_code?: string | null;
392
+ }
393
+ interface PricingPlan {
394
+ billing_model?: string | null;
395
+ display_name?: string | null;
396
+ summary?: string | null;
397
+ description?: string | null;
398
+ currency?: string | null;
399
+ unit_label?: string | null;
400
+ free_upfront_invocation?: boolean | null;
401
+ fallback_note?: string | null;
402
+ items?: PricingPlanItem[];
403
+ }
378
404
  interface CursorPage<T> {
379
405
  items: T[];
380
406
  next_cursor?: string | null;
@@ -396,6 +422,8 @@ interface AppListingRecord {
396
422
  dry_run_supported: boolean;
397
423
  price_model?: string | null;
398
424
  price_value_minor: number;
425
+ pricing_plan?: PricingPlan | null;
426
+ billing_timing?: BillingTiming | string | null;
399
427
  currency: string;
400
428
  allow_free_trial: boolean;
401
429
  free_trial_duration_days: number;
@@ -2807,7 +2835,7 @@ interface MeteringSimulationResult {
2807
2835
  }
2808
2836
  type MeterClientOptions = SiglumeClientOptions;
2809
2837
  /**
2810
- * Experimental analytics / pre-billing wrapper for usage-event ingest.
2838
+ * Analytics wrapper for usage-event ingest and invoice previews.
2811
2839
  */
2812
2840
  declare class MeterClient {
2813
2841
  readonly experimental = true;
@@ -3073,4 +3101,4 @@ declare function validate_tool_manual(manualInput: ManualInput): [boolean, ToolM
3073
3101
 
3074
3102
  declare function renderJson(value: unknown): string;
3075
3103
 
3076
- export { type AccessGrantRecord, type AccountAlert, type AccountContentDeleteResult, type AccountContentPostResult, type AccountDigest, type AccountDigestItem, type AccountDigestSummary, type AccountFeedbackSubmission, type AccountPlan, type AccountPlanCancellation, type AccountPreferences, type AccountWatchlist, type AdsBilling, type AdsBillingSettlement, type AdsCampaignPostRecord, type AdsCampaignRecord, type AdsProfile, type AgentCharter, type AgentRecord, type AgentThreadRecord, type AgentTopicSubscription, AnthropicProvider, type AnthropicToolDefinition, AppAdapter, AppCategory, type AppListingRecord, type AppManifest, AppTestHarness, ApprovalMode, type ApprovalPolicy, type ApprovalRequestHint, type AutoRegistrationReceipt, type Awaitable, type BillingPortalLink, BreakingChange, type BudgetPolicy, type BundleListingRecord, type BundleMember, type CapabilityBindingRecord, type CapabilityDelistedEvent, type CapabilityEventData, type CapabilityListing, type CapabilityPersistencePolicy, type CapabilityPublishedEvent, type CapabilitySaveStateRecord, type CassetteFile, type CassetteInteraction, type Change, ChangeLevel, type CompanyPublisherRecord, type CrossCurrencyQuote, type CursorPage, DEFAULT_OPERATION_AGENT_ID, DEFAULT_SIGLUME_API_BASE, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type DeveloperPortalSummary, type EmbeddedWalletCharge, type EnvelopeMeta, Environment, type ExecutionArtifact, type ExecutionCompletedEvent, type ExecutionCompletedEventData, type ExecutionContext, type ExecutionFailedEvent, type ExecutionFailedEventData, ExecutionKind, type ExecutionResult, type ExpressLikeRequest, type ExpressLikeResponse, type FavoriteAgent, type FavoriteAgentMutation, type GrantBindingResult, type HeaderLike, type HealthCheckResult, InMemoryWebhookDedupe, type InstalledToolBindingPolicyRecord, type InstalledToolConnectionReadiness, type InstalledToolExecutionRecord, type InstalledToolPolicyUpdateResult, type InstalledToolReceiptRecord, type InstalledToolReceiptStepRecord, type InstalledToolRecord, type JsonObject, type JsonPrimitive, type JsonValue, LLMProvider, ListingCurrency, type MarketNeedRecord, type MarketProposalActionResult, type MarketProposalRecord, type McpToolDescriptor, MeterClient, type MeterClientOptions, type MeterRecordResult, type MeteringInvoiceLinePreview, type MeteringSimulationResult, type NetworkClaimRecord, type NetworkContentDetail, type NetworkContentSummary, type NetworkEvidenceRecord, type NetworkRepliesPage, type OpenAIFunctionDefinition, OpenAIProvider, type OpenAIResponsesToolDefinition, type OperationExecution, type OperationMetadata, type PartnerApiKeyHandle, type PartnerApiKeyRecord, type PartnerDashboard, type PartnerUsage, type PaymentEventData, type PaymentFailedEvent, type PaymentSucceededEvent, PermissionClass, PersistenceMode, type PlanCheckoutSession, type PlanWeb3Mandate, type PolygonMandate, PriceModel, type QueuedWebhookEvent, type ReceiptRef, RecordMode, Recorder, type RecorderOptions, type RegistrationConfirmation, type RegistrationQuality, type SandboxSession, SettlementMode, type SettlementReceipt, type SideEffectRecord, SiglumeAPIError, SiglumeAssistError, SiglumeBuyerClient, type SiglumeBuyerClientOptions, SiglumeClient, SiglumeClientError, type SiglumeClientOptions, type SiglumeClientShape, SiglumeError, SiglumeExperimentalError, SiglumeExperimentalWarning, SiglumeNotFoundError, SiglumeProjectError, SiglumeValidationError, SiglumeWebhookError, type SiglumeWebhookEvent, SiglumeWebhookPayloadError, SiglumeWebhookReplayError, SiglumeWebhookSignatureError, StoreVertical, type StructuredGenerationUsage, StubProvider, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionLifecycleEventData, type SubscriptionPausedEvent, type SubscriptionReinstatedEvent, type SubscriptionRenewedEvent, type SupportCaseRecord, TOOL_MANUAL_DRAFT_PROMPT, type ToolManual, type ToolManualAssistAttempt, type ToolManualAssistMetadata, type ToolManualAssistResult, type ToolManualGrade, type ToolManualIssue, type ToolManualIssueSeverity, ToolManualPermissionClass, type ToolManualQualityReport, type ToolSchemaExport, type UsageEventRecord, type UsageRecord, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookCallback, type WebhookDeliveryRecord, type WebhookDispatchResult, type WebhookEventBase, type WebhookEventType, WebhookHandler, type WebhookSignatureVerification, type WebhookSubscriptionRecord, type WorksCategoryRecord, type WorksOwnerDashboard, type WorksOwnerDashboardAgent, type WorksOwnerDashboardOrder, type WorksOwnerDashboardPitch, type WorksOwnerDashboardStats, type WorksPosterDashboard, type WorksPosterDashboardJob, type WorksPosterDashboardOrder, type WorksPosterDashboardStats, type WorksRegistrationRecord, buildOperationMetadata, build_webhook_signature_header, compute_webhook_signature, defaultCapabilityKeyForOperation, defaultOperationOutputSchema, diff_manifest, diff_tool_manual, draft_tool_manual, fallbackOperationCatalog, fill_tool_manual_gaps, normalizeUsageRecord, parse_cross_currency_quote, parse_embedded_wallet_charge, parse_polygon_mandate, parse_queued_webhook_event, parse_settlement_receipt, parse_webhook_delivery, parse_webhook_event, parse_webhook_subscription, renderJson as render_json, score_tool_manual_offline, score_tool_manual_remote, simulate_embedded_wallet_charge, simulate_polygon_mandate, to_anthropic_tool, to_mcp_tool, to_openai_function, to_openai_responses_tool, tool_manual_to_dict, validate_tool_manual, verify_webhook_signature };
3104
+ export { type AccessGrantRecord, type AccountAlert, type AccountContentDeleteResult, type AccountContentPostResult, type AccountDigest, type AccountDigestItem, type AccountDigestSummary, type AccountFeedbackSubmission, type AccountPlan, type AccountPlanCancellation, type AccountPreferences, type AccountWatchlist, type AdsBilling, type AdsBillingSettlement, type AdsCampaignPostRecord, type AdsCampaignRecord, type AdsProfile, type AgentCharter, type AgentRecord, type AgentThreadRecord, type AgentTopicSubscription, AnthropicProvider, type AnthropicToolDefinition, AppAdapter, AppCategory, type AppListingRecord, type AppManifest, AppTestHarness, ApprovalMode, type ApprovalPolicy, type ApprovalRequestHint, type AutoRegistrationReceipt, type Awaitable, type BillingPortalLink, type BillingTiming, BreakingChange, type BudgetPolicy, type BundleListingRecord, type BundleMember, type CapabilityBindingRecord, type CapabilityDelistedEvent, type CapabilityEventData, type CapabilityListing, type CapabilityPersistencePolicy, type CapabilityPublishedEvent, type CapabilitySaveStateRecord, type CassetteFile, type CassetteInteraction, type Change, ChangeLevel, type CompanyPublisherRecord, type CrossCurrencyQuote, type CursorPage, DEFAULT_OPERATION_AGENT_ID, DEFAULT_SIGLUME_API_BASE, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type DeveloperPortalSummary, type EmbeddedWalletCharge, type EnvelopeMeta, Environment, type ExecutionArtifact, type ExecutionCompletedEvent, type ExecutionCompletedEventData, type ExecutionContext, type ExecutionFailedEvent, type ExecutionFailedEventData, ExecutionKind, type ExecutionResult, type ExpressLikeRequest, type ExpressLikeResponse, type FavoriteAgent, type FavoriteAgentMutation, type GrantBindingResult, type HeaderLike, type HealthCheckResult, InMemoryWebhookDedupe, type InstalledToolBindingPolicyRecord, type InstalledToolConnectionReadiness, type InstalledToolExecutionRecord, type InstalledToolPolicyUpdateResult, type InstalledToolReceiptRecord, type InstalledToolReceiptStepRecord, type InstalledToolRecord, type JsonObject, type JsonPrimitive, type JsonValue, LLMProvider, ListingCurrency, MINIMUM_JPY_OPERATION_PRICE_MINOR, type MarketNeedRecord, type MarketProposalActionResult, type MarketProposalRecord, type McpToolDescriptor, MeterClient, type MeterClientOptions, type MeterRecordResult, type MeteringInvoiceLinePreview, type MeteringSimulationResult, type NetworkClaimRecord, type NetworkContentDetail, type NetworkContentSummary, type NetworkEvidenceRecord, type NetworkRepliesPage, type OpenAIFunctionDefinition, OpenAIProvider, type OpenAIResponsesToolDefinition, type OperationExecution, type OperationMetadata, type PartnerApiKeyHandle, type PartnerApiKeyRecord, type PartnerDashboard, type PartnerUsage, type PaymentEventData, type PaymentFailedEvent, type PaymentSucceededEvent, PermissionClass, PersistenceMode, type PlanCheckoutSession, type PlanWeb3Mandate, type PolygonMandate, PriceModel, type PricingPlan, type PricingPlanItem, type QueuedWebhookEvent, type ReceiptRef, RecordMode, Recorder, type RecorderOptions, type RegistrationConfirmation, type RegistrationQuality, type SandboxSession, SettlementMode, type SettlementReceipt, type SideEffectRecord, SiglumeAPIError, SiglumeAssistError, SiglumeBuyerClient, type SiglumeBuyerClientOptions, SiglumeClient, SiglumeClientError, type SiglumeClientOptions, type SiglumeClientShape, SiglumeError, SiglumeExperimentalError, SiglumeExperimentalWarning, SiglumeNotFoundError, SiglumeProjectError, SiglumeValidationError, SiglumeWebhookError, type SiglumeWebhookEvent, SiglumeWebhookPayloadError, SiglumeWebhookReplayError, SiglumeWebhookSignatureError, StoreVertical, type StructuredGenerationUsage, StubProvider, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionLifecycleEventData, type SubscriptionPausedEvent, type SubscriptionReinstatedEvent, type SubscriptionRenewedEvent, type SupportCaseRecord, TOOL_MANUAL_DRAFT_PROMPT, type ToolManual, type ToolManualAssistAttempt, type ToolManualAssistMetadata, type ToolManualAssistResult, type ToolManualGrade, type ToolManualIssue, type ToolManualIssueSeverity, ToolManualPermissionClass, type ToolManualQualityReport, type ToolSchemaExport, type UsageEventRecord, type UsageRecord, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPES, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookCallback, type WebhookDeliveryRecord, type WebhookDispatchResult, type WebhookEventBase, type WebhookEventType, WebhookHandler, type WebhookSignatureVerification, type WebhookSubscriptionRecord, type WorksCategoryRecord, type WorksOwnerDashboard, type WorksOwnerDashboardAgent, type WorksOwnerDashboardOrder, type WorksOwnerDashboardPitch, type WorksOwnerDashboardStats, type WorksPosterDashboard, type WorksPosterDashboardJob, type WorksPosterDashboardOrder, type WorksPosterDashboardStats, type WorksRegistrationRecord, buildOperationMetadata, build_webhook_signature_header, compute_webhook_signature, defaultCapabilityKeyForOperation, defaultOperationOutputSchema, diff_manifest, diff_tool_manual, draft_tool_manual, fallbackOperationCatalog, fill_tool_manual_gaps, normalizeUsageRecord, parse_cross_currency_quote, parse_embedded_wallet_charge, parse_polygon_mandate, parse_queued_webhook_event, parse_settlement_receipt, parse_webhook_delivery, parse_webhook_event, parse_webhook_subscription, renderJson as render_json, score_tool_manual_offline, score_tool_manual_remote, simulate_embedded_wallet_charge, simulate_polygon_mandate, to_anthropic_tool, to_mcp_tool, to_openai_function, to_openai_responses_tool, tool_manual_to_dict, validate_tool_manual, verify_webhook_signature };
package/dist/index.js CHANGED
@@ -8,6 +8,81 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
 
11
+ // src/types.ts
12
+ var PermissionClass, ApprovalMode, ExecutionKind, Environment, PriceModel, AppCategory, StoreVertical, ListingCurrency, MINIMUM_JPY_OPERATION_PRICE_MINOR, PersistenceMode, ToolManualPermissionClass, SettlementMode;
13
+ var init_types = __esm({
14
+ "src/types.ts"() {
15
+ "use strict";
16
+ PermissionClass = {
17
+ READ_ONLY: "read-only",
18
+ ACTION: "action",
19
+ PAYMENT: "payment",
20
+ /** @deprecated Use READ_ONLY. Behaves identically. */
21
+ RECOMMENDATION: "recommendation"
22
+ };
23
+ ApprovalMode = {
24
+ AUTO: "auto",
25
+ BUDGET_BOUNDED: "budget-bounded",
26
+ ALWAYS_ASK: "always-ask",
27
+ DENY: "deny"
28
+ };
29
+ ExecutionKind = {
30
+ DRY_RUN: "dry_run",
31
+ QUOTE: "quote",
32
+ ACTION: "action",
33
+ PAYMENT: "payment"
34
+ };
35
+ Environment = {
36
+ SANDBOX: "sandbox",
37
+ LIVE: "live"
38
+ };
39
+ PriceModel = {
40
+ FREE: "free",
41
+ SUBSCRIPTION: "subscription",
42
+ ONE_TIME: "one_time",
43
+ BUNDLE: "bundle",
44
+ USAGE_BASED: "usage_based",
45
+ PER_ACTION: "per_action"
46
+ };
47
+ AppCategory = {
48
+ COMMERCE: "commerce",
49
+ BOOKING: "booking",
50
+ CRM: "crm",
51
+ FINANCE: "finance",
52
+ DOCUMENT: "document",
53
+ COMMUNICATION: "communication",
54
+ MONITORING: "monitoring",
55
+ OTHER: "other"
56
+ };
57
+ StoreVertical = {
58
+ API: "api",
59
+ GAME: "game"
60
+ };
61
+ ListingCurrency = {
62
+ USD: "USD",
63
+ JPY: "JPY"
64
+ };
65
+ MINIMUM_JPY_OPERATION_PRICE_MINOR = 15;
66
+ PersistenceMode = {
67
+ NONE: "none",
68
+ LOCAL: "local",
69
+ PLATFORM: "platform",
70
+ DEVELOPER_SERVER: "developer_server"
71
+ };
72
+ ToolManualPermissionClass = {
73
+ READ_ONLY: "read_only",
74
+ ACTION: "action",
75
+ PAYMENT: "payment"
76
+ };
77
+ SettlementMode = {
78
+ STRIPE_CHECKOUT: "stripe_checkout",
79
+ STRIPE_PAYMENT_INTENT: "stripe_payment_intent",
80
+ POLYGON_MANDATE: "polygon_mandate",
81
+ EMBEDDED_WALLET_CHARGE: "embedded_wallet_charge"
82
+ };
83
+ }
84
+ });
85
+
11
86
  // src/errors.ts
12
87
  var SiglumeError, SiglumeClientError, SiglumeProjectError, SiglumeValidationError, SiglumeAssistError, SiglumeNotFoundError, SiglumeWebhookError, SiglumeWebhookSignatureError, SiglumeWebhookPayloadError, SiglumeWebhookReplayError, SiglumeAPIError;
13
88
  var init_errors = __esm({
@@ -1587,6 +1662,58 @@ function validateSaveDataSchema(schema, fieldName) {
1587
1662
  }
1588
1663
  }
1589
1664
  }
1665
+ function validatePricingPlanFloor(plan, defaultCurrency) {
1666
+ if (plan === void 0 || plan === null) {
1667
+ return;
1668
+ }
1669
+ if (!isRecord2(plan)) {
1670
+ throw new SiglumeClientError("AppManifest.pricing_plan must be an object when provided.");
1671
+ }
1672
+ const items = plan.items;
1673
+ if (items === void 0 || items === null) {
1674
+ return;
1675
+ }
1676
+ if (!Array.isArray(items)) {
1677
+ throw new SiglumeClientError("AppManifest.pricing_plan.items must be an array when provided.");
1678
+ }
1679
+ const planCurrency = String(plan.currency ?? defaultCurrency ?? "").trim().toUpperCase();
1680
+ const seenKeys = /* @__PURE__ */ new Set();
1681
+ items.forEach((item, index) => {
1682
+ if (!isRecord2(item)) {
1683
+ throw new SiglumeClientError(`AppManifest.pricing_plan.items[${index}] must be an object.`);
1684
+ }
1685
+ const itemKey = String(
1686
+ item.key ?? item.operation ?? item.operation_key ?? item.request_type ?? item.receipt_code ?? item.action ?? ""
1687
+ ).trim();
1688
+ if (!itemKey) {
1689
+ throw new SiglumeClientError(`AppManifest.pricing_plan.items[${index}].key is required.`);
1690
+ }
1691
+ if (seenKeys.has(itemKey)) {
1692
+ throw new SiglumeClientError(`AppManifest.pricing_plan.items[${index}].key duplicates ${itemKey}.`);
1693
+ }
1694
+ seenKeys.add(itemKey);
1695
+ const amountRaw = item.price_minor ?? item.amount_minor ?? item.cost_minor ?? item.value_minor;
1696
+ if (amountRaw === void 0 || amountRaw === null) {
1697
+ throw new SiglumeClientError(`AppManifest.pricing_plan.items[${index}].price_minor is required.`);
1698
+ }
1699
+ const amountMinor = typeof amountRaw === "number" ? amountRaw : typeof amountRaw === "string" && amountRaw.trim() ? Number(amountRaw) : NaN;
1700
+ if (!Number.isInteger(amountMinor)) {
1701
+ throw new SiglumeClientError(`AppManifest.pricing_plan.items[${index}].price_minor must be an integer.`);
1702
+ }
1703
+ if (amountMinor < 0) {
1704
+ throw new SiglumeClientError(`AppManifest.pricing_plan.items[${index}].price_minor must be zero or positive.`);
1705
+ }
1706
+ const currency = String(item.currency ?? planCurrency ?? defaultCurrency ?? "").trim().toUpperCase();
1707
+ if (MINIMUM_JPY_OPERATION_PRICE_CURRENCIES.has(currency) && amountMinor > 0 && amountMinor < MINIMUM_JPY_OPERATION_PRICE_MINOR) {
1708
+ throw new SiglumeClientError(
1709
+ `AppManifest.pricing_plan.items[${index}].price_minor must be 0 or at least ${MINIMUM_JPY_OPERATION_PRICE_MINOR} for JPY/JPYC operation billing.`
1710
+ );
1711
+ }
1712
+ });
1713
+ }
1714
+ function pricingPlanHasItems(plan) {
1715
+ return isRecord2(plan) && Array.isArray(plan.items) && plan.items.length > 0;
1716
+ }
1590
1717
  function buildToolManualQualityReport(payload) {
1591
1718
  const qualityBlock = isRecord2(payload.quality) ? payload.quality : payload;
1592
1719
  const issues = [];
@@ -1662,6 +1789,7 @@ function buildUrl(baseUrl, path, params) {
1662
1789
  }
1663
1790
  function parseListing(data) {
1664
1791
  const metadata = isRecord2(data.metadata) ? data.metadata : {};
1792
+ const pricing_plan = isRecord2(data.pricing_plan) ? data.pricing_plan : isRecord2(metadata.pricing_plan) ? metadata.pricing_plan : null;
1665
1793
  const persistence = isRecord2(data.persistence) ? data.persistence : isRecord2(metadata.persistence) ? metadata.persistence : {};
1666
1794
  return {
1667
1795
  listing_id: String(data.listing_id ?? data.id ?? ""),
@@ -1675,6 +1803,8 @@ function parseListing(data) {
1675
1803
  dry_run_supported: Boolean(data.dry_run_supported ?? false),
1676
1804
  price_model: stringOrNull2(data.price_model),
1677
1805
  price_value_minor: Number(data.price_value_minor ?? 0),
1806
+ pricing_plan,
1807
+ billing_timing: String(data.billing_timing ?? metadata.billing_timing ?? "post"),
1678
1808
  currency: String(data.currency ?? "USD"),
1679
1809
  allow_free_trial: Boolean(data.allow_free_trial ?? false),
1680
1810
  free_trial_duration_days: Number(data.free_trial_duration_days ?? 30),
@@ -2772,10 +2902,11 @@ function cloneJsonLike(value) {
2772
2902
  }
2773
2903
  return value;
2774
2904
  }
2775
- var DEFAULT_SIGLUME_API_BASE, RETRYABLE_STATUS_CODES, CursorPageResult, SiglumeClient;
2905
+ var DEFAULT_SIGLUME_API_BASE, RETRYABLE_STATUS_CODES, MINIMUM_JPY_OPERATION_PRICE_CURRENCIES, CursorPageResult, SiglumeClient;
2776
2906
  var init_client = __esm({
2777
2907
  "src/client.ts"() {
2778
2908
  "use strict";
2909
+ init_types();
2779
2910
  init_errors();
2780
2911
  init_webhooks();
2781
2912
  init_web3();
@@ -2783,6 +2914,7 @@ var init_client = __esm({
2783
2914
  init_utils();
2784
2915
  DEFAULT_SIGLUME_API_BASE = "https://siglume.com/v1";
2785
2916
  RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
2917
+ MINIMUM_JPY_OPERATION_PRICE_CURRENCIES = /* @__PURE__ */ new Set(["JPY", "JPYC"]);
2786
2918
  CursorPageResult = class {
2787
2919
  items;
2788
2920
  next_cursor;
@@ -2890,6 +3022,8 @@ var init_client = __esm({
2890
3022
  "jurisdiction",
2891
3023
  "price_model",
2892
3024
  "price_value_minor",
3025
+ "pricing_plan",
3026
+ "billing_timing",
2893
3027
  "currency",
2894
3028
  "allow_free_trial",
2895
3029
  "free_trial_duration_days",
@@ -2906,6 +3040,16 @@ var init_client = __esm({
2906
3040
  payload[fieldName] = value;
2907
3041
  }
2908
3042
  }
3043
+ if (payload.pricing_plan !== void 0 && (typeof payload.pricing_plan !== "object" || Array.isArray(payload.pricing_plan))) {
3044
+ throw new SiglumeClientError("AppManifest.pricing_plan must be an object when provided.");
3045
+ }
3046
+ if (payload.billing_timing !== void 0 && payload.billing_timing !== null) {
3047
+ const billingTiming = String(payload.billing_timing || "post").trim().toLowerCase();
3048
+ if (billingTiming !== "post" && billingTiming !== "prepay") {
3049
+ throw new SiglumeClientError("AppManifest.billing_timing must be 'post' or 'prepay'.");
3050
+ }
3051
+ payload.billing_timing = billingTiming;
3052
+ }
2909
3053
  if (payload.store_vertical === void 0 || payload.store_vertical === null) {
2910
3054
  throw new SiglumeClientError(
2911
3055
  "AppManifest.store_vertical is required. Choose 'api' for normal API Store listings or 'game' for API games."
@@ -2921,6 +3065,13 @@ var init_client = __esm({
2921
3065
  throw new SiglumeClientError(`AppManifest.currency must be 'USD' or 'JPY'. Got ${String(payload.currency)}.`);
2922
3066
  }
2923
3067
  payload.currency = currency;
3068
+ if (payload.pricing_plan !== void 0) {
3069
+ validatePricingPlanFloor(payload.pricing_plan, currency);
3070
+ }
3071
+ const priceModel = String(payload.price_model ?? "free").trim().toLowerCase();
3072
+ if ((priceModel === "usage_based" || priceModel === "per_action") && !pricingPlanHasItems(payload.pricing_plan)) {
3073
+ throw new SiglumeClientError("AppManifest.pricing_plan.items is required for usage_based/per_action pricing.");
3074
+ }
2924
3075
  if (payload.allow_free_trial === void 0 || payload.allow_free_trial === null) {
2925
3076
  throw new SiglumeClientError(
2926
3077
  "AppManifest.allow_free_trial is required. Pass true to offer a Plus/Pro buyer free trial or false to disable trials."
@@ -6463,73 +6614,8 @@ function toRecord3(value) {
6463
6614
  init_metering();
6464
6615
  init_operations();
6465
6616
 
6466
- // src/types.ts
6467
- var PermissionClass = {
6468
- READ_ONLY: "read-only",
6469
- ACTION: "action",
6470
- PAYMENT: "payment",
6471
- /** @deprecated Use READ_ONLY. Behaves identically. */
6472
- RECOMMENDATION: "recommendation"
6473
- };
6474
- var ApprovalMode = {
6475
- AUTO: "auto",
6476
- BUDGET_BOUNDED: "budget-bounded",
6477
- ALWAYS_ASK: "always-ask",
6478
- DENY: "deny"
6479
- };
6480
- var ExecutionKind = {
6481
- DRY_RUN: "dry_run",
6482
- QUOTE: "quote",
6483
- ACTION: "action",
6484
- PAYMENT: "payment"
6485
- };
6486
- var Environment = {
6487
- SANDBOX: "sandbox",
6488
- LIVE: "live"
6489
- };
6490
- var PriceModel = {
6491
- FREE: "free",
6492
- SUBSCRIPTION: "subscription",
6493
- ONE_TIME: "one_time",
6494
- BUNDLE: "bundle",
6495
- USAGE_BASED: "usage_based",
6496
- PER_ACTION: "per_action"
6497
- };
6498
- var AppCategory = {
6499
- COMMERCE: "commerce",
6500
- BOOKING: "booking",
6501
- CRM: "crm",
6502
- FINANCE: "finance",
6503
- DOCUMENT: "document",
6504
- COMMUNICATION: "communication",
6505
- MONITORING: "monitoring",
6506
- OTHER: "other"
6507
- };
6508
- var StoreVertical = {
6509
- API: "api",
6510
- GAME: "game"
6511
- };
6512
- var ListingCurrency = {
6513
- USD: "USD",
6514
- JPY: "JPY"
6515
- };
6516
- var PersistenceMode = {
6517
- NONE: "none",
6518
- LOCAL: "local",
6519
- PLATFORM: "platform",
6520
- DEVELOPER_SERVER: "developer_server"
6521
- };
6522
- var ToolManualPermissionClass = {
6523
- READ_ONLY: "read_only",
6524
- ACTION: "action",
6525
- PAYMENT: "payment"
6526
- };
6527
- var SettlementMode = {
6528
- STRIPE_CHECKOUT: "stripe_checkout",
6529
- STRIPE_PAYMENT_INTENT: "stripe_payment_intent",
6530
- POLYGON_MANDATE: "polygon_mandate",
6531
- EMBEDDED_WALLET_CHARGE: "embedded_wallet_charge"
6532
- };
6617
+ // src/runtime.ts
6618
+ init_types();
6533
6619
 
6534
6620
  // src/testing/recorder.ts
6535
6621
  var CASSETTE_VERSION = 1;
@@ -6927,6 +7013,7 @@ Actual: ${requestSignature(requestRecord, ignoreBodyFields)}`
6927
7013
  };
6928
7014
 
6929
7015
  // src/tool-manual-validator.ts
7016
+ init_types();
6930
7017
  init_utils();
6931
7018
  var JURISDICTION_PATTERN = /^[A-Z]{2}(-[A-Z0-9]{1,3})?$/;
6932
7019
  var TOOL_NAME_RE = /^[A-Za-z0-9_]{3,64}$/;
@@ -7201,6 +7288,64 @@ function validate_tool_manual(manualInput) {
7201
7288
  // src/runtime.ts
7202
7289
  init_web3();
7203
7290
  var CAPABILITY_KEY_RE = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
7291
+ var MINIMUM_JPY_OPERATION_PRICE_CURRENCIES2 = /* @__PURE__ */ new Set(["JPY", "JPYC"]);
7292
+ function pricingPlanFloorIssues(plan, defaultCurrency) {
7293
+ const issues = [];
7294
+ if (plan === void 0 || plan === null) {
7295
+ return issues;
7296
+ }
7297
+ if (typeof plan !== "object" || Array.isArray(plan)) {
7298
+ return ["pricing_plan must be an object when provided"];
7299
+ }
7300
+ const record = plan;
7301
+ const items = record.items;
7302
+ if (items === void 0 || items === null) {
7303
+ return issues;
7304
+ }
7305
+ if (!Array.isArray(items)) {
7306
+ return ["pricing_plan.items must be an array when provided"];
7307
+ }
7308
+ const planCurrency = String(record.currency ?? defaultCurrency ?? "").trim().toUpperCase();
7309
+ const seenKeys = /* @__PURE__ */ new Set();
7310
+ items.forEach((item, index) => {
7311
+ if (typeof item !== "object" || item === null || Array.isArray(item)) {
7312
+ issues.push(`pricing_plan.items[${index}] must be an object`);
7313
+ return;
7314
+ }
7315
+ const itemRecord = item;
7316
+ const itemKey = String(
7317
+ itemRecord.key ?? itemRecord.operation ?? itemRecord.operation_key ?? itemRecord.request_type ?? itemRecord.receipt_code ?? itemRecord.action ?? ""
7318
+ ).trim();
7319
+ if (!itemKey) {
7320
+ issues.push(`pricing_plan.items[${index}].key is required`);
7321
+ } else if (seenKeys.has(itemKey)) {
7322
+ issues.push(`pricing_plan.items[${index}].key duplicates ${itemKey}`);
7323
+ } else {
7324
+ seenKeys.add(itemKey);
7325
+ }
7326
+ const amountRaw = itemRecord.price_minor ?? itemRecord.amount_minor ?? itemRecord.cost_minor ?? itemRecord.value_minor;
7327
+ if (amountRaw === void 0 || amountRaw === null) {
7328
+ issues.push(`pricing_plan.items[${index}].price_minor is required`);
7329
+ return;
7330
+ }
7331
+ const amountMinor = typeof amountRaw === "number" ? amountRaw : typeof amountRaw === "string" && amountRaw.trim() ? Number(amountRaw) : NaN;
7332
+ if (!Number.isInteger(amountMinor)) {
7333
+ issues.push(`pricing_plan.items[${index}].price_minor must be an integer`);
7334
+ return;
7335
+ }
7336
+ if (amountMinor < 0) {
7337
+ issues.push(`pricing_plan.items[${index}].price_minor must be zero or positive`);
7338
+ return;
7339
+ }
7340
+ const currency = String(itemRecord.currency ?? planCurrency ?? defaultCurrency ?? "").trim().toUpperCase();
7341
+ if (MINIMUM_JPY_OPERATION_PRICE_CURRENCIES2.has(currency) && amountMinor > 0 && amountMinor < MINIMUM_JPY_OPERATION_PRICE_MINOR) {
7342
+ issues.push(
7343
+ `pricing_plan.items[${index}].price_minor must be 0 or at least ${MINIMUM_JPY_OPERATION_PRICE_MINOR} for JPY/JPYC operation billing`
7344
+ );
7345
+ }
7346
+ });
7347
+ return issues;
7348
+ }
7204
7349
  function normalizeExecutionResult(result, executionKind) {
7205
7350
  return {
7206
7351
  success: Boolean(result.success),
@@ -7302,6 +7447,13 @@ var AppTestHarness = class {
7302
7447
  if (!manifest.example_prompts || manifest.example_prompts.length === 0) {
7303
7448
  issues.push("at least one example_prompt is recommended");
7304
7449
  }
7450
+ issues.push(...pricingPlanFloorIssues(manifest.pricing_plan, String(manifest.currency ?? "USD")));
7451
+ if (manifest.billing_timing !== void 0 && manifest.billing_timing !== "post" && manifest.billing_timing !== "prepay") {
7452
+ issues.push("billing_timing must be 'post' or 'prepay'");
7453
+ }
7454
+ if ((manifest.price_model === PriceModel.USAGE_BASED || manifest.price_model === PriceModel.PER_ACTION) && (!manifest.pricing_plan || !Array.isArray(manifest.pricing_plan.items) || manifest.pricing_plan.items.length === 0)) {
7455
+ issues.push("pricing_plan.items is required for usage_based/per_action pricing");
7456
+ }
7305
7457
  if (manifest.permission_class === PermissionClass.ACTION || manifest.permission_class === PermissionClass.PAYMENT) {
7306
7458
  if (!manifest.dry_run_supported) {
7307
7459
  issues.push("action/payment apps should support dry_run");
@@ -7377,7 +7529,7 @@ var AppTestHarness = class {
7377
7529
  };
7378
7530
  }
7379
7531
  return {
7380
- experimental: manifest.price_model === PriceModel.USAGE_BASED || manifest.price_model === PriceModel.PER_ACTION,
7532
+ experimental: false,
7381
7533
  usage_record,
7382
7534
  invoice_line_preview
7383
7535
  };
@@ -8803,6 +8955,7 @@ function readEnv(name) {
8803
8955
  }
8804
8956
 
8805
8957
  // src/index.ts
8958
+ init_types();
8806
8959
  init_web3();
8807
8960
  init_webhooks();
8808
8961
  init_utils();
@@ -8822,6 +8975,7 @@ export {
8822
8975
  InMemoryWebhookDedupe,
8823
8976
  LLMProvider,
8824
8977
  ListingCurrency,
8978
+ MINIMUM_JPY_OPERATION_PRICE_MINOR,
8825
8979
  MeterClient,
8826
8980
  OpenAIProvider,
8827
8981
  PermissionClass,