@spacefast/common 0.2.1 → 0.2.2

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.
@@ -125,6 +125,12 @@ declare const InternalBuildExecutionSchema: z.ZodObject<{
125
125
  command: "command";
126
126
  timeout: "timeout";
127
127
  }>>;
128
+ observedCliError: z.ZodOptional<z.ZodObject<{
129
+ code: z.ZodString;
130
+ message: z.ZodString;
131
+ retryable: z.ZodOptional<z.ZodBoolean>;
132
+ recovery: z.ZodOptional<z.ZodString>;
133
+ }, z.core.$strip>>;
128
134
  artifactDeadlineAt: z.ZodOptional<z.ZodString>;
129
135
  launch: z.ZodOptional<z.ZodObject<{
130
136
  state: z.ZodEnum<{
@@ -184,6 +184,12 @@ const buildExecutionSupervisionSchema = z.object({
184
184
  owner: z.string().min(1),
185
185
  leaseExpiresAt: z.string().datetime(),
186
186
  });
187
+ const buildExecutionObservedCliErrorSchema = z.object({
188
+ code: z.string().min(1).max(128),
189
+ message: z.string().min(1).max(8_192),
190
+ retryable: z.boolean().optional(),
191
+ recovery: z.string().min(1).max(8_192).optional(),
192
+ });
187
193
  const InternalBuildExecutionSchema = z
188
194
  .object({
189
195
  runner: z.string().nullable().default(null),
@@ -193,6 +199,9 @@ const InternalBuildExecutionSchema = z
193
199
  logOffset: z.number().int().nonnegative().optional(),
194
200
  exitCode: z.number().int().min(0).max(255).optional(),
195
201
  terminationReason: z.enum(["command", "timeout"]).optional(),
202
+ observedCliError: buildExecutionObservedCliErrorSchema
203
+ .optional()
204
+ .describe("The observer stores the latest structured CLI error with the remote log cursor."),
196
205
  artifactDeadlineAt: z
197
206
  .string()
198
207
  .datetime()
@@ -815,6 +815,10 @@ export declare const ERROR_CODE_META: {
815
815
  readonly retryable: false;
816
816
  readonly recovery: "fix_input";
817
817
  };
818
+ readonly next_version_unsupported: {
819
+ readonly retryable: false;
820
+ readonly recovery: "fix_input";
821
+ };
818
822
  readonly no_space_selected: {
819
823
  readonly retryable: false;
820
824
  readonly recovery: "fix_input";
@@ -277,6 +277,7 @@ export const ERROR_CODE_META = {
277
277
  name_managed_by_config: { retryable: false, recovery: "fix_input" },
278
278
  nameserver_delegation_required: { retryable: false, recovery: "fix_input" },
279
279
  nameserver_divergence: { retryable: false, recovery: "fix_input" },
280
+ next_version_unsupported: { retryable: false, recovery: "fix_input" },
280
281
  no_space_selected: { retryable: false, recovery: "fix_input" },
281
282
  noop_publish: { retryable: false, recovery: "fix_input" },
282
283
  not_enrolled: { retryable: false, recovery: "fix_input" },
@@ -5,7 +5,7 @@ export declare const PROBLEM_CONTENT_TYPE = "application/problem+json";
5
5
  export declare function errorDocsUrl(code: string): string;
6
6
  /** Problem `title`: the snake_case code as a sentence ("version_not_found" -> "Version not found"). */
7
7
  export declare function errorTitle(code: string): string;
8
- export declare const ERROR_CODES: readonly ["abuse_report_invalid_transition", "abuse_report_rate_limited", "abuse_takedown", "access_denied", "account_suspended", "agent_handoff_declined", "agent_handoff_limit_reached", "agent_handoff_origin_unsupported", "ambiguous_space_slug", "anonymous_expired", "anonymous_publish_rate_limited", "anonymous_space_limit_reached", "api_key_scope_underivable", "archive_too_large", "auth_code_required", "authorization_level_not_allowed", "authorization_pending", "blob_gate_record_missing", "blob_gate_token_invalid", "build_command_missing", "build_execution_unavailable", "build_failed", "build_install_failed", "build_no_index_html", "build_not_created", "build_oom", "build_output_contains_server_bundle", "build_output_dir_missing", "build_timeout", "cache_purge_domain_required", "cache_purge_path_required", "channel_name_reserved", "channel_pointer_moved", "channel_unsupported", "claim_blocked_takedown", "claim_target_not_found", "claimed_space_quota_exceeded", "cli_upgrade_required", "config_file_too_large", "config_functions_key_removed", "config_invalid", "config_meta_too_long", "config_name_too_long", "config_runtime_entry_missing", "config_runtime_invalid_kind", "config_templates_over_limit", "confirmation_denied", "confirmation_expired", "confirmation_mismatch", "confirmation_required", "confirmation_token_required", "continuation_unavailable", "continuation_used", "credential_expired", "credential_not_yet_valid", "credential_retired", "credential_revoked", "credential_sponsor_inactive", "csam_blocked", "csam_policy_floor", "dashboard_prefs_key_invalid", "dashboard_prefs_too_large", "dashboard_prefs_too_many_keys", "data_location_immutable", "db_not_available", "decision_execution_lost", "decision_in_progress", "device_authorization_failed", "device_verification_rate_limited", "dns_export_required", "dns_field_conflict", "dns_field_not_applicable", "dns_import_partial_visibility", "dns_provider_auth_expired", "dns_provider_batch_unsupported", "dns_provider_change_pending", "dns_provider_conflict", "dns_provider_connection_in_use", "dns_provider_connection_unavailable", "dns_provider_controlled_desired_state", "dns_provider_credentials_expired", "dns_provider_feature_descriptors", "dns_provider_feature_unavailable", "dns_provider_field_unsupported", "dns_provider_future_authoritative_backend", "dns_provider_missing_permission", "dns_provider_not_connected", "dns_provider_operation_failed", "dns_provider_permission_denied", "dns_provider_rate_limited", "dns_provider_replace_all_requires_fresh_plan", "dns_provider_replace_all_write_strategy", "dns_provider_snapshot_stale", "dns_provider_snapshot_unavailable", "dns_provider_temporarily_unavailable", "dns_provider_timeout", "dns_provider_validation_failed", "dns_provider_workflow_templates", "dns_provider_zone_not_found", "dns_record_conflicts_with_managed", "dns_record_managed", "dns_record_not_found", "domain_already_exists", "domain_bound", "domain_facet_already_managed", "domain_facet_external", "domain_facet_not_applicable", "domain_hostname_site_mismatch", "domain_in_use", "domain_lookup_rate_limited", "domain_not_bound", "domain_quota_exceeded", "domain_registration_active", "domain_registration_not_renewable", "domain_reserved_suffix", "domain_transfer_active", "domain_wildcard_label", "domain_wildcard_not_enabled", "download_required", "duplicate_version_path", "elevation_not_required", "email_already_claimed", "email_verification_code_invalid", "enforcement_policy_overlap", "event_payload_too_large", "event_rate_limited", "expired_token", "feature_unavailable", "files_mode_does_not_support_spa", "forbidden", "free_external_proxy_disabled", "idempotency_conflict_in_progress", "idempotency_key_reused", "incumbent_controls_dns", "ingest_admission_exceeded", "inject_invalid", "inject_snippet_too_large", "insufficient_scope", "internal_error", "invalid_claim_token", "invalid_continuation_token", "invalid_data_location", "invalid_decision_state", "invalid_device_code", "invalid_domain", "invalid_domain_name", "invalid_elevation_request", "invalid_file_path", "invalid_grant", "invalid_idempotency_key", "invalid_publish_archive", "invalid_publish_path", "invalid_publish_payload", "invalid_request", "invalid_runtime_event", "invalid_space", "invalid_space_mode", "invalid_usage_bucket", "invalid_usage_correction", "invalid_usage_window", "invalid_user_code", "invalid_version_path", "invalid_webhook_events", "invalid_webhook_payload", "invalid_webhook_signature", "invalid_webhook_url", "invalid_zero_realtime_event", "invalid_zero_realtime_replay_query", "invitation_already_exists", "invitation_email_mismatch", "invitation_expired", "invitation_not_pending", "ip_blocked", "issuer_exists", "issuer_not_active", "issuer_proof_invalid", "issuer_tenant_occupied", "issuer_unknown", "job_not_found", "job_not_promotable", "job_not_removable", "job_not_retryable", "last_owner", "log_retention_clamped", "lost_domain_control", "maintenance_in_progress", "malware_detected", "managed_domain_protected", "manifest_body_too_large", "manifest_duplicate_path", "manifest_too_many_files", "member_already_exists", "method_not_allowed", "missing_route_param", "move_target_capacity_lost", "name_managed_by_config", "nameserver_delegation_required", "nameserver_divergence", "no_space_selected", "noop_publish", "not_enrolled", "not_found", "partner_preset_not_grantable", "partner_tenant_immutable_client", "password_already_set", "password_compromised", "path_case_collision", "path_too_long", "placement_invalid_burstable", "plan_grant_already_active", "plan_grant_already_revoked", "plan_unknown", "policy_exceeds_grantor", "prebuilt_metadata_invalid", "primary_email_not_removable", "principal_closed", "principal_has_active_spaces", "principal_not_found", "principal_space_mismatch", "principal_suspended", "principal_suspension_locked", "promote_admission_exceeded", "promotion_live_content_missing", "promotion_live_system_space_invalid", "promotion_live_system_space_not_designated", "promotion_not_live_tenant", "promotion_nothing_to_promote", "promotion_runtime_publish_incomplete", "promotion_test_twin_missing", "provider_error", "provider_job_failed", "provider_job_timeout", "provider_privilege", "provider_runtime_feature_unsupported", "provider_site_id_required", "proxy_upstream_denied", "proxy_upstream_unresolved", "publish_archive_compression_ratio_exceeded", "publish_archive_expanded_size_exceeded", "publish_archive_file_count_exceeded", "publish_archive_too_large", "publish_base_changed", "publish_bytes_missing", "publish_config_unsupported", "publish_failed", "publish_file_missing", "publish_hash_mismatch", "publish_inline_limit_exceeded", "publish_not_cancelable", "publish_path_collision", "publish_path_invalid", "publish_session_expired", "publish_setup_failed", "publish_snapshot_empty", "publish_upload_failed", "publish_verification_failed", "queue_not_found", "quota_exceeded", "rate_limited", "registration_expired", "registration_expiring", "resource_revision_changed", "response_headers_unservable", "response_table_too_large", "review_item_claimed", "routing_rules_over_plan", "runtime_action_forbidden", "runtime_api_not_found", "runtime_callback_forbidden", "runtime_dev_unsupported", "runtime_hostname_unassigned", "runtime_instance_mismatch", "runtime_jti_missing", "runtime_jti_replayed", "runtime_jwks_key_missing", "runtime_kind_mismatch", "runtime_management_unavailable", "runtime_not_provisioned", "runtime_operation_missing", "runtime_purge_failed", "runtime_release_unverifiable", "runtime_scope_forbidden", "runtime_token_bad_signature", "runtime_token_expired", "runtime_token_invalid", "runtime_unauthorized", "runtime_upload_operation_not_supported", "runtime_upload_required", "scan_pending", "secret_variable_in_template", "service_booting", "service_signature_invalid", "session_not_fresh", "site_already_deleted", "site_has_live_spaces", "site_not_static", "site_required", "site_suspended", "slow_down", "slug_invalid", "slug_reserved", "slug_unavailable", "source_archive_decompression_timeout", "source_archive_expansion_ratio_exceeded", "source_archive_validation_busy", "space_already_claimed", "space_claim_unavailable", "space_claimed_credential_available", "space_disabled", "space_expired", "space_has_active_publish", "space_has_active_version", "space_hostname_identity_missing", "space_no_live_version", "space_not_disabled", "space_not_restorable", "space_person_already_member", "space_person_invitation_pending", "space_person_self_invite", "space_ref_ambiguous", "space_ref_required", "space_selection_conflict", "space_transferring", "space_unclaimed", "ssl_renewal_blocked", "static_control_file_not_supported", "static_runtime_control_path_not_supported", "static_runtime_required", "storage_auth_required", "storage_bucket_unavailable", "storage_content_blocked", "storage_delete_forbidden", "storage_empty_file", "storage_file_too_large", "storage_key_invalid", "storage_object_not_found", "storage_quota_already_unlimited", "storage_quota_decrease_not_supported", "storage_quota_exceeded", "storage_unavailable", "stripe_error", "superadmin_two_factor_required", "superadmin_wpcom_account_required", "superseded_by_publish", "system_space_conflict", "system_space_invalid", "takeover_notice_window", "team_member_quota_exceeded", "team_ref_required", "team_required", "team_scope_mismatch", "team_slug_conflict", "template_file_too_large", "template_not_in_version", "template_variable_unresolved", "tenant_id_mismatch", "tenant_not_found", "tenant_not_granted", "tenant_past_due", "tenant_selection_required", "tenant_suspended", "theme_value_invalid", "token_alg_invalid", "token_audience_mismatch", "token_claims_invalid", "token_header_forbidden", "token_malformed", "token_signature_invalid", "token_subject_invalid", "token_ttl_invalid", "token_type_invalid", "transfer_cross_tenant_unsupported", "transfer_not_cancelable", "transfer_push_failed", "transfer_source_changed", "transfer_target_same_as_source", "transfer_verify_failed", "unauthorized", "unsupported_publish_media_type", "upload_hash_mismatch", "upload_path_not_canonical", "upload_path_not_declared", "upload_size_mismatch", "usage_period_not_found", "user_banned", "validation_error", "verification_required", "version_already_live", "version_artifact_not_found", "version_busy", "version_canceled", "version_closed", "version_expired", "version_failed", "version_file_count_exceeded", "version_file_not_found", "version_file_too_large", "version_files_missing", "version_in_use", "version_live", "version_no_publishable_files", "version_not_finalizable", "version_not_found", "version_not_prepared", "version_not_promotable", "version_not_ready", "version_quota_exceeded", "version_total_bytes_exceeded", "webhook_delivery_budget_exceeded", "webhook_managed_by_manifest", "whois_unavailable", "wp_cloud_assignment_kind_mismatch", "wp_cloud_assignment_space_mismatch", "wp_cloud_assignment_team_mismatch", "wp_cloud_client_in_use", "wp_cloud_client_not_found", "wp_cloud_site_still_assigned", "wp_cloud_team_shared_site_exists", "wp_cloud_webhook_secret_not_configured", "zero_ai_unavailable", "zero_artifact_abi_mismatch", "zero_artifact_invalid", "zero_artifact_malformed", "zero_artifact_path_invalid", "zero_artifact_unreadable", "zero_auth_unavailable", "zero_blob_key_invalid", "zero_blob_store_full", "zero_blob_too_large", "zero_blob_value_invalid", "zero_bootstrap_encode_failed", "zero_bytecode_hash_mismatch", "zero_bytecode_invalid", "zero_bytecode_path_invalid", "zero_bytecode_unreadable", "zero_capabilities_encode_failed", "zero_client_bundle_not_loaded", "zero_db_connect_failed", "zero_db_execute_failed", "zero_db_export_cursor_invalid", "zero_db_export_failed", "zero_db_export_page_too_large", "zero_db_export_query_invalid", "zero_db_export_schema_changed", "zero_db_export_schema_unavailable", "zero_db_host_install_failed", "zero_db_operation_invalid", "zero_db_operation_too_large", "zero_db_param_invalid", "zero_db_query_failed", "zero_db_row_invalid", "zero_db_sql_invalid", "zero_db_target_denied", "zero_db_tls_required", "zero_db_too_many_params", "zero_db_transaction_active", "zero_db_transaction_commit_failed", "zero_db_transaction_invalid", "zero_db_transaction_missing", "zero_db_transaction_rollback_failed", "zero_db_transaction_start_failed", "zero_db_url_invalid", "zero_db_url_missing", "zero_dev_endpoint_failed", "zero_dump_query_invalid", "zero_email_unavailable", "zero_endpoint_compile_failed", "zero_endpoint_conflict", "zero_endpoint_duplicate", "zero_endpoint_id_duplicate", "zero_endpoint_index_invalid", "zero_endpoint_index_malformed", "zero_endpoint_index_path_invalid", "zero_endpoint_index_unreadable", "zero_endpoint_invalid", "zero_endpoint_mismatch", "zero_endpoint_not_found", "zero_endpoints_invalid", "zero_endpoints_too_many", "zero_envelope_encode_failed", "zero_gravatar_unavailable", "zero_js_context_init_failed", "zero_js_execution_failed", "zero_js_execution_timeout", "zero_js_globals_failed", "zero_js_response_malformed", "zero_js_runtime_init_failed", "zero_log_query_invalid", "zero_method_not_allowed", "zero_migration_failed", "zero_query_name_missing", "zero_realtime_forbidden", "zero_realtime_message_invalid", "zero_realtime_operation_unsupported", "zero_realtime_query_invalid", "zero_realtime_space_required", "zero_realtime_unavailable", "zero_realtime_websocket_forbidden", "zero_replay_failed", "zero_replay_query_invalid", "zero_replay_unavailable", "zero_request_body_too_large", "zero_response_header_forbidden", "zero_response_header_invalid", "zero_response_too_large", "zero_routes_invalid", "zero_run_compile_failed", "zero_run_duplicate", "zero_run_invalid", "zero_run_operation_unsupported", "zero_runner_envelope_invalid", "zero_runner_failed", "zero_runner_invalid_body", "zero_runner_invalid_response", "zero_runner_invalid_status", "zero_runner_protocol_unsupported", "zero_runner_response_encode_failed", "zero_runner_stdin_invalid", "zero_runner_stdin_too_large", "zero_runner_unavailable", "zero_runs_invalid", "zero_runs_require_runtime_compiler", "zero_runs_too_many", "zero_spam_unavailable"];
8
+ export declare const ERROR_CODES: readonly ["abuse_report_invalid_transition", "abuse_report_rate_limited", "abuse_takedown", "access_denied", "account_suspended", "agent_handoff_declined", "agent_handoff_limit_reached", "agent_handoff_origin_unsupported", "ambiguous_space_slug", "anonymous_expired", "anonymous_publish_rate_limited", "anonymous_space_limit_reached", "api_key_scope_underivable", "archive_too_large", "auth_code_required", "authorization_level_not_allowed", "authorization_pending", "blob_gate_record_missing", "blob_gate_token_invalid", "build_command_missing", "build_execution_unavailable", "build_failed", "build_install_failed", "build_no_index_html", "build_not_created", "build_oom", "build_output_contains_server_bundle", "build_output_dir_missing", "build_timeout", "cache_purge_domain_required", "cache_purge_path_required", "channel_name_reserved", "channel_pointer_moved", "channel_unsupported", "claim_blocked_takedown", "claim_target_not_found", "claimed_space_quota_exceeded", "cli_upgrade_required", "config_file_too_large", "config_functions_key_removed", "config_invalid", "config_meta_too_long", "config_name_too_long", "config_runtime_entry_missing", "config_runtime_invalid_kind", "config_templates_over_limit", "confirmation_denied", "confirmation_expired", "confirmation_mismatch", "confirmation_required", "confirmation_token_required", "continuation_unavailable", "continuation_used", "credential_expired", "credential_not_yet_valid", "credential_retired", "credential_revoked", "credential_sponsor_inactive", "csam_blocked", "csam_policy_floor", "dashboard_prefs_key_invalid", "dashboard_prefs_too_large", "dashboard_prefs_too_many_keys", "data_location_immutable", "db_not_available", "decision_execution_lost", "decision_in_progress", "device_authorization_failed", "device_verification_rate_limited", "dns_export_required", "dns_field_conflict", "dns_field_not_applicable", "dns_import_partial_visibility", "dns_provider_auth_expired", "dns_provider_batch_unsupported", "dns_provider_change_pending", "dns_provider_conflict", "dns_provider_connection_in_use", "dns_provider_connection_unavailable", "dns_provider_controlled_desired_state", "dns_provider_credentials_expired", "dns_provider_feature_descriptors", "dns_provider_feature_unavailable", "dns_provider_field_unsupported", "dns_provider_future_authoritative_backend", "dns_provider_missing_permission", "dns_provider_not_connected", "dns_provider_operation_failed", "dns_provider_permission_denied", "dns_provider_rate_limited", "dns_provider_replace_all_requires_fresh_plan", "dns_provider_replace_all_write_strategy", "dns_provider_snapshot_stale", "dns_provider_snapshot_unavailable", "dns_provider_temporarily_unavailable", "dns_provider_timeout", "dns_provider_validation_failed", "dns_provider_workflow_templates", "dns_provider_zone_not_found", "dns_record_conflicts_with_managed", "dns_record_managed", "dns_record_not_found", "domain_already_exists", "domain_bound", "domain_facet_already_managed", "domain_facet_external", "domain_facet_not_applicable", "domain_hostname_site_mismatch", "domain_in_use", "domain_lookup_rate_limited", "domain_not_bound", "domain_quota_exceeded", "domain_registration_active", "domain_registration_not_renewable", "domain_reserved_suffix", "domain_transfer_active", "domain_wildcard_label", "domain_wildcard_not_enabled", "download_required", "duplicate_version_path", "elevation_not_required", "email_already_claimed", "email_verification_code_invalid", "enforcement_policy_overlap", "event_payload_too_large", "event_rate_limited", "expired_token", "feature_unavailable", "files_mode_does_not_support_spa", "forbidden", "free_external_proxy_disabled", "idempotency_conflict_in_progress", "idempotency_key_reused", "incumbent_controls_dns", "ingest_admission_exceeded", "inject_invalid", "inject_snippet_too_large", "insufficient_scope", "internal_error", "invalid_claim_token", "invalid_continuation_token", "invalid_data_location", "invalid_decision_state", "invalid_device_code", "invalid_domain", "invalid_domain_name", "invalid_elevation_request", "invalid_file_path", "invalid_grant", "invalid_idempotency_key", "invalid_publish_archive", "invalid_publish_path", "invalid_publish_payload", "invalid_request", "invalid_runtime_event", "invalid_space", "invalid_space_mode", "invalid_usage_bucket", "invalid_usage_correction", "invalid_usage_window", "invalid_user_code", "invalid_version_path", "invalid_webhook_events", "invalid_webhook_payload", "invalid_webhook_signature", "invalid_webhook_url", "invalid_zero_realtime_event", "invalid_zero_realtime_replay_query", "invitation_already_exists", "invitation_email_mismatch", "invitation_expired", "invitation_not_pending", "ip_blocked", "issuer_exists", "issuer_not_active", "issuer_proof_invalid", "issuer_tenant_occupied", "issuer_unknown", "job_not_found", "job_not_promotable", "job_not_removable", "job_not_retryable", "last_owner", "log_retention_clamped", "lost_domain_control", "maintenance_in_progress", "malware_detected", "managed_domain_protected", "manifest_body_too_large", "manifest_duplicate_path", "manifest_too_many_files", "member_already_exists", "method_not_allowed", "missing_route_param", "move_target_capacity_lost", "name_managed_by_config", "nameserver_delegation_required", "nameserver_divergence", "next_version_unsupported", "no_space_selected", "noop_publish", "not_enrolled", "not_found", "partner_preset_not_grantable", "partner_tenant_immutable_client", "password_already_set", "password_compromised", "path_case_collision", "path_too_long", "placement_invalid_burstable", "plan_grant_already_active", "plan_grant_already_revoked", "plan_unknown", "policy_exceeds_grantor", "prebuilt_metadata_invalid", "primary_email_not_removable", "principal_closed", "principal_has_active_spaces", "principal_not_found", "principal_space_mismatch", "principal_suspended", "principal_suspension_locked", "promote_admission_exceeded", "promotion_live_content_missing", "promotion_live_system_space_invalid", "promotion_live_system_space_not_designated", "promotion_not_live_tenant", "promotion_nothing_to_promote", "promotion_runtime_publish_incomplete", "promotion_test_twin_missing", "provider_error", "provider_job_failed", "provider_job_timeout", "provider_privilege", "provider_runtime_feature_unsupported", "provider_site_id_required", "proxy_upstream_denied", "proxy_upstream_unresolved", "publish_archive_compression_ratio_exceeded", "publish_archive_expanded_size_exceeded", "publish_archive_file_count_exceeded", "publish_archive_too_large", "publish_base_changed", "publish_bytes_missing", "publish_config_unsupported", "publish_failed", "publish_file_missing", "publish_hash_mismatch", "publish_inline_limit_exceeded", "publish_not_cancelable", "publish_path_collision", "publish_path_invalid", "publish_session_expired", "publish_setup_failed", "publish_snapshot_empty", "publish_upload_failed", "publish_verification_failed", "queue_not_found", "quota_exceeded", "rate_limited", "registration_expired", "registration_expiring", "resource_revision_changed", "response_headers_unservable", "response_table_too_large", "review_item_claimed", "routing_rules_over_plan", "runtime_action_forbidden", "runtime_api_not_found", "runtime_callback_forbidden", "runtime_dev_unsupported", "runtime_hostname_unassigned", "runtime_instance_mismatch", "runtime_jti_missing", "runtime_jti_replayed", "runtime_jwks_key_missing", "runtime_kind_mismatch", "runtime_management_unavailable", "runtime_not_provisioned", "runtime_operation_missing", "runtime_purge_failed", "runtime_release_unverifiable", "runtime_scope_forbidden", "runtime_token_bad_signature", "runtime_token_expired", "runtime_token_invalid", "runtime_unauthorized", "runtime_upload_operation_not_supported", "runtime_upload_required", "scan_pending", "secret_variable_in_template", "service_booting", "service_signature_invalid", "session_not_fresh", "site_already_deleted", "site_has_live_spaces", "site_not_static", "site_required", "site_suspended", "slow_down", "slug_invalid", "slug_reserved", "slug_unavailable", "source_archive_decompression_timeout", "source_archive_expansion_ratio_exceeded", "source_archive_validation_busy", "space_already_claimed", "space_claim_unavailable", "space_claimed_credential_available", "space_disabled", "space_expired", "space_has_active_publish", "space_has_active_version", "space_hostname_identity_missing", "space_no_live_version", "space_not_disabled", "space_not_restorable", "space_person_already_member", "space_person_invitation_pending", "space_person_self_invite", "space_ref_ambiguous", "space_ref_required", "space_selection_conflict", "space_transferring", "space_unclaimed", "ssl_renewal_blocked", "static_control_file_not_supported", "static_runtime_control_path_not_supported", "static_runtime_required", "storage_auth_required", "storage_bucket_unavailable", "storage_content_blocked", "storage_delete_forbidden", "storage_empty_file", "storage_file_too_large", "storage_key_invalid", "storage_object_not_found", "storage_quota_already_unlimited", "storage_quota_decrease_not_supported", "storage_quota_exceeded", "storage_unavailable", "stripe_error", "superadmin_two_factor_required", "superadmin_wpcom_account_required", "superseded_by_publish", "system_space_conflict", "system_space_invalid", "takeover_notice_window", "team_member_quota_exceeded", "team_ref_required", "team_required", "team_scope_mismatch", "team_slug_conflict", "template_file_too_large", "template_not_in_version", "template_variable_unresolved", "tenant_id_mismatch", "tenant_not_found", "tenant_not_granted", "tenant_past_due", "tenant_selection_required", "tenant_suspended", "theme_value_invalid", "token_alg_invalid", "token_audience_mismatch", "token_claims_invalid", "token_header_forbidden", "token_malformed", "token_signature_invalid", "token_subject_invalid", "token_ttl_invalid", "token_type_invalid", "transfer_cross_tenant_unsupported", "transfer_not_cancelable", "transfer_push_failed", "transfer_source_changed", "transfer_target_same_as_source", "transfer_verify_failed", "unauthorized", "unsupported_publish_media_type", "upload_hash_mismatch", "upload_path_not_canonical", "upload_path_not_declared", "upload_size_mismatch", "usage_period_not_found", "user_banned", "validation_error", "verification_required", "version_already_live", "version_artifact_not_found", "version_busy", "version_canceled", "version_closed", "version_expired", "version_failed", "version_file_count_exceeded", "version_file_not_found", "version_file_too_large", "version_files_missing", "version_in_use", "version_live", "version_no_publishable_files", "version_not_finalizable", "version_not_found", "version_not_prepared", "version_not_promotable", "version_not_ready", "version_quota_exceeded", "version_total_bytes_exceeded", "webhook_delivery_budget_exceeded", "webhook_managed_by_manifest", "whois_unavailable", "wp_cloud_assignment_kind_mismatch", "wp_cloud_assignment_space_mismatch", "wp_cloud_assignment_team_mismatch", "wp_cloud_client_in_use", "wp_cloud_client_not_found", "wp_cloud_site_still_assigned", "wp_cloud_team_shared_site_exists", "wp_cloud_webhook_secret_not_configured", "zero_ai_unavailable", "zero_artifact_abi_mismatch", "zero_artifact_invalid", "zero_artifact_malformed", "zero_artifact_path_invalid", "zero_artifact_unreadable", "zero_auth_unavailable", "zero_blob_key_invalid", "zero_blob_store_full", "zero_blob_too_large", "zero_blob_value_invalid", "zero_bootstrap_encode_failed", "zero_bytecode_hash_mismatch", "zero_bytecode_invalid", "zero_bytecode_path_invalid", "zero_bytecode_unreadable", "zero_capabilities_encode_failed", "zero_client_bundle_not_loaded", "zero_db_connect_failed", "zero_db_execute_failed", "zero_db_export_cursor_invalid", "zero_db_export_failed", "zero_db_export_page_too_large", "zero_db_export_query_invalid", "zero_db_export_schema_changed", "zero_db_export_schema_unavailable", "zero_db_host_install_failed", "zero_db_operation_invalid", "zero_db_operation_too_large", "zero_db_param_invalid", "zero_db_query_failed", "zero_db_row_invalid", "zero_db_sql_invalid", "zero_db_target_denied", "zero_db_tls_required", "zero_db_too_many_params", "zero_db_transaction_active", "zero_db_transaction_commit_failed", "zero_db_transaction_invalid", "zero_db_transaction_missing", "zero_db_transaction_rollback_failed", "zero_db_transaction_start_failed", "zero_db_url_invalid", "zero_db_url_missing", "zero_dev_endpoint_failed", "zero_dump_query_invalid", "zero_email_unavailable", "zero_endpoint_compile_failed", "zero_endpoint_conflict", "zero_endpoint_duplicate", "zero_endpoint_id_duplicate", "zero_endpoint_index_invalid", "zero_endpoint_index_malformed", "zero_endpoint_index_path_invalid", "zero_endpoint_index_unreadable", "zero_endpoint_invalid", "zero_endpoint_mismatch", "zero_endpoint_not_found", "zero_endpoints_invalid", "zero_endpoints_too_many", "zero_envelope_encode_failed", "zero_gravatar_unavailable", "zero_js_context_init_failed", "zero_js_execution_failed", "zero_js_execution_timeout", "zero_js_globals_failed", "zero_js_response_malformed", "zero_js_runtime_init_failed", "zero_log_query_invalid", "zero_method_not_allowed", "zero_migration_failed", "zero_query_name_missing", "zero_realtime_forbidden", "zero_realtime_message_invalid", "zero_realtime_operation_unsupported", "zero_realtime_query_invalid", "zero_realtime_space_required", "zero_realtime_unavailable", "zero_realtime_websocket_forbidden", "zero_replay_failed", "zero_replay_query_invalid", "zero_replay_unavailable", "zero_request_body_too_large", "zero_response_header_forbidden", "zero_response_header_invalid", "zero_response_too_large", "zero_routes_invalid", "zero_run_compile_failed", "zero_run_duplicate", "zero_run_invalid", "zero_run_operation_unsupported", "zero_runner_envelope_invalid", "zero_runner_failed", "zero_runner_invalid_body", "zero_runner_invalid_response", "zero_runner_invalid_status", "zero_runner_protocol_unsupported", "zero_runner_response_encode_failed", "zero_runner_stdin_invalid", "zero_runner_stdin_too_large", "zero_runner_unavailable", "zero_runs_invalid", "zero_runs_require_runtime_compiler", "zero_runs_too_many", "zero_spam_unavailable"];
9
9
  export type ErrorCode = (typeof ERROR_CODES)[number];
10
10
  export declare function isErrorCode(value: string): value is ErrorCode;
11
11
  /**
@@ -218,6 +218,7 @@ export const ERROR_CODES = [
218
218
  "name_managed_by_config",
219
219
  "nameserver_delegation_required",
220
220
  "nameserver_divergence",
221
+ "next_version_unsupported",
221
222
  "no_space_selected",
222
223
  "noop_publish",
223
224
  "not_enrolled",
@@ -41,6 +41,15 @@ export declare const OAUTH_SCOPE_DESCRIPTIONS: {
41
41
  readonly "domains:read": "Read domain inventory and DNS diagnostics.";
42
42
  readonly "domains:write": "Attach, verify, and mutate domains and DNS records.";
43
43
  };
44
+ /**
45
+ * Drop scope ids the vocabulary no longer knows (e.g. a removed scope that
46
+ * older grants still store). Safe and non-widening, same as the api-key
47
+ * action normalizer: a retired scope gates nothing anywhere, so the surviving
48
+ * scopes are the real grant — serving the retired id would present a
49
+ * permission that does not exist, and strict consumers of the provider
50
+ * vocabulary would reject the whole payload over it.
51
+ */
52
+ export declare function knownOAuthScopes(scopes: readonly string[]): OAuthScopeId[];
44
53
  export declare const OAUTH_SCOPE_RISK_TINTS: readonly ["neutral", "warning", "critical"];
45
54
  export type OAuthScopeRiskTint = (typeof OAUTH_SCOPE_RISK_TINTS)[number];
46
55
  export type OAuthScopeId = keyof typeof OAUTH_SCOPE_DESCRIPTIONS;
@@ -73,6 +73,20 @@ export const OAUTH_SCOPE_DESCRIPTIONS = {
73
73
  "domains:read": "Read domain inventory and DNS diagnostics.",
74
74
  "domains:write": "Attach, verify, and mutate domains and DNS records.",
75
75
  };
76
+ const OAUTH_PROVIDER_SCOPE_SET = new Set(OAUTH_PROVIDER_SCOPES);
77
+ /**
78
+ * Drop scope ids the vocabulary no longer knows (e.g. a removed scope that
79
+ * older grants still store). Safe and non-widening, same as the api-key
80
+ * action normalizer: a retired scope gates nothing anywhere, so the surviving
81
+ * scopes are the real grant — serving the retired id would present a
82
+ * permission that does not exist, and strict consumers of the provider
83
+ * vocabulary would reject the whole payload over it.
84
+ */
85
+ export function knownOAuthScopes(scopes) {
86
+ return [
87
+ ...new Set(scopes.filter((scope) => OAUTH_PROVIDER_SCOPE_SET.has(scope))),
88
+ ];
89
+ }
76
90
  export const OAUTH_SCOPE_RISK_TINTS = ["neutral", "warning", "critical"];
77
91
  /**
78
92
  * Human-facing permission copy shared by every authorization surface. Keep raw
@@ -786,6 +786,10 @@ export declare const ERROR_DOCS: {
786
786
  summary: string;
787
787
  fix: string;
788
788
  };
789
+ next_version_unsupported: {
790
+ summary: string;
791
+ fix: string;
792
+ };
789
793
  no_space_selected: {
790
794
  summary: string;
791
795
  fix: string;
@@ -788,6 +788,10 @@ export const ERROR_DOCS = {
788
788
  summary: "The domain's observed nameservers diverge from the expected set.",
789
789
  fix: "Align the registrar's nameserver records with the expected set, then re-check.",
790
790
  },
791
+ next_version_unsupported: {
792
+ summary: "This Next.js version is incompatible with the bundled server runtime adapter.",
793
+ fix: "Upgrade Next.js to the minimum version named in the error, or publish a browser-ready static export.",
794
+ },
791
795
  no_space_selected: {
792
796
  summary: "The command needs a Space and this directory does not select one.",
793
797
  fix: "Pass --space, link the directory with `sf link --space <id>`, or run it where a project link already selects a Space. `sf spaces ls` lists what the credential can reach.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spacefast/common",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
5
  "description": "Shared TypeScript contracts and utilities for Spacefast packages.",
6
6
  "repository": {