@tickernelz/wardmote-db 0.0.0 → 2026.1108.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.
- package/dist/adapter-auth-sessions-schema.test.d.ts +2 -0
- package/dist/adapter-auth-sessions-schema.test.d.ts.map +1 -0
- package/dist/adapter-auth-sessions-schema.test.js +112 -0
- package/dist/adapter-auth-sessions-schema.test.js.map +1 -0
- package/dist/agent-chat-migration.test.d.ts +2 -0
- package/dist/agent-chat-migration.test.d.ts.map +1 -0
- package/dist/agent-chat-migration.test.js +111 -0
- package/dist/agent-chat-migration.test.js.map +1 -0
- package/dist/agent-instruction-migration.test.d.ts +2 -0
- package/dist/agent-instruction-migration.test.d.ts.map +1 -0
- package/dist/agent-instruction-migration.test.js +141 -0
- package/dist/agent-instruction-migration.test.js.map +1 -0
- package/dist/agent-wakeup-requests-schema.test.d.ts +2 -0
- package/dist/agent-wakeup-requests-schema.test.d.ts.map +1 -0
- package/dist/agent-wakeup-requests-schema.test.js +24 -0
- package/dist/agent-wakeup-requests-schema.test.js.map +1 -0
- package/dist/backup-lib.d.ts +44 -0
- package/dist/backup-lib.d.ts.map +1 -0
- package/dist/backup-lib.js +958 -0
- package/dist/backup-lib.js.map +1 -0
- package/dist/backup-lib.test.d.ts +2 -0
- package/dist/backup-lib.test.d.ts.map +1 -0
- package/dist/backup-lib.test.js +564 -0
- package/dist/backup-lib.test.js.map +1 -0
- package/dist/backup.d.ts +2 -0
- package/dist/backup.d.ts.map +1 -0
- package/dist/backup.js +77 -0
- package/dist/backup.js.map +1 -0
- package/dist/better-auth-account-issuer-migration.test.d.ts +9 -0
- package/dist/better-auth-account-issuer-migration.test.d.ts.map +1 -0
- package/dist/better-auth-account-issuer-migration.test.js +113 -0
- package/dist/better-auth-account-issuer-migration.test.js.map +1 -0
- package/dist/built-in-agent-unique-marker-migration.test.d.ts +2 -0
- package/dist/built-in-agent-unique-marker-migration.test.d.ts.map +1 -0
- package/dist/built-in-agent-unique-marker-migration.test.js +102 -0
- package/dist/built-in-agent-unique-marker-migration.test.js.map +1 -0
- package/dist/chat-github-migration.test.d.ts +2 -0
- package/dist/chat-github-migration.test.d.ts.map +1 -0
- package/dist/chat-github-migration.test.js +34 -0
- package/dist/chat-github-migration.test.js.map +1 -0
- package/dist/chat-identity-migration-reconciliation.test.d.ts +2 -0
- package/dist/chat-identity-migration-reconciliation.test.d.ts.map +1 -0
- package/dist/chat-identity-migration-reconciliation.test.js +531 -0
- package/dist/chat-identity-migration-reconciliation.test.js.map +1 -0
- package/dist/chat-openwa-migration.test.d.ts +2 -0
- package/dist/chat-openwa-migration.test.d.ts.map +1 -0
- package/dist/chat-openwa-migration.test.js +126 -0
- package/dist/chat-openwa-migration.test.js.map +1 -0
- package/dist/chat-telegram-draft-ids-migration.test.d.ts +2 -0
- package/dist/chat-telegram-draft-ids-migration.test.d.ts.map +1 -0
- package/dist/chat-telegram-draft-ids-migration.test.js +71 -0
- package/dist/chat-telegram-draft-ids-migration.test.js.map +1 -0
- package/dist/chat-tenant-foreign-keys.test.d.ts +2 -0
- package/dist/chat-tenant-foreign-keys.test.d.ts.map +1 -0
- package/dist/chat-tenant-foreign-keys.test.js +140 -0
- package/dist/chat-tenant-foreign-keys.test.js.map +1 -0
- package/dist/check-migration-numbering.d.ts +2 -0
- package/dist/check-migration-numbering.d.ts.map +1 -0
- package/dist/check-migration-numbering.js +64 -0
- package/dist/check-migration-numbering.js.map +1 -0
- package/dist/check-migration-safety.d.ts +27 -0
- package/dist/check-migration-safety.d.ts.map +1 -0
- package/dist/check-migration-safety.js +811 -0
- package/dist/check-migration-safety.js.map +1 -0
- package/dist/check-migration-safety.test.d.ts +2 -0
- package/dist/check-migration-safety.test.d.ts.map +1 -0
- package/dist/check-migration-safety.test.js +391 -0
- package/dist/check-migration-safety.test.js.map +1 -0
- package/dist/client-disconnect-replay.test.d.ts +2 -0
- package/dist/client-disconnect-replay.test.d.ts.map +1 -0
- package/dist/client-disconnect-replay.test.js +182 -0
- package/dist/client-disconnect-replay.test.js.map +1 -0
- package/dist/client-options.test.d.ts +2 -0
- package/dist/client-options.test.d.ts.map +1 -0
- package/dist/client-options.test.js +88 -0
- package/dist/client-options.test.js.map +1 -0
- package/dist/client-teardown-registry.test.d.ts +2 -0
- package/dist/client-teardown-registry.test.d.ts.map +1 -0
- package/dist/client-teardown-registry.test.js +100 -0
- package/dist/client-teardown-registry.test.js.map +1 -0
- package/dist/client.d.ts +112 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +942 -0
- package/dist/client.js.map +1 -0
- package/dist/client.test.d.ts +2 -0
- package/dist/client.test.d.ts.map +1 -0
- package/dist/client.test.js +1792 -0
- package/dist/client.test.js.map +1 -0
- package/dist/company-secret-proposals-migration.test.d.ts +2 -0
- package/dist/company-secret-proposals-migration.test.d.ts.map +1 -0
- package/dist/company-secret-proposals-migration.test.js +40 -0
- package/dist/company-secret-proposals-migration.test.js.map +1 -0
- package/dist/connection-grants-phase2-migration.test.d.ts +2 -0
- package/dist/connection-grants-phase2-migration.test.d.ts.map +1 -0
- package/dist/connection-grants-phase2-migration.test.js +30 -0
- package/dist/connection-grants-phase2-migration.test.js.map +1 -0
- package/dist/connection-grants-phase4-migration.test.d.ts +2 -0
- package/dist/connection-grants-phase4-migration.test.d.ts.map +1 -0
- package/dist/connection-grants-phase4-migration.test.js +300 -0
- package/dist/connection-grants-phase4-migration.test.js.map +1 -0
- package/dist/connections-v3-schema-core-migration.test.d.ts +2 -0
- package/dist/connections-v3-schema-core-migration.test.d.ts.map +1 -0
- package/dist/connections-v3-schema-core-migration.test.js +114 -0
- package/dist/connections-v3-schema-core-migration.test.js.map +1 -0
- package/dist/decision-queue-migrations.test.d.ts +2 -0
- package/dist/decision-queue-migrations.test.d.ts.map +1 -0
- package/dist/decision-queue-migrations.test.js +78 -0
- package/dist/decision-queue-migrations.test.js.map +1 -0
- package/dist/embedded-postgres-error.d.ts +9 -0
- package/dist/embedded-postgres-error.d.ts.map +1 -0
- package/dist/embedded-postgres-error.js +73 -0
- package/dist/embedded-postgres-error.js.map +1 -0
- package/dist/embedded-postgres-error.test.d.ts +2 -0
- package/dist/embedded-postgres-error.test.d.ts.map +1 -0
- package/dist/embedded-postgres-error.test.js +25 -0
- package/dist/embedded-postgres-error.test.js.map +1 -0
- package/dist/embedded-postgres-lifecycle.d.ts +16 -0
- package/dist/embedded-postgres-lifecycle.d.ts.map +1 -0
- package/dist/embedded-postgres-lifecycle.js +43 -0
- package/dist/embedded-postgres-lifecycle.js.map +1 -0
- package/dist/embedded-postgres-lifecycle.test.d.ts +2 -0
- package/dist/embedded-postgres-lifecycle.test.d.ts.map +1 -0
- package/dist/embedded-postgres-lifecycle.test.js +64 -0
- package/dist/embedded-postgres-lifecycle.test.js.map +1 -0
- package/dist/embedded-postgres-native.d.ts +3 -0
- package/dist/embedded-postgres-native.d.ts.map +1 -0
- package/dist/embedded-postgres-native.js +83 -0
- package/dist/embedded-postgres-native.js.map +1 -0
- package/dist/embedded-postgres-native.test.d.ts +2 -0
- package/dist/embedded-postgres-native.test.d.ts.map +1 -0
- package/dist/embedded-postgres-native.test.js +49 -0
- package/dist/embedded-postgres-native.test.js.map +1 -0
- package/dist/environment-custom-images-schema.test.d.ts +2 -0
- package/dist/environment-custom-images-schema.test.d.ts.map +1 -0
- package/dist/environment-custom-images-schema.test.js +26 -0
- package/dist/environment-custom-images-schema.test.js.map +1 -0
- package/dist/external-objects-schema.test.d.ts +2 -0
- package/dist/external-objects-schema.test.d.ts.map +1 -0
- package/dist/external-objects-schema.test.js +46 -0
- package/dist/external-objects-schema.test.js.map +1 -0
- package/dist/heartbeat-context-snapshot-index-migration.test.d.ts +2 -0
- package/dist/heartbeat-context-snapshot-index-migration.test.d.ts.map +1 -0
- package/dist/heartbeat-context-snapshot-index-migration.test.js +60 -0
- package/dist/heartbeat-context-snapshot-index-migration.test.js.map +1 -0
- package/dist/heartbeat-run-issue-privacy-migration.test.d.ts +2 -0
- package/dist/heartbeat-run-issue-privacy-migration.test.d.ts.map +1 -0
- package/dist/heartbeat-run-issue-privacy-migration.test.js +265 -0
- package/dist/heartbeat-run-issue-privacy-migration.test.js.map +1 -0
- package/dist/inbox-archive-agent-policies-migration.test.d.ts +2 -0
- package/dist/inbox-archive-agent-policies-migration.test.d.ts.map +1 -0
- package/dist/inbox-archive-agent-policies-migration.test.js +155 -0
- package/dist/inbox-archive-agent-policies-migration.test.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/issue-comment-derived-attribution-migration.test.d.ts +2 -0
- package/dist/issue-comment-derived-attribution-migration.test.d.ts.map +1 -0
- package/dist/issue-comment-derived-attribution-migration.test.js +287 -0
- package/dist/issue-comment-derived-attribution-migration.test.js.map +1 -0
- package/dist/issue-comment-on-behalf-migration.test.d.ts +2 -0
- package/dist/issue-comment-on-behalf-migration.test.d.ts.map +1 -0
- package/dist/issue-comment-on-behalf-migration.test.js +146 -0
- package/dist/issue-comment-on-behalf-migration.test.js.map +1 -0
- package/dist/issue-thread-interaction-resolver-policy-migration.test.d.ts +2 -0
- package/dist/issue-thread-interaction-resolver-policy-migration.test.d.ts.map +1 -0
- package/dist/issue-thread-interaction-resolver-policy-migration.test.js +146 -0
- package/dist/issue-thread-interaction-resolver-policy-migration.test.js.map +1 -0
- package/dist/migrate.d.ts +2 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +25 -0
- package/dist/migrate.js.map +1 -0
- package/dist/migration-runtime.d.ts +7 -0
- package/dist/migration-runtime.d.ts.map +1 -0
- package/dist/migration-runtime.js +159 -0
- package/dist/migration-runtime.js.map +1 -0
- package/dist/migration-safety-baseline.d.ts +135 -0
- package/dist/migration-safety-baseline.d.ts.map +1 -0
- package/dist/migration-safety-baseline.js +150 -0
- package/dist/migration-safety-baseline.js.map +1 -0
- package/dist/migration-snapshot-drift.test.d.ts +2 -0
- package/dist/migration-snapshot-drift.test.d.ts.map +1 -0
- package/dist/migration-snapshot-drift.test.js +55 -0
- package/dist/migration-snapshot-drift.test.js.map +1 -0
- package/dist/migration-status.d.ts +2 -0
- package/dist/migration-status.d.ts.map +1 -0
- package/dist/migration-status.js +55 -0
- package/dist/migration-status.js.map +1 -0
- package/dist/migrations/0000_mature_masked_marvel.sql +208 -0
- package/dist/migrations/0001_fast_northstar.sql +87 -0
- package/dist/migrations/0002_big_zaladane.sql +1 -0
- package/dist/migrations/0003_shallow_quentin_quire.sql +5 -0
- package/dist/migrations/0004_issue_identifiers.sql +28 -0
- package/dist/migrations/0005_chief_luke_cage.sql +19 -0
- package/dist/migrations/0006_overjoyed_mister_sinister.sql +36 -0
- package/dist/migrations/0007_new_quentin_quire.sql +20 -0
- package/dist/migrations/0008_amused_zzzax.sql +1 -0
- package/dist/migrations/0009_fast_jackal.sql +36 -0
- package/dist/migrations/0010_stale_justin_hammer.sql +37 -0
- package/dist/migrations/0011_windy_corsair.sql +18 -0
- package/dist/migrations/0012_perpetual_ser_duncan.sql +2 -0
- package/dist/migrations/0013_dashing_wasp.sql +4 -0
- package/dist/migrations/0014_many_mikhail_rasputin.sql +135 -0
- package/dist/migrations/0015_project_color_archived.sql +2 -0
- package/dist/migrations/0016_agent_icon.sql +1 -0
- package/dist/migrations/0017_tiresome_gabe_jones.sql +51 -0
- package/dist/migrations/0018_flat_sleepwalker.sql +26 -0
- package/dist/migrations/0019_public_victor_mancha.sql +18 -0
- package/dist/migrations/0020_white_anita_blake.sql +1 -0
- package/dist/migrations/0021_chief_vindicator.sql +1 -0
- package/dist/migrations/0022_company_brand_color.sql +1 -0
- package/dist/migrations/0023_fair_lethal_legion.sql +3 -0
- package/dist/migrations/0024_far_beast.sql +2 -0
- package/dist/migrations/0025_nasty_salo.sql +15 -0
- package/dist/migrations/0026_lying_pete_wisdom.sql +39 -0
- package/dist/migrations/0027_tranquil_tenebrous.sql +2 -0
- package/dist/migrations/0028_harsh_goliath.sql +54 -0
- package/dist/migrations/0029_plugin_tables.sql +177 -0
- package/dist/migrations/0030_rich_magneto.sql +12 -0
- package/dist/migrations/0031_zippy_magma.sql +51 -0
- package/dist/migrations/0032_pretty_doctor_octopus.sql +102 -0
- package/dist/migrations/0033_shiny_black_tarantula.sql +2 -0
- package/dist/migrations/0034_fat_dormammu.sql +2 -0
- package/dist/migrations/0035_marvelous_satana.sql +91 -0
- package/dist/migrations/0036_cheerful_nitro.sql +9 -0
- package/dist/migrations/0037_friendly_eddie_brock.sql +29 -0
- package/dist/migrations/0038_careless_iron_monger.sql +5 -0
- package/dist/migrations/0039_fat_magneto.sql +161 -0
- package/dist/migrations/0040_eager_shotgun.sql +5 -0
- package/dist/migrations/0041_curly_maria_hill.sql +1 -0
- package/dist/migrations/0042_spotty_the_renegades.sql +26 -0
- package/dist/migrations/0043_reflective_captain_universe.sql +6 -0
- package/dist/migrations/0044_illegal_toad.sql +56 -0
- package/dist/migrations/0045_workable_shockwave.sql +17 -0
- package/dist/migrations/0046_smooth_sentinels.sql +11 -0
- package/dist/migrations/0047_overjoyed_groot.sql +102 -0
- package/dist/migrations/0048_flashy_marrow.sql +1 -0
- package/dist/migrations/0049_flawless_abomination.sql +21 -0
- package/dist/migrations/0050_stiff_luckman.sql +1 -0
- package/dist/migrations/0051_young_korg.sql +5 -0
- package/dist/migrations/0052_mushy_trauma.sql +26 -0
- package/dist/migrations/0053_sharp_wild_child.sql +18 -0
- package/dist/migrations/0054_draft_routines.sql +2 -0
- package/dist/migrations/0055_kind_weapon_omega.sql +1 -0
- package/dist/migrations/0056_spooky_ultragirl.sql +22 -0
- package/dist/migrations/0057_tidy_join_requests.sql +57 -0
- package/dist/migrations/0058_wealthy_starbolt.sql +6 -0
- package/dist/migrations/0059_plugin_database_namespaces.sql +41 -0
- package/dist/migrations/0060_orange_annihilus.sql +50 -0
- package/dist/migrations/0061_lively_thor_girl.sql +3 -0
- package/dist/migrations/0062_routine_run_dispatch_fingerprint.sql +9 -0
- package/dist/migrations/0063_issue_thread_interactions.sql +65 -0
- package/dist/migrations/0064_issue_thread_interaction_idempotency.sql +4 -0
- package/dist/migrations/0065_environments.sql +50 -0
- package/dist/migrations/0066_issue_tree_holds.sql +107 -0
- package/dist/migrations/0067_agent_default_environment.sql +3 -0
- package/dist/migrations/0068_environment_local_driver_unique.sql +2 -0
- package/dist/migrations/0069_liveness_recovery_dedupe.sql +13 -0
- package/dist/migrations/0070_active_run_output_watchdog.sql +70 -0
- package/dist/migrations/0071_default_hire_approval_off.sql +1 -0
- package/dist/migrations/0072_large_sandman.sql +6 -0
- package/dist/migrations/0073_shiny_salo.sql +1 -0
- package/dist/migrations/0074_striped_genesis.sql +4 -0
- package/dist/migrations/0075_cultured_sebastian_shaw.sql +7 -0
- package/dist/migrations/0076_useful_elektra.sql +29 -0
- package/dist/migrations/0077_unusual_karnak.sql +140 -0
- package/dist/migrations/0078_white_darwin.sql +3 -0
- package/dist/migrations/0079_company_search_document_indexes.sql +2 -0
- package/dist/migrations/0080_company_search_fuzzystrmatch.sql +1 -0
- package/dist/migrations/0081_optimal_dormammu.sql +1 -0
- package/dist/migrations/0082_dry_vision.sql +124 -0
- package/dist/migrations/0083_company_secret_provider_configs.sql +51 -0
- package/dist/migrations/0084_issue_recovery_actions.sql +64 -0
- package/dist/migrations/0085_tranquil_the_executioner.sql +8 -0
- package/dist/migrations/0086_routine_env_runtime_contract.sql +8 -0
- package/dist/migrations/0087_backfill_environment_manage_human_defaults.sql +29 -0
- package/dist/migrations/0088_backfill_principal_access_compatibility.sql +75 -0
- package/dist/migrations/0089_cloud_upstreams.sql +71 -0
- package/dist/migrations/0090_resource_memberships.sql +55 -0
- package/dist/migrations/0091_old_swarm.sql +189 -0
- package/dist/migrations/0092_mighty_puma.sql +28 -0
- package/dist/migrations/0093_giant_green_goblin.sql +6 -0
- package/dist/migrations/0094_backfill_archived_company_agent_pauses.sql +10 -0
- package/dist/migrations/0095_issue_comment_tombstones.sql +15 -0
- package/dist/migrations/0096_document_annotation_issue_comment_links.sql +7 -0
- package/dist/migrations/0097_low_trust_source_trust.sql +4 -0
- package/dist/migrations/0098_project_icon.sql +1 -0
- package/dist/migrations/0099_skills_store_foundation.sql +121 -0
- package/dist/migrations/0100_skill_install_count_backfill.sql +3 -0
- package/dist/migrations/0101_plugin_company_id_tenant_isolation.sql +14 -0
- package/dist/migrations/0102_managed_sandbox_dedup_index.sql +33 -0
- package/dist/migrations/0103_agent_error_reason.sql +1 -0
- package/dist/migrations/0104_issue_watchdogs.sql +90 -0
- package/dist/migrations/0105_instance_scoped_environments.sql +170 -0
- package/dist/migrations/0106_external_object_references.sql +106 -0
- package/dist/migrations/0107_external_object_display_metadata.sql +5 -0
- package/dist/migrations/0108_workspace_operations_issue_id.sql +41 -0
- package/dist/migrations/0109_routine_description_annotations.sql +170 -0
- package/dist/migrations/0110_document_company_cascade.sql +31 -0
- package/dist/migrations/0111_backfill_skill_create_human_defaults.sql +29 -0
- package/dist/migrations/0112_rename_skill_create_permission_key.sql +30 -0
- package/dist/migrations/0113_pipeline_foundation.sql +335 -0
- package/dist/migrations/0114_pipeline_case_issue_unlinked_event.sql +3 -0
- package/dist/migrations/0115_pipeline_routine_origin.sql +3 -0
- package/dist/migrations/0116_pipeline_upstream_drift_event.sql +3 -0
- package/dist/migrations/0117_pipeline_transition_forced_event.sql +3 -0
- package/dist/migrations/0118_pipeline_case_agent_fanout.sql +3 -0
- package/dist/migrations/0119_pipeline_drift_acknowledged_event.sql +3 -0
- package/dist/migrations/0120_pipeline_stage_working_primitives.sql +19 -0
- package/dist/migrations/0121_pipeline_automation_retry_effects.sql +43 -0
- package/dist/migrations/0122_pipeline_case_documents.sql +28 -0
- package/dist/migrations/0123_document_annotation_source_trust.sql +1 -0
- package/dist/migrations/0124_agent_api_key_scope_config.sql +1 -0
- package/dist/migrations/0125_environment_custom_image_templates.sql +147 -0
- package/dist/migrations/0127_environment_custom_images_instance_scoped.sql +106 -0
- package/dist/migrations/0128_user_specific_secrets.sql +178 -0
- package/dist/migrations/0129_agent_api_key_responsible_user.sql +41 -0
- package/dist/migrations/0131_repair_run_responsible_user_context_refs.sql +67 -0
- package/dist/migrations/0132_issue_comment_derived_attribution_fast.sql +82 -0
- package/dist/migrations/0133_resource_membership_stars.sql +7 -0
- package/dist/migrations/0134_run_responsible_user_invariant.sql +211 -0
- package/dist/migrations/0135_repair_run_responsible_user_updated_at_sweep.sql +84 -0
- package/dist/migrations/0136_acpx_default_engine_migration.sql +97 -0
- package/dist/migrations/0137_skill_studio_server_foundation.sql +76 -0
- package/dist/migrations/0138_skill_studio_run_retention.sql +5 -0
- package/dist/migrations/0139_skill_studio_run_templates.sql +44 -0
- package/dist/migrations/0140_built_in_managed_resources.sql +43 -0
- package/dist/migrations/0141_heartbeat_runs_company_created_at_index.sql +2 -0
- package/dist/migrations/0142_company_search_sort_indexes.sql +3 -0
- package/dist/migrations/0143_cases_foundation.sql +248 -0
- package/dist/migrations/0144_case_document_annotations.sql +31 -0
- package/dist/migrations/0145_inbox_dismissal_snooze_kind.sql +15 -0
- package/dist/migrations/0146_routine_activity_gate.sql +3 -0
- package/dist/migrations/0147_cost_event_status.sql +1 -0
- package/dist/migrations/0148_tool_access_mcp_connections.sql +126 -0
- package/dist/migrations/0149_agent_access_phase2_contracts.sql +612 -0
- package/dist/migrations/0150_tool_invocation_catalog_snapshots.sql +2 -0
- package/dist/migrations/0151_tool_gateway_sessions.sql +38 -0
- package/dist/migrations/0152_tool_connection_application_no_cascade.sql +18 -0
- package/dist/migrations/0153_tool_stdio_command_templates.sql +32 -0
- package/dist/migrations/0154_tool_oauth_states.sql +36 -0
- package/dist/migrations/0155_tool_oauth_state_actor_binding.sql +5 -0
- package/dist/migrations/0156_tool_oauth_state_session_binding.sql +1 -0
- package/dist/migrations/0157_tool_profile_new_tools_review.sql +1 -0
- package/dist/migrations/0158_tool_invocation_connected_mcp_metadata.sql +4 -0
- package/dist/migrations/0159_named_mcp_gateways.sql +72 -0
- package/dist/migrations/0160_mcp_gateway_contract_expansion.sql +176 -0
- package/dist/migrations/0161_environment_custom_image_company_scope_repair.sql +8 -0
- package/dist/migrations/0162_tool_runtime_metric_counters.sql +27 -0
- package/dist/migrations/0163_secret_binding_projection_class.sql +2 -0
- package/dist/migrations/0164_plugin_config_company_scope.sql +117 -0
- package/dist/migrations/0165_connection_token_issuances.sql +64 -0
- package/dist/migrations/0166_smoke_lab_results.sql +51 -0
- package/dist/migrations/0167_environment_custom_image_instance_scope_cleanup.sql +32 -0
- package/dist/migrations/0168_tool_connection_installs.sql +56 -0
- package/dist/migrations/0169_tool_gateway_protocol_rate_limit_counters.sql +43 -0
- package/dist/migrations/0170_company_skill_policies.sql +12 -0
- package/dist/migrations/0171_issue_create_idempotency_keys.sql +19 -0
- package/dist/migrations/0172_inbox_archive_agent_policies.sql +42 -0
- package/dist/migrations/0173_inbox_policy_agent_cleanup.sql +22 -0
- package/dist/migrations/0174_folders.sql +46 -0
- package/dist/migrations/0175_nested_skill_folders.sql +232 -0
- package/dist/migrations/0176_issue_create_idempotency_key_expiry.sql +2 -0
- package/dist/migrations/0177_activity_log_responsible_user.sql +10 -0
- package/dist/migrations/0178_summary_slots.sql +37 -0
- package/dist/migrations/0179_summary_slot_failure_reason.sql +1 -0
- package/dist/migrations/0180_decision_training_examples.sql +23 -0
- package/dist/migrations/0181_decision_training_retention_policy.sql +2 -0
- package/dist/migrations/0182_connections_v3_schema_core.sql +74 -0
- package/dist/migrations/0183_connection_user_authorization_state.sql +6 -0
- package/dist/migrations/0184_routable_blocked.sql +3 -0
- package/dist/migrations/0185_status_cards.sql +111 -0
- package/dist/migrations/0186_status_card_compile_provenance.sql +3 -0
- package/dist/migrations/0187_status_card_pending_change_hash.sql +1 -0
- package/dist/migrations/0188_status_card_generation_issue_index.sql +1 -0
- package/dist/migrations/0189_status_card_agent.sql +6 -0
- package/dist/migrations/0190_status_card_single_prompt.sql +2 -0
- package/dist/migrations/0191_status_card_mentioned_issue_ids.sql +1 -0
- package/dist/migrations/0192_task_watchdog_stop_snapshots.sql +2 -0
- package/dist/migrations/0193_document_memberships.sql +15 -0
- package/dist/migrations/0194_company_skill_releases.sql +4 -0
- package/dist/migrations/0195_built_in_agent_unique_marker.sql +53 -0
- package/dist/migrations/0196_drop_cloud_upstream_tables.sql +9 -0
- package/dist/migrations/0197_decisions_v1.sql +106 -0
- package/dist/migrations/0198_decision_queues_and_triage.sql +161 -0
- package/dist/migrations/0199_decision_queue_composite_key.sql +10 -0
- package/dist/migrations/0200_yellow_maria_hill.sql +64 -0
- package/dist/migrations/0201_concerned_captain_midlands.sql +1 -0
- package/dist/migrations/0202_eminent_marvel_zombies.sql +1 -0
- package/dist/migrations/0203_interaction_resolver_governance.sql +8 -0
- package/dist/migrations/0204_interaction_addressee.sql +6 -0
- package/dist/migrations/0205_narrow_shiva.sql +10 -0
- package/dist/migrations/0206_review_path_recovery_idempotency_index.sql +2 -0
- package/dist/migrations/0207_moaning_amazoness.sql +94 -0
- package/dist/migrations/0208_keen_sharon_carter.sql +1 -0
- package/dist/migrations/0209_heartbeat_context_snapshot_indexes.sql +4 -0
- package/dist/migrations/0210_heartbeat_context_taskkey_index.sql +1 -0
- package/dist/migrations/0211_bright_morg.sql +1 -0
- package/dist/migrations/0212_onboarding_first_task_unique.sql +3 -0
- package/dist/migrations/0213_complete_mystique.sql +24 -0
- package/dist/migrations/0214_lively_lord_tyger.sql +22 -0
- package/dist/migrations/0215_flat_daimon_hellstrom.sql +1 -0
- package/dist/migrations/0216_company_onboarding_seeds.sql +42 -0
- package/dist/migrations/0217_yielding_starbolt.sql +21 -0
- package/dist/migrations/0218_mushy_jack_murdock.sql +38 -0
- package/dist/migrations/0219_runtime_service_exposure.sql +3 -0
- package/dist/migrations/0220_execution_workspace_runtime_leases.sql +26 -0
- package/dist/migrations/0221_swift_justin_hammer.sql +20 -0
- package/dist/migrations/0222_orphan_cleanup_env_reference_survives_delete.sql +4 -0
- package/dist/migrations/0223_robust_zaladane.sql +6 -0
- package/dist/migrations/0224_unified_adapter_auth_sessions.sql +18 -0
- package/dist/migrations/0225_drop_claude_setup_token_sessions.sql +5 -0
- package/dist/migrations/0226_tan_colossus.sql +2 -0
- package/dist/migrations/0227_modern_pandemic.sql +410 -0
- package/dist/migrations/0228_nasty_grim_reaper.sql +59 -0
- package/dist/migrations/0229_drop_company_brand_color_and_attachment_max_bytes.sql +7 -0
- package/dist/migrations/0230_better_auth_account_issuer.sql +23 -0
- package/dist/migrations/0231_remove_app_connection_wide_includes.sql +10 -0
- package/dist/migrations/0232_fixed_hannibal_king.sql +202 -0
- package/dist/migrations/0233_living_dreaming_celestial.sql +13 -0
- package/dist/migrations/0234_provider_trace_records.sql +31 -0
- package/dist/migrations/0235_heartbeat_run_event_sequence_uniqueness.sql +28 -0
- package/dist/migrations/0236_remove_cheap_model_profiles.sql +108 -0
- package/dist/migrations/0237_clammy_colonel_america.sql +52 -0
- package/dist/migrations/0238_graceful_infant_terrible.sql +7 -0
- package/dist/migrations/0239_sturdy_santa_claus.sql +38 -0
- package/dist/migrations/0240_pink_fantastic_four.sql +25 -0
- package/dist/migrations/0241_conscious_adam_destine.sql +1 -0
- package/dist/migrations/0242_wide_lightspeed.sql +1 -0
- package/dist/migrations/0243_sleepy_metal_master.sql +1 -0
- package/dist/migrations/0244_organic_meltdown.sql +1 -0
- package/dist/migrations/0245_misty_nightshade.sql +3 -0
- package/dist/migrations/0246_nostalgic_medusa.sql +19 -0
- package/dist/migrations/0247_even_moon_knight.sql +2 -0
- package/dist/migrations/0248_small_manta.sql +36 -0
- package/dist/migrations/0249_fast_silverclaw.sql +33 -0
- package/dist/migrations/0250_exotic_dakota_north.sql +2 -0
- package/dist/migrations/0251_narrow_mastermind.sql +1 -0
- package/dist/migrations/0252_friendly_kate_bishop.sql +1 -0
- package/dist/migrations/0253_real_firebrand.sql +1 -0
- package/dist/migrations/0254_military_calypso.sql +3 -0
- package/dist/migrations/0255_previous_captain_america.sql +290 -0
- package/dist/migrations/0256_married_king_cobra.sql +3 -0
- package/dist/migrations/0257_bizarre_the_hunter.sql +8 -0
- package/dist/migrations/0258_typical_sauron.sql +2 -0
- package/dist/migrations/0259_tan_chat.sql +1 -0
- package/dist/migrations/0260_chat_interaction_wakeup_idempotency.sql +106 -0
- package/dist/migrations/0261_faulty_iceman.sql +4 -0
- package/dist/migrations/0262_lying_avengers.sql +3 -0
- package/dist/migrations/0263_nebulous_iron_lad.sql +3 -0
- package/dist/migrations/0264_cynical_hellcat.sql +3 -0
- package/dist/migrations/0265_chat_interaction_wakeup_provenance.sql +80 -0
- package/dist/migrations/0266_brave_living_mummy.sql +56 -0
- package/dist/migrations/0267_warm_wild_child.sql +8 -0
- package/dist/migrations/0268_lively_runaways.sql +1 -0
- package/dist/migrations/0269_fearless_young_avengers.sql +15 -0
- package/dist/migrations/0270_harsh_queen_noir.sql +12 -0
- package/dist/migrations/0271_woozy_silver_surfer.sql +1 -0
- package/dist/migrations/0272_light_kate_bishop.sql +98 -0
- package/dist/migrations/0273_aromatic_moondragon.sql +3 -0
- package/dist/migrations/0274_agent_chat.sql +33 -0
- package/dist/migrations/0275_easy_dragon_man.sql +5 -0
- package/dist/migrations/0276_hard_mandroid.sql +77 -0
- package/dist/migrations/0277_uneven_lady_deathstrike.sql +47 -0
- package/dist/migrations/0278_nappy_colonel_america.sql +6 -0
- package/dist/migrations/0279_tired_deathstrike.sql +3 -0
- package/dist/migrations/0280_unique_genesis.sql +11 -0
- package/dist/migrations/0281_true_boom_boom.sql +14 -0
- package/dist/migrations/0282_colossal_shocker.sql +2 -0
- package/dist/migrations/0283_jittery_psynapse.sql +81 -0
- package/dist/migrations/0284_fearless_stranger.sql +27 -0
- package/dist/migrations/0285_safe_vampiro.sql +14 -0
- package/dist/migrations/0286_cheerful_toro.sql +2 -0
- package/dist/migrations/0287_slimy_smasher.sql +215 -0
- package/dist/migrations/0288_exotic_daimon_hellstrom.sql +1 -0
- package/dist/migrations/0289_talented_fabian_cortez.sql +23 -0
- package/dist/migrations/0290_dizzy_ultragirl.sql +2 -0
- package/dist/migrations/0291_petite_genesis.sql +1 -0
- package/dist/migrations/0292_heavy_oracle.sql +1 -0
- package/dist/migrations/0293_complete_alice.sql +13 -0
- package/dist/migrations/0294_serious_tinkerer.sql +61 -0
- package/dist/migrations/0295_glorious_jamie_braddock.sql +36 -0
- package/dist/migrations/0296_drop_user_keyboard_shortcuts.sql +5 -0
- package/dist/migrations/0297_browser_use_cloud.sql +155 -0
- package/dist/migrations/0298_conscious_secret_warriors.sql +119 -0
- package/dist/migrations/0299_powerful_devos.sql +1 -0
- package/dist/migrations/0300_broad_rattler.sql +1 -0
- package/dist/migrations/0301_chilly_marvel_apes.sql +1 -0
- package/dist/migrations/0302_public_captain_cross.sql +21 -0
- package/dist/migrations/0303_stiff_thaddeus_ross.sql +25 -0
- package/dist/migrations/0304_foamy_swordsman.sql +14 -0
- package/dist/migrations/0305_connection_agent_instructions.sql +16 -0
- package/dist/migrations/0306_absent_ser_duncan.sql +64 -0
- package/dist/migrations/0307_fuzzy_wolfpack.sql +23 -0
- package/dist/migrations/0308_sparkling_clea.sql +16 -0
- package/dist/migrations/0309_nervous_robin_chapel.sql +23 -0
- package/dist/migrations/0310_mighty_chameleon.sql +6 -0
- package/dist/migrations/0311_milky_timeslip.sql +2 -0
- package/dist/migrations/0312_slippery_meteorite.sql +6 -0
- package/dist/migrations/0313_jittery_klaw.sql +2 -0
- package/dist/migrations/0314_chilly_triton.sql +14 -0
- package/dist/migrations/0315_chunky_chamber.sql +3 -0
- package/dist/migrations/0316_lumpy_maria_hill.sql +157 -0
- package/dist/migrations/0317_colossal_otto_octavius.sql +24 -0
- package/dist/migrations/0318_supreme_garia.sql +1 -0
- package/dist/migrations/0319_curvy_shadow_king.sql +27 -0
- package/dist/migrations/0320_chubby_vin_gonzales.sql +7 -0
- package/dist/migrations/0321_familiar_titania.sql +4 -0
- package/dist/migrations/0322_cool_naoko.sql +3 -0
- package/dist/migrations/0323_whole_steel_serpent.sql +20 -0
- package/dist/migrations/0324_loving_the_hood.sql +77 -0
- package/dist/migrations/0325_agent_commentary.sql +33 -0
- package/dist/migrations/0326_mcp_file_transfers.sql +48 -0
- package/dist/migrations/0327_easy_eternity.sql +232 -0
- package/dist/migrations/0328_private_task_access.sql +278 -0
- package/dist/migrations/0329_private_task_draft_assets.sql +28 -0
- package/dist/migrations/0330_rapid_emma_frost.sql +44 -0
- package/dist/migrations/0331_premium_slayback.sql +81 -0
- package/dist/migrations/0332_messy_famine.sql +189 -0
- package/dist/migrations/0333_strong_blacklash.sql +23 -0
- package/dist/migrations/0334_heavy_captain_midlands.sql +15 -0
- package/dist/migrations/0335_daily_onslaught.sql +16 -0
- package/dist/migrations/0336_acoustic_human_fly.sql +1 -0
- package/dist/migrations/0337_reflective_kree.sql +98 -0
- package/dist/migrations/0338_petite_shockwave.sql +4 -0
- package/dist/migrations/0339_long_franklin_storm.sql +153 -0
- package/dist/migrations/0340_aberrant_machine_man.sql +6 -0
- package/dist/migrations/0341_blushing_screwball.sql +17 -0
- package/dist/migrations/0342_sad_proteus.sql +23 -0
- package/dist/migrations/0343_chunky_mentallo.sql +52 -0
- package/dist/migrations/0344_free_wolf_cub.sql +18 -0
- package/dist/migrations/0345_spooky_white_tiger.sql +7 -0
- package/dist/migrations/0346_panoramic_spyke.sql +74 -0
- package/dist/migrations/0347_little_night_nurse.sql +1 -0
- package/dist/migrations/0348_breezy_chat.sql +27 -0
- package/dist/migrations/0349_round_matthew_murdock.sql +3 -0
- package/dist/migrations/0350_finalize_orphaned_claimed_wakeups.sql +10 -0
- package/dist/migrations/0351_local_browser_connections.sql +35 -0
- package/dist/migrations/0352_lucky_marvel_apes.sql +12 -0
- package/dist/migrations/0353_supreme_whirlwind.sql +1 -0
- package/dist/migrations/0354_melodic_romulus.sql +4 -0
- package/dist/migrations/0355_overjoyed_ma_gnuci.sql +1 -0
- package/dist/migrations/0356_normal_thundra.sql +3 -0
- package/dist/migrations/meta/_journal.json +2491 -0
- package/dist/native-runner-recovery-migration.test.d.ts +2 -0
- package/dist/native-runner-recovery-migration.test.d.ts.map +1 -0
- package/dist/native-runner-recovery-migration.test.js +121 -0
- package/dist/native-runner-recovery-migration.test.js.map +1 -0
- package/dist/nested-skill-folders-migration.test.d.ts +2 -0
- package/dist/nested-skill-folders-migration.test.d.ts.map +1 -0
- package/dist/nested-skill-folders-migration.test.js +106 -0
- package/dist/nested-skill-folders-migration.test.js.map +1 -0
- package/dist/orphaned-claimed-wakeups-migration.test.d.ts +2 -0
- package/dist/orphaned-claimed-wakeups-migration.test.d.ts.map +1 -0
- package/dist/orphaned-claimed-wakeups-migration.test.js +67 -0
- package/dist/orphaned-claimed-wakeups-migration.test.js.map +1 -0
- package/dist/pipelines-schema.test.d.ts +2 -0
- package/dist/pipelines-schema.test.d.ts.map +1 -0
- package/dist/pipelines-schema.test.js +205 -0
- package/dist/pipelines-schema.test.js.map +1 -0
- package/dist/postgres-connection-recovery.test.d.ts +2 -0
- package/dist/postgres-connection-recovery.test.d.ts.map +1 -0
- package/dist/postgres-connection-recovery.test.js +35 -0
- package/dist/postgres-connection-recovery.test.js.map +1 -0
- package/dist/private-task-draft-assets-migration.test.d.ts +2 -0
- package/dist/private-task-draft-assets-migration.test.d.ts.map +1 -0
- package/dist/private-task-draft-assets-migration.test.js +35 -0
- package/dist/private-task-draft-assets-migration.test.js.map +1 -0
- package/dist/question-response-delivery-migration.test.d.ts +2 -0
- package/dist/question-response-delivery-migration.test.d.ts.map +1 -0
- package/dist/question-response-delivery-migration.test.js +62 -0
- package/dist/question-response-delivery-migration.test.js.map +1 -0
- package/dist/question-response-history-migration.test.d.ts +2 -0
- package/dist/question-response-history-migration.test.d.ts.map +1 -0
- package/dist/question-response-history-migration.test.js +53 -0
- package/dist/question-response-history-migration.test.js.map +1 -0
- package/dist/run-event-payload.d.ts +30 -0
- package/dist/run-event-payload.d.ts.map +1 -0
- package/dist/run-event-payload.js +57 -0
- package/dist/run-event-payload.js.map +1 -0
- package/dist/run-event-payload.test.d.ts +2 -0
- package/dist/run-event-payload.test.d.ts.map +1 -0
- package/dist/run-event-payload.test.js +46 -0
- package/dist/run-event-payload.test.js.map +1 -0
- package/dist/run-identity-migration.test.d.ts +2 -0
- package/dist/run-identity-migration.test.d.ts.map +1 -0
- package/dist/run-identity-migration.test.js +60 -0
- package/dist/run-identity-migration.test.js.map +1 -0
- package/dist/runtime-config.d.ts +16 -0
- package/dist/runtime-config.d.ts.map +1 -0
- package/dist/runtime-config.js +168 -0
- package/dist/runtime-config.js.map +1 -0
- package/dist/runtime-config.test.d.ts +2 -0
- package/dist/runtime-config.test.d.ts.map +1 -0
- package/dist/runtime-config.test.js +111 -0
- package/dist/runtime-config.test.js.map +1 -0
- package/dist/schema/accounting.d.ts +1282 -0
- package/dist/schema/accounting.d.ts.map +1 -0
- package/dist/schema/accounting.js +120 -0
- package/dist/schema/accounting.js.map +1 -0
- package/dist/schema/activity_log.d.ts +214 -0
- package/dist/schema/activity_log.d.ts.map +1 -0
- package/dist/schema/activity_log.js +26 -0
- package/dist/schema/activity_log.js.map +1 -0
- package/dist/schema/adapter_auth_sessions.d.ts +377 -0
- package/dist/schema/adapter_auth_sessions.d.ts.map +1 -0
- package/dist/schema/adapter_auth_sessions.js +88 -0
- package/dist/schema/adapter_auth_sessions.js.map +1 -0
- package/dist/schema/agent_api_keys.d.ts +204 -0
- package/dist/schema/agent_api_keys.d.ts.map +1 -0
- package/dist/schema/agent_api_keys.js +19 -0
- package/dist/schema/agent_api_keys.js.map +1 -0
- package/dist/schema/agent_commentary.d.ts +181 -0
- package/dist/schema/agent_commentary.d.ts.map +1 -0
- package/dist/schema/agent_commentary.js +24 -0
- package/dist/schema/agent_commentary.js.map +1 -0
- package/dist/schema/agent_config_revisions.d.ts +201 -0
- package/dist/schema/agent_config_revisions.d.ts.map +1 -0
- package/dist/schema/agent_config_revisions.js +20 -0
- package/dist/schema/agent_config_revisions.js.map +1 -0
- package/dist/schema/agent_identity_keys.d.ts +131 -0
- package/dist/schema/agent_identity_keys.d.ts.map +1 -0
- package/dist/schema/agent_identity_keys.js +20 -0
- package/dist/schema/agent_identity_keys.js.map +1 -0
- package/dist/schema/agent_instruction_revisions.d.ts +740 -0
- package/dist/schema/agent_instruction_revisions.d.ts.map +1 -0
- package/dist/schema/agent_instruction_revisions.js +80 -0
- package/dist/schema/agent_instruction_revisions.js.map +1 -0
- package/dist/schema/agent_memberships.d.ts +144 -0
- package/dist/schema/agent_memberships.d.ts.map +1 -0
- package/dist/schema/agent_memberships.js +19 -0
- package/dist/schema/agent_memberships.js.map +1 -0
- package/dist/schema/agent_runtime_state.d.ts +248 -0
- package/dist/schema/agent_runtime_state.d.ts.map +1 -0
- package/dist/schema/agent_runtime_state.js +23 -0
- package/dist/schema/agent_runtime_state.js.map +1 -0
- package/dist/schema/agent_task_sessions.d.ts +569 -0
- package/dist/schema/agent_task_sessions.d.ts.map +1 -0
- package/dist/schema/agent_task_sessions.js +51 -0
- package/dist/schema/agent_task_sessions.js.map +1 -0
- package/dist/schema/agent_wakeup_requests.d.ts +333 -0
- package/dist/schema/agent_wakeup_requests.d.ts.map +1 -0
- package/dist/schema/agent_wakeup_requests.js +65 -0
- package/dist/schema/agent_wakeup_requests.js.map +1 -0
- package/dist/schema/agents.d.ts +564 -0
- package/dist/schema/agents.d.ts.map +1 -0
- package/dist/schema/agents.js +43 -0
- package/dist/schema/agents.js.map +1 -0
- package/dist/schema/ai_connection_defaults.d.ts +132 -0
- package/dist/schema/ai_connection_defaults.d.ts.map +1 -0
- package/dist/schema/ai_connection_defaults.js +28 -0
- package/dist/schema/ai_connection_defaults.js.map +1 -0
- package/dist/schema/ai_connection_routing.d.ts +351 -0
- package/dist/schema/ai_connection_routing.d.ts.map +1 -0
- package/dist/schema/ai_connection_routing.js +37 -0
- package/dist/schema/ai_connection_routing.js.map +1 -0
- package/dist/schema/ai_provider_defaults.d.ts +114 -0
- package/dist/schema/ai_provider_defaults.d.ts.map +1 -0
- package/dist/schema/ai_provider_defaults.js +19 -0
- package/dist/schema/ai_provider_defaults.js.map +1 -0
- package/dist/schema/ai_subscriptions.d.ts +619 -0
- package/dist/schema/ai_subscriptions.d.ts.map +1 -0
- package/dist/schema/ai_subscriptions.js +61 -0
- package/dist/schema/ai_subscriptions.js.map +1 -0
- package/dist/schema/announcement_dismissals.d.ts +83 -0
- package/dist/schema/announcement_dismissals.d.ts.map +1 -0
- package/dist/schema/announcement_dismissals.js +15 -0
- package/dist/schema/announcement_dismissals.js.map +1 -0
- package/dist/schema/approval_comments.d.ts +144 -0
- package/dist/schema/approval_comments.d.ts.map +1 -0
- package/dist/schema/approval_comments.js +19 -0
- package/dist/schema/approval_comments.js.map +1 -0
- package/dist/schema/approvals.d.ts +214 -0
- package/dist/schema/approvals.d.ts.map +1 -0
- package/dist/schema/approvals.js +24 -0
- package/dist/schema/approvals.js.map +1 -0
- package/dist/schema/assets.d.ts +229 -0
- package/dist/schema/assets.d.ts.map +1 -0
- package/dist/schema/assets.js +23 -0
- package/dist/schema/assets.js.map +1 -0
- package/dist/schema/auth.d.ts +638 -0
- package/dist/schema/auth.d.ts.map +1 -0
- package/dist/schema/auth.js +61 -0
- package/dist/schema/auth.js.map +1 -0
- package/dist/schema/board_api_keys.d.ts +144 -0
- package/dist/schema/board_api_keys.d.ts.map +1 -0
- package/dist/schema/board_api_keys.js +16 -0
- package/dist/schema/board_api_keys.js.map +1 -0
- package/dist/schema/browser_use.d.ts +745 -0
- package/dist/schema/browser_use.d.ts.map +1 -0
- package/dist/schema/browser_use.js +104 -0
- package/dist/schema/browser_use.js.map +1 -0
- package/dist/schema/budget_incidents.d.ts +297 -0
- package/dist/schema/budget_incidents.d.ts.map +1 -0
- package/dist/schema/budget_incidents.js +29 -0
- package/dist/schema/budget_incidents.js.map +1 -0
- package/dist/schema/budget_policies.d.ts +331 -0
- package/dist/schema/budget_policies.d.ts.map +1 -0
- package/dist/schema/budget_policies.js +30 -0
- package/dist/schema/budget_policies.js.map +1 -0
- package/dist/schema/built_in_managed_resources.d.ts +197 -0
- package/dist/schema/built_in_managed_resources.d.ts.map +1 -0
- package/dist/schema/built_in_managed_resources.js +22 -0
- package/dist/schema/built_in_managed_resources.js.map +1 -0
- package/dist/schema/cases.d.ts +982 -0
- package/dist/schema/cases.d.ts.map +1 -0
- package/dist/schema/cases.js +122 -0
- package/dist/schema/cases.js.map +1 -0
- package/dist/schema/chat_channels.d.ts +5309 -0
- package/dist/schema/chat_channels.d.ts.map +1 -0
- package/dist/schema/chat_channels.js +1005 -0
- package/dist/schema/chat_channels.js.map +1 -0
- package/dist/schema/chat_completion_deliveries.d.ts +361 -0
- package/dist/schema/chat_completion_deliveries.d.ts.map +1 -0
- package/dist/schema/chat_completion_deliveries.js +36 -0
- package/dist/schema/chat_completion_deliveries.js.map +1 -0
- package/dist/schema/chat_discord_command_owners.d.ts +93 -0
- package/dist/schema/chat_discord_command_owners.d.ts.map +1 -0
- package/dist/schema/chat_discord_command_owners.js +19 -0
- package/dist/schema/chat_discord_command_owners.js.map +1 -0
- package/dist/schema/chat_github.d.ts +838 -0
- package/dist/schema/chat_github.d.ts.map +1 -0
- package/dist/schema/chat_github.js +117 -0
- package/dist/schema/chat_github.js.map +1 -0
- package/dist/schema/chat_slack_registrations.d.ts +287 -0
- package/dist/schema/chat_slack_registrations.d.ts.map +1 -0
- package/dist/schema/chat_slack_registrations.js +26 -0
- package/dist/schema/chat_slack_registrations.js.map +1 -0
- package/dist/schema/chat_teams_file_transfers.d.ts +639 -0
- package/dist/schema/chat_teams_file_transfers.d.ts.map +1 -0
- package/dist/schema/chat_teams_file_transfers.js +86 -0
- package/dist/schema/chat_teams_file_transfers.js.map +1 -0
- package/dist/schema/chat_telegram_draft_ids.d.ts +2 -0
- package/dist/schema/chat_telegram_draft_ids.d.ts.map +1 -0
- package/dist/schema/chat_telegram_draft_ids.js +14 -0
- package/dist/schema/chat_telegram_draft_ids.js.map +1 -0
- package/dist/schema/chat_voice_callbacks.d.ts +128 -0
- package/dist/schema/chat_voice_callbacks.d.ts.map +1 -0
- package/dist/schema/chat_voice_callbacks.js +18 -0
- package/dist/schema/chat_voice_callbacks.js.map +1 -0
- package/dist/schema/chat_voice_inbound.d.ts +461 -0
- package/dist/schema/chat_voice_inbound.d.ts.map +1 -0
- package/dist/schema/chat_voice_inbound.js +45 -0
- package/dist/schema/chat_voice_inbound.js.map +1 -0
- package/dist/schema/chat_voice_reports.d.ts +184 -0
- package/dist/schema/chat_voice_reports.d.ts.map +1 -0
- package/dist/schema/chat_voice_reports.js +24 -0
- package/dist/schema/chat_voice_reports.js.map +1 -0
- package/dist/schema/chat_voice_sessions.d.ts +730 -0
- package/dist/schema/chat_voice_sessions.d.ts.map +1 -0
- package/dist/schema/chat_voice_sessions.js +85 -0
- package/dist/schema/chat_voice_sessions.js.map +1 -0
- package/dist/schema/cli_auth_challenges.d.ts +263 -0
- package/dist/schema/cli_auth_challenges.d.ts.map +1 -0
- package/dist/schema/cli_auth_challenges.js +26 -0
- package/dist/schema/cli_auth_challenges.js.map +1 -0
- package/dist/schema/companies.d.ts +369 -0
- package/dist/schema/companies.d.ts.map +1 -0
- package/dist/schema/companies.js +34 -0
- package/dist/schema/companies.js.map +1 -0
- package/dist/schema/company_logos.d.ts +93 -0
- package/dist/schema/company_logos.d.ts.map +1 -0
- package/dist/schema/company_logos.js +14 -0
- package/dist/schema/company_logos.js.map +1 -0
- package/dist/schema/company_memberships.d.ts +144 -0
- package/dist/schema/company_memberships.d.ts.map +1 -0
- package/dist/schema/company_memberships.js +17 -0
- package/dist/schema/company_memberships.js.map +1 -0
- package/dist/schema/company_onboarding_seeds.d.ts +257 -0
- package/dist/schema/company_onboarding_seeds.d.ts.map +1 -0
- package/dist/schema/company_onboarding_seeds.js +35 -0
- package/dist/schema/company_onboarding_seeds.js.map +1 -0
- package/dist/schema/company_secret_bindings.d.ts +229 -0
- package/dist/schema/company_secret_bindings.d.ts.map +1 -0
- package/dist/schema/company_secret_bindings.js +24 -0
- package/dist/schema/company_secret_bindings.js.map +1 -0
- package/dist/schema/company_secret_proposals.d.ts +575 -0
- package/dist/schema/company_secret_proposals.d.ts.map +1 -0
- package/dist/schema/company_secret_proposals.js +69 -0
- package/dist/schema/company_secret_proposals.js.map +1 -0
- package/dist/schema/company_secret_provider_configs.d.ts +284 -0
- package/dist/schema/company_secret_provider_configs.d.ts.map +1 -0
- package/dist/schema/company_secret_provider_configs.js +29 -0
- package/dist/schema/company_secret_provider_configs.js.map +1 -0
- package/dist/schema/company_secret_versions.d.ts +231 -0
- package/dist/schema/company_secret_versions.d.ts.map +1 -0
- package/dist/schema/company_secret_versions.js +24 -0
- package/dist/schema/company_secret_versions.js.map +1 -0
- package/dist/schema/company_secrets.d.ts +401 -0
- package/dist/schema/company_secrets.d.ts.map +1 -0
- package/dist/schema/company_secrets.js +57 -0
- package/dist/schema/company_secrets.js.map +1 -0
- package/dist/schema/company_skill_policies.d.ts +131 -0
- package/dist/schema/company_skill_policies.d.ts.map +1 -0
- package/dist/schema/company_skill_policies.js +12 -0
- package/dist/schema/company_skill_policies.js.map +1 -0
- package/dist/schema/company_skill_sources.d.ts +498 -0
- package/dist/schema/company_skill_sources.d.ts.map +1 -0
- package/dist/schema/company_skill_sources.js +43 -0
- package/dist/schema/company_skill_sources.js.map +1 -0
- package/dist/schema/company_skills.d.ts +1860 -0
- package/dist/schema/company_skills.d.ts.map +1 -0
- package/dist/schema/company_skills.js +157 -0
- package/dist/schema/company_skills.js.map +1 -0
- package/dist/schema/company_transfer_runs.d.ts +297 -0
- package/dist/schema/company_transfer_runs.d.ts.map +1 -0
- package/dist/schema/company_transfer_runs.js +42 -0
- package/dist/schema/company_transfer_runs.js.map +1 -0
- package/dist/schema/company_user_sidebar_preferences.d.ts +112 -0
- package/dist/schema/company_user_sidebar_preferences.d.ts.map +1 -0
- package/dist/schema/company_user_sidebar_preferences.js +15 -0
- package/dist/schema/company_user_sidebar_preferences.js.map +1 -0
- package/dist/schema/completion_contracts.d.ts +265 -0
- package/dist/schema/completion_contracts.d.ts.map +1 -0
- package/dist/schema/completion_contracts.js +35 -0
- package/dist/schema/completion_contracts.js.map +1 -0
- package/dist/schema/connection_event_deliveries.d.ts +291 -0
- package/dist/schema/connection_event_deliveries.d.ts.map +1 -0
- package/dist/schema/connection_event_deliveries.js +31 -0
- package/dist/schema/connection_event_deliveries.js.map +1 -0
- package/dist/schema/connection_intent_deliveries.d.ts +94 -0
- package/dist/schema/connection_intent_deliveries.d.ts.map +1 -0
- package/dist/schema/connection_intent_deliveries.js +12 -0
- package/dist/schema/connection_intent_deliveries.js.map +1 -0
- package/dist/schema/cost_events.d.ts +469 -0
- package/dist/schema/cost_events.d.ts.map +1 -0
- package/dist/schema/cost_events.js +52 -0
- package/dist/schema/cost_events.js.map +1 -0
- package/dist/schema/decision_models.d.ts +579 -0
- package/dist/schema/decision_models.d.ts.map +1 -0
- package/dist/schema/decision_models.js +50 -0
- package/dist/schema/decision_models.js.map +1 -0
- package/dist/schema/decision_queues.d.ts +1510 -0
- package/dist/schema/decision_queues.d.ts.map +1 -0
- package/dist/schema/decision_queues.js +161 -0
- package/dist/schema/decision_queues.js.map +1 -0
- package/dist/schema/decision_training_examples.d.ts +255 -0
- package/dist/schema/decision_training_examples.d.ts.map +1 -0
- package/dist/schema/decision_training_examples.js +27 -0
- package/dist/schema/decision_training_examples.js.map +1 -0
- package/dist/schema/decisions.d.ts +824 -0
- package/dist/schema/decisions.d.ts.map +1 -0
- package/dist/schema/decisions.js +81 -0
- package/dist/schema/decisions.js.map +1 -0
- package/dist/schema/document_annotation_anchor_snapshots.d.ts +255 -0
- package/dist/schema/document_annotation_anchor_snapshots.d.ts.map +1 -0
- package/dist/schema/document_annotation_anchor_snapshots.js +25 -0
- package/dist/schema/document_annotation_anchor_snapshots.js.map +1 -0
- package/dist/schema/document_annotation_comments.d.ts +285 -0
- package/dist/schema/document_annotation_comments.d.ts.map +1 -0
- package/dist/schema/document_annotation_comments.js +39 -0
- package/dist/schema/document_annotation_comments.js.map +1 -0
- package/dist/schema/document_annotation_threads.d.ts +510 -0
- package/dist/schema/document_annotation_threads.d.ts.map +1 -0
- package/dist/schema/document_annotation_threads.js +52 -0
- package/dist/schema/document_annotation_threads.js.map +1 -0
- package/dist/schema/document_memberships.d.ts +127 -0
- package/dist/schema/document_memberships.d.ts.map +1 -0
- package/dist/schema/document_memberships.js +16 -0
- package/dist/schema/document_memberships.js.map +1 -0
- package/dist/schema/document_revisions.d.ts +212 -0
- package/dist/schema/document_revisions.d.ts.map +1 -0
- package/dist/schema/document_revisions.js +23 -0
- package/dist/schema/document_revisions.js.map +1 -0
- package/dist/schema/documents.d.ts +300 -0
- package/dist/schema/documents.d.ts.map +1 -0
- package/dist/schema/documents.js +28 -0
- package/dist/schema/documents.js.map +1 -0
- package/dist/schema/dot_runner.d.ts +980 -0
- package/dist/schema/dot_runner.d.ts.map +1 -0
- package/dist/schema/dot_runner.js +82 -0
- package/dist/schema/dot_runner.js.map +1 -0
- package/dist/schema/email.d.ts +550 -0
- package/dist/schema/email.d.ts.map +1 -0
- package/dist/schema/email.js +80 -0
- package/dist/schema/email.js.map +1 -0
- package/dist/schema/environment_custom_image_setup_sessions.d.ts +351 -0
- package/dist/schema/environment_custom_image_setup_sessions.d.ts.map +1 -0
- package/dist/schema/environment_custom_image_setup_sessions.js +39 -0
- package/dist/schema/environment_custom_image_setup_sessions.js.map +1 -0
- package/dist/schema/environment_custom_image_templates.d.ts +284 -0
- package/dist/schema/environment_custom_image_templates.d.ts.map +1 -0
- package/dist/schema/environment_custom_image_templates.js +32 -0
- package/dist/schema/environment_custom_image_templates.js.map +1 -0
- package/dist/schema/environment_leases.d.ts +333 -0
- package/dist/schema/environment_leases.d.ts.map +1 -0
- package/dist/schema/environment_leases.js +42 -0
- package/dist/schema/environment_leases.js.map +1 -0
- package/dist/schema/environments.d.ts +184 -0
- package/dist/schema/environments.d.ts.map +1 -0
- package/dist/schema/environments.js +24 -0
- package/dist/schema/environments.js.map +1 -0
- package/dist/schema/execution_workspace_runtime_leases.d.ts +248 -0
- package/dist/schema/execution_workspace_runtime_leases.d.ts.map +1 -0
- package/dist/schema/execution_workspace_runtime_leases.js +35 -0
- package/dist/schema/execution_workspace_runtime_leases.js.map +1 -0
- package/dist/schema/execution_workspaces.d.ts +418 -0
- package/dist/schema/execution_workspaces.d.ts.map +1 -0
- package/dist/schema/execution_workspaces.js +39 -0
- package/dist/schema/execution_workspaces.js.map +1 -0
- package/dist/schema/external_object_mentions.d.ts +337 -0
- package/dist/schema/external_object_mentions.d.ts.map +1 -0
- package/dist/schema/external_object_mentions.js +34 -0
- package/dist/schema/external_object_mentions.js.map +1 -0
- package/dist/schema/external_objects.d.ts +543 -0
- package/dist/schema/external_objects.d.ts.map +1 -0
- package/dist/schema/external_objects.js +43 -0
- package/dist/schema/external_objects.js.map +1 -0
- package/dist/schema/fast_responses.d.ts +662 -0
- package/dist/schema/fast_responses.d.ts.map +1 -0
- package/dist/schema/fast_responses.js +65 -0
- package/dist/schema/fast_responses.js.map +1 -0
- package/dist/schema/feedback_exports.d.ts +450 -0
- package/dist/schema/feedback_exports.d.ts.map +1 -0
- package/dist/schema/feedback_exports.js +41 -0
- package/dist/schema/feedback_exports.js.map +1 -0
- package/dist/schema/feedback_votes.d.ts +246 -0
- package/dist/schema/feedback_votes.d.ts.map +1 -0
- package/dist/schema/feedback_votes.js +25 -0
- package/dist/schema/feedback_votes.js.map +1 -0
- package/dist/schema/finance_events.d.ts +503 -0
- package/dist/schema/finance_events.d.ts.map +1 -0
- package/dist/schema/finance_events.js +48 -0
- package/dist/schema/finance_events.js.map +1 -0
- package/dist/schema/folders.d.ts +198 -0
- package/dist/schema/folders.d.ts.map +1 -0
- package/dist/schema/folders.js +29 -0
- package/dist/schema/folders.js.map +1 -0
- package/dist/schema/goals.d.ts +178 -0
- package/dist/schema/goals.d.ts.map +1 -0
- package/dist/schema/goals.js +18 -0
- package/dist/schema/goals.js.map +1 -0
- package/dist/schema/heartbeat_run_events.d.ts +299 -0
- package/dist/schema/heartbeat_run_events.d.ts.map +1 -0
- package/dist/schema/heartbeat_run_events.js +45 -0
- package/dist/schema/heartbeat_run_events.js.map +1 -0
- package/dist/schema/heartbeat_run_watchdog_decisions.d.ts +195 -0
- package/dist/schema/heartbeat_run_watchdog_decisions.d.ts.map +1 -0
- package/dist/schema/heartbeat_run_watchdog_decisions.js +22 -0
- package/dist/schema/heartbeat_run_watchdog_decisions.js.map +1 -0
- package/dist/schema/heartbeat_runs.d.ts +1344 -0
- package/dist/schema/heartbeat_runs.d.ts.map +1 -0
- package/dist/schema/heartbeat_runs.js +124 -0
- package/dist/schema/heartbeat_runs.js.map +1 -0
- package/dist/schema/inbox_dismissals.d.ts +163 -0
- package/dist/schema/inbox_dismissals.d.ts.map +1 -0
- package/dist/schema/inbox_dismissals.js +18 -0
- package/dist/schema/inbox_dismissals.js.map +1 -0
- package/dist/schema/index.d.ts +172 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +172 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/instance_settings.d.ts +150 -0
- package/dist/schema/instance_settings.d.ts.map +1 -0
- package/dist/schema/instance_settings.js +15 -0
- package/dist/schema/instance_settings.js.map +1 -0
- package/dist/schema/instance_user_roles.d.ts +93 -0
- package/dist/schema/instance_user_roles.d.ts.map +1 -0
- package/dist/schema/instance_user_roles.js +12 -0
- package/dist/schema/instance_user_roles.js.map +1 -0
- package/dist/schema/invites.d.ts +214 -0
- package/dist/schema/invites.d.ts.map +1 -0
- package/dist/schema/invites.js +20 -0
- package/dist/schema/invites.js.map +1 -0
- package/dist/schema/issue_access_grants.d.ts +161 -0
- package/dist/schema/issue_access_grants.d.ts.map +1 -0
- package/dist/schema/issue_access_grants.js +21 -0
- package/dist/schema/issue_access_grants.js.map +1 -0
- package/dist/schema/issue_approvals.d.ts +110 -0
- package/dist/schema/issue_approvals.d.ts.map +1 -0
- package/dist/schema/issue_approvals.js +19 -0
- package/dist/schema/issue_approvals.js.map +1 -0
- package/dist/schema/issue_attachments.d.ts +144 -0
- package/dist/schema/issue_attachments.d.ts.map +1 -0
- package/dist/schema/issue_attachments.js +24 -0
- package/dist/schema/issue_attachments.js.map +1 -0
- package/dist/schema/issue_autonomy_windows.d.ts +250 -0
- package/dist/schema/issue_autonomy_windows.d.ts.map +1 -0
- package/dist/schema/issue_autonomy_windows.js +30 -0
- package/dist/schema/issue_autonomy_windows.js.map +1 -0
- package/dist/schema/issue_comments.d.ts +482 -0
- package/dist/schema/issue_comments.d.ts.map +1 -0
- package/dist/schema/issue_comments.js +48 -0
- package/dist/schema/issue_comments.js.map +1 -0
- package/dist/schema/issue_create_idempotency_keys.d.ts +93 -0
- package/dist/schema/issue_create_idempotency_keys.d.ts.map +1 -0
- package/dist/schema/issue_create_idempotency_keys.js +15 -0
- package/dist/schema/issue_create_idempotency_keys.js.map +1 -0
- package/dist/schema/issue_documents.d.ts +127 -0
- package/dist/schema/issue_documents.d.ts.map +1 -0
- package/dist/schema/issue_documents.js +18 -0
- package/dist/schema/issue_documents.js.map +1 -0
- package/dist/schema/issue_execution_decisions.d.ts +212 -0
- package/dist/schema/issue_execution_decisions.d.ts.map +1 -0
- package/dist/schema/issue_execution_decisions.js +23 -0
- package/dist/schema/issue_execution_decisions.js.map +1 -0
- package/dist/schema/issue_inbox_archives.d.ts +180 -0
- package/dist/schema/issue_inbox_archives.d.ts.map +1 -0
- package/dist/schema/issue_inbox_archives.js +25 -0
- package/dist/schema/issue_inbox_archives.js.map +1 -0
- package/dist/schema/issue_labels.d.ts +76 -0
- package/dist/schema/issue_labels.d.ts.map +1 -0
- package/dist/schema/issue_labels.js +16 -0
- package/dist/schema/issue_labels.js.map +1 -0
- package/dist/schema/issue_plan_decompositions.d.ts +284 -0
- package/dist/schema/issue_plan_decompositions.d.ts.map +1 -0
- package/dist/schema/issue_plan_decompositions.js +36 -0
- package/dist/schema/issue_plan_decompositions.js.map +1 -0
- package/dist/schema/issue_question_response_deliveries.d.ts +320 -0
- package/dist/schema/issue_question_response_deliveries.d.ts.map +1 -0
- package/dist/schema/issue_question_response_deliveries.js +42 -0
- package/dist/schema/issue_question_response_deliveries.js.map +1 -0
- package/dist/schema/issue_read_states.d.ts +127 -0
- package/dist/schema/issue_read_states.d.ts.map +1 -0
- package/dist/schema/issue_read_states.js +17 -0
- package/dist/schema/issue_read_states.js.map +1 -0
- package/dist/schema/issue_recovery_actions.d.ts +456 -0
- package/dist/schema/issue_recovery_actions.d.ts.map +1 -0
- package/dist/schema/issue_recovery_actions.js +44 -0
- package/dist/schema/issue_recovery_actions.js.map +1 -0
- package/dist/schema/issue_reference_mentions.d.ts +180 -0
- package/dist/schema/issue_reference_mentions.d.ts.map +1 -0
- package/dist/schema/issue_reference_mentions.js +23 -0
- package/dist/schema/issue_reference_mentions.js.map +1 -0
- package/dist/schema/issue_relations.d.ts +163 -0
- package/dist/schema/issue_relations.d.ts.map +1 -0
- package/dist/schema/issue_relations.js +21 -0
- package/dist/schema/issue_relations.js.map +1 -0
- package/dist/schema/issue_share_links.d.ts +195 -0
- package/dist/schema/issue_share_links.d.ts.map +1 -0
- package/dist/schema/issue_share_links.js +24 -0
- package/dist/schema/issue_share_links.js.map +1 -0
- package/dist/schema/issue_thread_interaction_owner_relays.d.ts +198 -0
- package/dist/schema/issue_thread_interaction_owner_relays.d.ts.map +1 -0
- package/dist/schema/issue_thread_interaction_owner_relays.js +23 -0
- package/dist/schema/issue_thread_interaction_owner_relays.js.map +1 -0
- package/dist/schema/issue_thread_interactions.d.ts +535 -0
- package/dist/schema/issue_thread_interactions.d.ts.map +1 -0
- package/dist/schema/issue_thread_interactions.js +65 -0
- package/dist/schema/issue_thread_interactions.js.map +1 -0
- package/dist/schema/issue_tree_hold_members.d.ts +280 -0
- package/dist/schema/issue_tree_hold_members.d.ts.map +1 -0
- package/dist/schema/issue_tree_hold_members.js +29 -0
- package/dist/schema/issue_tree_hold_members.js.map +1 -0
- package/dist/schema/issue_tree_holds.d.ts +352 -0
- package/dist/schema/issue_tree_holds.d.ts.map +1 -0
- package/dist/schema/issue_tree_holds.js +31 -0
- package/dist/schema/issue_tree_holds.js.map +1 -0
- package/dist/schema/issue_watchdogs.d.ts +382 -0
- package/dist/schema/issue_watchdogs.d.ts.map +1 -0
- package/dist/schema/issue_watchdogs.js +38 -0
- package/dist/schema/issue_watchdogs.js.map +1 -0
- package/dist/schema/issue_work_products.d.ts +370 -0
- package/dist/schema/issue_work_products.d.ts.map +1 -0
- package/dist/schema/issue_work_products.js +38 -0
- package/dist/schema/issue_work_products.js.map +1 -0
- package/dist/schema/issues.d.ts +1130 -0
- package/dist/schema/issues.d.ts.map +1 -0
- package/dist/schema/issues.js +165 -0
- package/dist/schema/issues.js.map +1 -0
- package/dist/schema/join_requests.d.ts +384 -0
- package/dist/schema/join_requests.d.ts.map +1 -0
- package/dist/schema/join_requests.js +39 -0
- package/dist/schema/join_requests.js.map +1 -0
- package/dist/schema/labels.d.ts +110 -0
- package/dist/schema/labels.d.ts.map +1 -0
- package/dist/schema/labels.js +14 -0
- package/dist/schema/labels.js.map +1 -0
- package/dist/schema/local_browser_connections.d.ts +429 -0
- package/dist/schema/local_browser_connections.d.ts.map +1 -0
- package/dist/schema/local_browser_connections.js +35 -0
- package/dist/schema/local_browser_connections.js.map +1 -0
- package/dist/schema/managed_agent_profiles.d.ts +339 -0
- package/dist/schema/managed_agent_profiles.d.ts.map +1 -0
- package/dist/schema/managed_agent_profiles.js +44 -0
- package/dist/schema/managed_agent_profiles.js.map +1 -0
- package/dist/schema/model_cooldowns.d.ts +144 -0
- package/dist/schema/model_cooldowns.d.ts.map +1 -0
- package/dist/schema/model_cooldowns.js +16 -0
- package/dist/schema/model_cooldowns.js.map +1 -0
- package/dist/schema/native_run_finalizations.d.ts +403 -0
- package/dist/schema/native_run_finalizations.d.ts.map +1 -0
- package/dist/schema/native_run_finalizations.js +91 -0
- package/dist/schema/native_run_finalizations.js.map +1 -0
- package/dist/schema/native_run_results.d.ts +248 -0
- package/dist/schema/native_run_results.d.ts.map +1 -0
- package/dist/schema/native_run_results.js +56 -0
- package/dist/schema/native_run_results.js.map +1 -0
- package/dist/schema/pipeline_case_events.d.ts +231 -0
- package/dist/schema/pipeline_case_events.d.ts.map +1 -0
- package/dist/schema/pipeline_case_events.js +53 -0
- package/dist/schema/pipeline_case_events.js.map +1 -0
- package/dist/schema/pipeline_cases.d.ts +1388 -0
- package/dist/schema/pipeline_cases.d.ts.map +1 -0
- package/dist/schema/pipeline_cases.js +138 -0
- package/dist/schema/pipeline_cases.js.map +1 -0
- package/dist/schema/pipelines.d.ts +500 -0
- package/dist/schema/pipelines.d.ts.map +1 -0
- package/dist/schema/pipelines.js +52 -0
- package/dist/schema/pipelines.js.map +1 -0
- package/dist/schema/pixels_office_seats.d.ts +127 -0
- package/dist/schema/pixels_office_seats.d.ts.map +1 -0
- package/dist/schema/pixels_office_seats.js +16 -0
- package/dist/schema/pixels_office_seats.js.map +1 -0
- package/dist/schema/plugin_company_settings.d.ts +159 -0
- package/dist/schema/plugin_company_settings.d.ts.map +1 -0
- package/dist/schema/plugin_company_settings.js +35 -0
- package/dist/schema/plugin_company_settings.js.map +1 -0
- package/dist/schema/plugin_config.d.ts +139 -0
- package/dist/schema/plugin_config.d.ts.map +1 -0
- package/dist/schema/plugin_config.js +29 -0
- package/dist/schema/plugin_config.js.map +1 -0
- package/dist/schema/plugin_database.d.ts +357 -0
- package/dist/schema/plugin_database.d.ts.map +1 -0
- package/dist/schema/plugin_database.js +51 -0
- package/dist/schema/plugin_database.js.map +1 -0
- package/dist/schema/plugin_entities.d.ts +230 -0
- package/dist/schema/plugin_entities.d.ts.map +1 -0
- package/dist/schema/plugin_entities.js +52 -0
- package/dist/schema/plugin_entities.js.map +1 -0
- package/dist/schema/plugin_jobs.d.ts +409 -0
- package/dist/schema/plugin_jobs.d.ts.map +1 -0
- package/dist/schema/plugin_jobs.js +87 -0
- package/dist/schema/plugin_jobs.js.map +1 -0
- package/dist/schema/plugin_lifecycle_acknowledgments.d.ts +59 -0
- package/dist/schema/plugin_lifecycle_acknowledgments.d.ts.map +1 -0
- package/dist/schema/plugin_lifecycle_acknowledgments.js +12 -0
- package/dist/schema/plugin_lifecycle_acknowledgments.js.map +1 -0
- package/dist/schema/plugin_logs.d.ts +142 -0
- package/dist/schema/plugin_logs.d.ts.map +1 -0
- package/dist/schema/plugin_logs.js +33 -0
- package/dist/schema/plugin_logs.js.map +1 -0
- package/dist/schema/plugin_managed_resources.d.ts +180 -0
- package/dist/schema/plugin_managed_resources.d.ts.map +1 -0
- package/dist/schema/plugin_managed_resources.js +25 -0
- package/dist/schema/plugin_managed_resources.js.map +1 -0
- package/dist/schema/plugin_state.d.ts +169 -0
- package/dist/schema/plugin_state.d.ts.map +1 -0
- package/dist/schema/plugin_state.js +68 -0
- package/dist/schema/plugin_state.js.map +1 -0
- package/dist/schema/plugin_webhooks.d.ts +256 -0
- package/dist/schema/plugin_webhooks.d.ts.map +1 -0
- package/dist/schema/plugin_webhooks.js +56 -0
- package/dist/schema/plugin_webhooks.js.map +1 -0
- package/dist/schema/plugins.d.ts +246 -0
- package/dist/schema/plugins.d.ts.map +1 -0
- package/dist/schema/plugins.js +31 -0
- package/dist/schema/plugins.js.map +1 -0
- package/dist/schema/principal_permission_grants.d.ts +163 -0
- package/dist/schema/principal_permission_grants.d.ts.map +1 -0
- package/dist/schema/principal_permission_grants.js +17 -0
- package/dist/schema/principal_permission_grants.js.map +1 -0
- package/dist/schema/project_access_members.d.ts +111 -0
- package/dist/schema/project_access_members.d.ts.map +1 -0
- package/dist/schema/project_access_members.js +18 -0
- package/dist/schema/project_access_members.js.map +1 -0
- package/dist/schema/project_goals.d.ts +93 -0
- package/dist/schema/project_goals.d.ts.map +1 -0
- package/dist/schema/project_goals.js +17 -0
- package/dist/schema/project_goals.js.map +1 -0
- package/dist/schema/project_memberships.d.ts +144 -0
- package/dist/schema/project_memberships.d.ts.map +1 -0
- package/dist/schema/project_memberships.js +19 -0
- package/dist/schema/project_memberships.js.map +1 -0
- package/dist/schema/project_workspaces.d.ts +333 -0
- package/dist/schema/project_workspaces.d.ts.map +1 -0
- package/dist/schema/project_workspaces.js +32 -0
- package/dist/schema/project_workspaces.js.map +1 -0
- package/dist/schema/projects.d.ts +353 -0
- package/dist/schema/projects.d.ts.map +1 -0
- package/dist/schema/projects.js +34 -0
- package/dist/schema/projects.js.map +1 -0
- package/dist/schema/provider_trace_records.d.ts +264 -0
- package/dist/schema/provider_trace_records.d.ts.map +1 -0
- package/dist/schema/provider_trace_records.js +34 -0
- package/dist/schema/provider_trace_records.js.map +1 -0
- package/dist/schema/public_mcp.d.ts +2100 -0
- package/dist/schema/public_mcp.d.ts.map +1 -0
- package/dist/schema/public_mcp.js +191 -0
- package/dist/schema/public_mcp.js.map +1 -0
- package/dist/schema/remote_agent_profiles.d.ts +238 -0
- package/dist/schema/remote_agent_profiles.d.ts.map +1 -0
- package/dist/schema/remote_agent_profiles.js +31 -0
- package/dist/schema/remote_agent_profiles.js.map +1 -0
- package/dist/schema/resource_lifecycle_events.d.ts +115 -0
- package/dist/schema/resource_lifecycle_events.d.ts.map +1 -0
- package/dist/schema/resource_lifecycle_events.js +19 -0
- package/dist/schema/resource_lifecycle_events.js.map +1 -0
- package/dist/schema/routine_documents.d.ts +127 -0
- package/dist/schema/routine_documents.d.ts.map +1 -0
- package/dist/schema/routine_documents.js +18 -0
- package/dist/schema/routine_documents.js.map +1 -0
- package/dist/schema/routines.d.ts +1611 -0
- package/dist/schema/routines.d.ts.map +1 -0
- package/dist/schema/routines.js +140 -0
- package/dist/schema/routines.js.map +1 -0
- package/dist/schema/run_identity_contexts.d.ts +248 -0
- package/dist/schema/run_identity_contexts.d.ts.map +1 -0
- package/dist/schema/run_identity_contexts.js +29 -0
- package/dist/schema/run_identity_contexts.js.map +1 -0
- package/dist/schema/runner_api_response_reservations.d.ts +110 -0
- package/dist/schema/runner_api_response_reservations.d.ts.map +1 -0
- package/dist/schema/runner_api_response_reservations.js +13 -0
- package/dist/schema/runner_api_response_reservations.js.map +1 -0
- package/dist/schema/secret_access_events.d.ts +382 -0
- package/dist/schema/secret_access_events.d.ts.map +1 -0
- package/dist/schema/secret_access_events.js +39 -0
- package/dist/schema/secret_access_events.js.map +1 -0
- package/dist/schema/smoke_lab.d.ts +367 -0
- package/dist/schema/smoke_lab.d.ts.map +1 -0
- package/dist/schema/smoke_lab.js +33 -0
- package/dist/schema/smoke_lab.js.map +1 -0
- package/dist/schema/status_cards.d.ts +949 -0
- package/dist/schema/status_cards.d.ts.map +1 -0
- package/dist/schema/status_cards.js +70 -0
- package/dist/schema/status_cards.js.map +1 -0
- package/dist/schema/status_decision_effects.d.ts +299 -0
- package/dist/schema/status_decision_effects.d.ts.map +1 -0
- package/dist/schema/status_decision_effects.js +37 -0
- package/dist/schema/status_decision_effects.js.map +1 -0
- package/dist/schema/status_decisions.d.ts +282 -0
- package/dist/schema/status_decisions.d.ts.map +1 -0
- package/dist/schema/status_decisions.js +49 -0
- package/dist/schema/status_decisions.js.map +1 -0
- package/dist/schema/summary_slots.d.ts +252 -0
- package/dist/schema/summary_slots.d.ts.map +1 -0
- package/dist/schema/summary_slots.js +32 -0
- package/dist/schema/summary_slots.js.map +1 -0
- package/dist/schema/terminal_ssh_hosts.d.ts +127 -0
- package/dist/schema/terminal_ssh_hosts.d.ts.map +1 -0
- package/dist/schema/terminal_ssh_hosts.js +14 -0
- package/dist/schema/terminal_ssh_hosts.js.map +1 -0
- package/dist/schema/tool_access.d.ts +8433 -0
- package/dist/schema/tool_access.d.ts.map +1 -0
- package/dist/schema/tool_access.js +737 -0
- package/dist/schema/tool_access.js.map +1 -0
- package/dist/schema/tool_action_deliveries.d.ts +111 -0
- package/dist/schema/tool_action_deliveries.d.ts.map +1 -0
- package/dist/schema/tool_action_deliveries.js +27 -0
- package/dist/schema/tool_action_deliveries.js.map +1 -0
- package/dist/schema/tool_connection_app_snapshots.d.ts +184 -0
- package/dist/schema/tool_connection_app_snapshots.d.ts.map +1 -0
- package/dist/schema/tool_connection_app_snapshots.js +20 -0
- package/dist/schema/tool_connection_app_snapshots.js.map +1 -0
- package/dist/schema/tool_connection_app_syncs.d.ts +215 -0
- package/dist/schema/tool_connection_app_syncs.d.ts.map +1 -0
- package/dist/schema/tool_connection_app_syncs.js +22 -0
- package/dist/schema/tool_connection_app_syncs.js.map +1 -0
- package/dist/schema/user_company_preferences.d.ts +127 -0
- package/dist/schema/user_company_preferences.d.ts.map +1 -0
- package/dist/schema/user_company_preferences.js +16 -0
- package/dist/schema/user_company_preferences.js.map +1 -0
- package/dist/schema/user_inbox_agent_policies.d.ts +131 -0
- package/dist/schema/user_inbox_agent_policies.d.ts.map +1 -0
- package/dist/schema/user_inbox_agent_policies.js +17 -0
- package/dist/schema/user_inbox_agent_policies.js.map +1 -0
- package/dist/schema/user_secret_declarations.d.ts +229 -0
- package/dist/schema/user_secret_declarations.d.ts.map +1 -0
- package/dist/schema/user_secret_declarations.js +31 -0
- package/dist/schema/user_secret_declarations.js.map +1 -0
- package/dist/schema/user_secret_definitions.d.ts +316 -0
- package/dist/schema/user_secret_definitions.d.ts.map +1 -0
- package/dist/schema/user_secret_definitions.js +33 -0
- package/dist/schema/user_secret_definitions.js.map +1 -0
- package/dist/schema/user_sidebar_preferences.d.ts +95 -0
- package/dist/schema/user_sidebar_preferences.d.ts.map +1 -0
- package/dist/schema/user_sidebar_preferences.js +11 -0
- package/dist/schema/user_sidebar_preferences.js.map +1 -0
- package/dist/schema/web_push_subscriptions.d.ts +197 -0
- package/dist/schema/web_push_subscriptions.d.ts.map +1 -0
- package/dist/schema/web_push_subscriptions.js +18 -0
- package/dist/schema/web_push_subscriptions.js.map +1 -0
- package/dist/schema/work_assessments.d.ts +333 -0
- package/dist/schema/work_assessments.d.ts.map +1 -0
- package/dist/schema/work_assessments.js +67 -0
- package/dist/schema/work_assessments.js.map +1 -0
- package/dist/schema/workspace_operations.d.ts +384 -0
- package/dist/schema/workspace_operations.d.ts.map +1 -0
- package/dist/schema/workspace_operations.js +40 -0
- package/dist/schema/workspace_operations.js.map +1 -0
- package/dist/schema/workspace_runtime_services.d.ts +523 -0
- package/dist/schema/workspace_runtime_services.d.ts.map +1 -0
- package/dist/schema/workspace_runtime_services.js +53 -0
- package/dist/schema/workspace_runtime_services.js.map +1 -0
- package/dist/session-goal-migration.test.d.ts +2 -0
- package/dist/session-goal-migration.test.d.ts.map +1 -0
- package/dist/session-goal-migration.test.js +47 -0
- package/dist/session-goal-migration.test.js.map +1 -0
- package/dist/speko-voice-migration.test.d.ts +2 -0
- package/dist/speko-voice-migration.test.d.ts.map +1 -0
- package/dist/speko-voice-migration.test.js +88 -0
- package/dist/speko-voice-migration.test.js.map +1 -0
- package/dist/status-card-migrations.test.d.ts +2 -0
- package/dist/status-card-migrations.test.d.ts.map +1 -0
- package/dist/status-card-migrations.test.js +34 -0
- package/dist/status-card-migrations.test.js.map +1 -0
- package/dist/summary-slots-schema.test.d.ts +2 -0
- package/dist/summary-slots-schema.test.d.ts.map +1 -0
- package/dist/summary-slots-schema.test.js +62 -0
- package/dist/summary-slots-schema.test.js.map +1 -0
- package/dist/table-size-estimates.d.ts +366 -0
- package/dist/table-size-estimates.d.ts.map +1 -0
- package/dist/table-size-estimates.js +153 -0
- package/dist/table-size-estimates.js.map +1 -0
- package/dist/test-embedded-postgres.d.ts +42 -0
- package/dist/test-embedded-postgres.d.ts.map +1 -0
- package/dist/test-embedded-postgres.js +267 -0
- package/dist/test-embedded-postgres.js.map +1 -0
- package/dist/test-embedded-postgres.test.d.ts +2 -0
- package/dist/test-embedded-postgres.test.d.ts.map +1 -0
- package/dist/test-embedded-postgres.test.js +76 -0
- package/dist/test-embedded-postgres.test.js.map +1 -0
- package/dist/vercel-connect-credential-source-migration.test.d.ts +2 -0
- package/dist/vercel-connect-credential-source-migration.test.d.ts.map +1 -0
- package/dist/vercel-connect-credential-source-migration.test.js +71 -0
- package/dist/vercel-connect-credential-source-migration.test.js.map +1 -0
- package/dist/work-signals.d.ts +20 -0
- package/dist/work-signals.d.ts.map +1 -0
- package/dist/work-signals.js +123 -0
- package/dist/work-signals.js.map +1 -0
- package/dist/work-signals.test.d.ts +2 -0
- package/dist/work-signals.test.d.ts.map +1 -0
- package/dist/work-signals.test.js +177 -0
- package/dist/work-signals.test.js.map +1 -0
- package/node_modules/async-exit-hook/index.js +171 -0
- package/node_modules/async-exit-hook/license +21 -0
- package/node_modules/async-exit-hook/package.json +66 -0
- package/node_modules/async-exit-hook/readme.md +118 -0
- package/node_modules/embedded-postgres/LICENSE.md +9 -0
- package/node_modules/embedded-postgres/README.md +191 -0
- package/node_modules/embedded-postgres/dist/binary.d.ts +7 -0
- package/node_modules/embedded-postgres/dist/binary.js +41 -0
- package/node_modules/embedded-postgres/dist/index.d.ts +58 -0
- package/node_modules/embedded-postgres/dist/index.js +366 -0
- package/node_modules/embedded-postgres/dist/types.d.ts +54 -0
- package/node_modules/embedded-postgres/dist/types.js +1 -0
- package/node_modules/embedded-postgres/package.json +59 -0
- package/node_modules/pg/LICENSE +21 -0
- package/node_modules/pg/README.md +96 -0
- package/node_modules/pg/esm/index.mjs +20 -0
- package/node_modules/pg/lib/client.js +846 -0
- package/node_modules/pg/lib/connection-parameters.js +184 -0
- package/node_modules/pg/lib/connection.js +250 -0
- package/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/node_modules/pg/lib/crypto/sasl.js +262 -0
- package/node_modules/pg/lib/crypto/utils.js +89 -0
- package/node_modules/pg/lib/defaults.js +94 -0
- package/node_modules/pg/lib/index.js +73 -0
- package/node_modules/pg/lib/native/client.js +428 -0
- package/node_modules/pg/lib/native/index.js +2 -0
- package/node_modules/pg/lib/native/query.js +167 -0
- package/node_modules/pg/lib/query.js +263 -0
- package/node_modules/pg/lib/result.js +109 -0
- package/node_modules/pg/lib/stream.js +83 -0
- package/node_modules/pg/lib/type-overrides.js +35 -0
- package/node_modules/pg/lib/utils.js +225 -0
- package/node_modules/pg/package.json +76 -0
- package/node_modules/pg-cloudflare/LICENSE +21 -0
- package/node_modules/pg-cloudflare/README.md +112 -0
- package/node_modules/pg-cloudflare/dist/empty.d.ts +2 -0
- package/node_modules/pg-cloudflare/dist/empty.js +6 -0
- package/node_modules/pg-cloudflare/dist/empty.js.map +1 -0
- package/node_modules/pg-cloudflare/dist/index.d.ts +29 -0
- package/node_modules/pg-cloudflare/dist/index.js +171 -0
- package/node_modules/pg-cloudflare/dist/index.js.map +1 -0
- package/node_modules/pg-cloudflare/esm/index.mjs +3 -0
- package/node_modules/pg-cloudflare/package.json +39 -0
- package/node_modules/pg-cloudflare/src/empty.ts +3 -0
- package/node_modules/pg-cloudflare/src/index.ts +187 -0
- package/node_modules/pg-cloudflare/src/types.d.ts +25 -0
- package/node_modules/pg-connection-string/LICENSE +21 -0
- package/node_modules/pg-connection-string/README.md +105 -0
- package/node_modules/pg-connection-string/esm/index.mjs +8 -0
- package/node_modules/pg-connection-string/index.d.ts +37 -0
- package/node_modules/pg-connection-string/index.js +237 -0
- package/node_modules/pg-connection-string/package.json +51 -0
- package/node_modules/pg-int8/LICENSE +13 -0
- package/node_modules/pg-int8/README.md +16 -0
- package/node_modules/pg-int8/index.js +100 -0
- package/node_modules/pg-int8/package.json +24 -0
- package/node_modules/pg-pool/LICENSE +21 -0
- package/node_modules/pg-pool/README.md +357 -0
- package/node_modules/pg-pool/esm/index.mjs +5 -0
- package/node_modules/pg-pool/index.js +517 -0
- package/node_modules/pg-pool/package.json +51 -0
- package/node_modules/pg-protocol/LICENSE +21 -0
- package/node_modules/pg-protocol/README.md +3 -0
- package/node_modules/pg-protocol/dist/b.d.ts +1 -0
- package/node_modules/pg-protocol/dist/b.js +23 -0
- package/node_modules/pg-protocol/dist/b.js.map +1 -0
- package/node_modules/pg-protocol/dist/buffer-reader.d.ts +14 -0
- package/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
- package/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -0
- package/node_modules/pg-protocol/dist/buffer-writer.d.ts +21 -0
- package/node_modules/pg-protocol/dist/buffer-writer.js +113 -0
- package/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -0
- package/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +1 -0
- package/node_modules/pg-protocol/dist/inbound-parser.test.js +538 -0
- package/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -0
- package/node_modules/pg-protocol/dist/index.d.ts +5 -0
- package/node_modules/pg-protocol/dist/index.js +15 -0
- package/node_modules/pg-protocol/dist/index.js.map +1 -0
- package/node_modules/pg-protocol/dist/messages.d.ts +161 -0
- package/node_modules/pg-protocol/dist/messages.js +160 -0
- package/node_modules/pg-protocol/dist/messages.js.map +1 -0
- package/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +1 -0
- package/node_modules/pg-protocol/dist/outbound-serializer.test.js +325 -0
- package/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -0
- package/node_modules/pg-protocol/dist/parser.d.ts +22 -0
- package/node_modules/pg-protocol/dist/parser.js +325 -0
- package/node_modules/pg-protocol/dist/parser.js.map +1 -0
- package/node_modules/pg-protocol/dist/serializer.d.ts +42 -0
- package/node_modules/pg-protocol/dist/serializer.js +198 -0
- package/node_modules/pg-protocol/dist/serializer.js.map +1 -0
- package/node_modules/pg-protocol/esm/index.js +11 -0
- package/node_modules/pg-protocol/package.json +44 -0
- package/node_modules/pg-protocol/src/b.ts +25 -0
- package/node_modules/pg-protocol/src/buffer-reader.ts +58 -0
- package/node_modules/pg-protocol/src/buffer-writer.ts +120 -0
- package/node_modules/pg-protocol/src/inbound-parser.test.ts +585 -0
- package/node_modules/pg-protocol/src/index.ts +11 -0
- package/node_modules/pg-protocol/src/messages.ts +262 -0
- package/node_modules/pg-protocol/src/outbound-serializer.test.ts +356 -0
- package/node_modules/pg-protocol/src/parser.ts +414 -0
- package/node_modules/pg-protocol/src/serializer.ts +286 -0
- package/node_modules/pg-protocol/src/testing/buffer-list.ts +67 -0
- package/node_modules/pg-protocol/src/testing/test-buffers.ts +166 -0
- package/node_modules/pg-types/.travis.yml +7 -0
- package/node_modules/pg-types/Makefile +14 -0
- package/node_modules/pg-types/README.md +75 -0
- package/node_modules/pg-types/index.d.ts +137 -0
- package/node_modules/pg-types/index.js +47 -0
- package/node_modules/pg-types/index.test-d.ts +21 -0
- package/node_modules/pg-types/lib/arrayParser.js +11 -0
- package/node_modules/pg-types/lib/binaryParsers.js +257 -0
- package/node_modules/pg-types/lib/builtins.js +73 -0
- package/node_modules/pg-types/lib/textParsers.js +215 -0
- package/node_modules/pg-types/package.json +42 -0
- package/node_modules/pg-types/test/index.js +24 -0
- package/node_modules/pg-types/test/types.js +597 -0
- package/node_modules/pgpass/README.md +74 -0
- package/node_modules/pgpass/lib/helper.js +233 -0
- package/node_modules/pgpass/lib/index.js +23 -0
- package/node_modules/pgpass/package.json +41 -0
- package/node_modules/postgres-array/index.d.ts +4 -0
- package/node_modules/postgres-array/index.js +97 -0
- package/node_modules/postgres-array/license +21 -0
- package/node_modules/postgres-array/package.json +35 -0
- package/node_modules/postgres-array/readme.md +43 -0
- package/node_modules/postgres-bytea/index.js +33 -0
- package/node_modules/postgres-bytea/license +21 -0
- package/node_modules/postgres-bytea/package.json +34 -0
- package/node_modules/postgres-bytea/readme.md +34 -0
- package/node_modules/postgres-date/index.js +116 -0
- package/node_modules/postgres-date/license +21 -0
- package/node_modules/postgres-date/package.json +33 -0
- package/node_modules/postgres-date/readme.md +49 -0
- package/node_modules/postgres-interval/index.d.ts +20 -0
- package/node_modules/postgres-interval/index.js +125 -0
- package/node_modules/postgres-interval/license +21 -0
- package/node_modules/postgres-interval/package.json +36 -0
- package/node_modules/postgres-interval/readme.md +48 -0
- package/node_modules/split2/LICENSE +13 -0
- package/node_modules/split2/README.md +85 -0
- package/node_modules/split2/bench.js +27 -0
- package/node_modules/split2/index.js +141 -0
- package/node_modules/split2/package.json +39 -0
- package/node_modules/split2/test.js +409 -0
- package/node_modules/xtend/.jshintrc +30 -0
- package/node_modules/xtend/LICENSE +20 -0
- package/node_modules/xtend/README.md +32 -0
- package/node_modules/xtend/immutable.js +19 -0
- package/node_modules/xtend/mutable.js +17 -0
- package/node_modules/xtend/package.json +55 -0
- package/node_modules/xtend/test.js +103 -0
- package/package.json +61 -10
- package/README.md +0 -8
- package/index.js +0 -1
|
@@ -0,0 +1,1792 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { drizzle } from "drizzle-orm/postgres-js";
|
|
6
|
+
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
|
7
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
8
|
+
import postgres from "postgres";
|
|
9
|
+
import { DEFAULT_DATABASE_APPLICATION_NAME, applyPendingMigrations, closeRegisteredClients, createDb, ensurePostgresDatabase, inspectMigrations, resetPostgresDatabase, } from "./client.js";
|
|
10
|
+
import { getEmbeddedPostgresTestSupport, startEmbeddedPostgresTestDatabase, } from "./test-embedded-postgres.js";
|
|
11
|
+
const cleanups = [];
|
|
12
|
+
const embeddedPostgresSupport = await getEmbeddedPostgresTestSupport();
|
|
13
|
+
const describeEmbeddedPostgres = embeddedPostgresSupport.supported ? describe : describe.skip;
|
|
14
|
+
async function createTempDatabase() {
|
|
15
|
+
const db = await startEmbeddedPostgresTestDatabase("paperclip-db-client-");
|
|
16
|
+
cleanups.push(db.cleanup);
|
|
17
|
+
return db.connectionString;
|
|
18
|
+
}
|
|
19
|
+
async function migrationHash(migrationFile) {
|
|
20
|
+
const content = await fs.promises.readFile(new URL(`./migrations/${migrationFile}`, import.meta.url), "utf8");
|
|
21
|
+
return createHash("sha256").update(content).digest("hex");
|
|
22
|
+
}
|
|
23
|
+
const userVisibleUpdatedAtTables = new Set([
|
|
24
|
+
"companies",
|
|
25
|
+
"heartbeat_runs",
|
|
26
|
+
"issue_comments",
|
|
27
|
+
"issues",
|
|
28
|
+
"routine_runs",
|
|
29
|
+
"routines",
|
|
30
|
+
]);
|
|
31
|
+
const migrationUpdatedAtUpdateAllowlist = new Map([
|
|
32
|
+
[
|
|
33
|
+
"0105_instance_scoped_environments.sql",
|
|
34
|
+
new Set(["issues"]),
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"0131_repair_run_responsible_user_context_refs.sql",
|
|
38
|
+
new Set(["heartbeat_runs"]),
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"0135_repair_run_responsible_user_updated_at_sweep.sql",
|
|
42
|
+
new Set(["companies", "heartbeat_runs", "issues", "routine_runs", "routines"]),
|
|
43
|
+
],
|
|
44
|
+
]);
|
|
45
|
+
function findUserVisibleUpdatedAtBackfillViolations(migrationFile, content) {
|
|
46
|
+
const allowedTables = migrationUpdatedAtUpdateAllowlist.get(migrationFile) ?? new Set();
|
|
47
|
+
const violations = [];
|
|
48
|
+
for (const statement of content.split("--> statement-breakpoint")) {
|
|
49
|
+
const updateMatch = statement.match(/\bUPDATE\s+"([^"]+)"/i);
|
|
50
|
+
if (!updateMatch)
|
|
51
|
+
continue;
|
|
52
|
+
const tableName = updateMatch[1];
|
|
53
|
+
if (!userVisibleUpdatedAtTables.has(tableName))
|
|
54
|
+
continue;
|
|
55
|
+
if (!/\bSET\b[\s\S]*"updated_at"\s*=/i.test(statement))
|
|
56
|
+
continue;
|
|
57
|
+
if (allowedTables.has(tableName))
|
|
58
|
+
continue;
|
|
59
|
+
violations.push(`${migrationFile}: UPDATE "${tableName}" sets updated_at`);
|
|
60
|
+
}
|
|
61
|
+
return violations;
|
|
62
|
+
}
|
|
63
|
+
afterEach(async () => {
|
|
64
|
+
while (cleanups.length > 0) {
|
|
65
|
+
const cleanup = cleanups.pop();
|
|
66
|
+
await cleanup?.();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
if (!embeddedPostgresSupport.supported) {
|
|
70
|
+
console.warn(`Skipping embedded Postgres migration tests on this host: ${embeddedPostgresSupport.reason ?? "unsupported environment"}`);
|
|
71
|
+
}
|
|
72
|
+
describeEmbeddedPostgres("createDb pool defaults", () => {
|
|
73
|
+
it("names its backends and closes them once idle", async () => {
|
|
74
|
+
const url = await createTempDatabase();
|
|
75
|
+
const observer = postgres(url, { max: 1, onnotice: () => { } });
|
|
76
|
+
cleanups.push(async () => {
|
|
77
|
+
await observer.end({ timeout: 1 });
|
|
78
|
+
});
|
|
79
|
+
const backendsNamed = async (name) => {
|
|
80
|
+
const rows = await observer `
|
|
81
|
+
select count(*)::int as count from pg_stat_activity where application_name = ${name}
|
|
82
|
+
`;
|
|
83
|
+
return rows[0]?.count ?? 0;
|
|
84
|
+
};
|
|
85
|
+
const db = createDb(url);
|
|
86
|
+
cleanups.push(async () => {
|
|
87
|
+
await db.$client.end({ timeout: 1 });
|
|
88
|
+
});
|
|
89
|
+
const [self] = await db.$client `select application_name from pg_stat_activity where pid = pg_backend_pid()`;
|
|
90
|
+
expect(self?.application_name).toBe(DEFAULT_DATABASE_APPLICATION_NAME);
|
|
91
|
+
const shortLived = createDb(url, { applicationName: "paperclip-idle-test", idleTimeoutSeconds: 1 });
|
|
92
|
+
cleanups.push(async () => {
|
|
93
|
+
await shortLived.$client.end({ timeout: 1 });
|
|
94
|
+
});
|
|
95
|
+
await shortLived.$client `select 1`;
|
|
96
|
+
expect(await backendsNamed("paperclip-idle-test")).toBe(1);
|
|
97
|
+
// The driver closes the idle connection after `idle_timeout`; without the
|
|
98
|
+
// option (the driver default) the backend would stay until the process
|
|
99
|
+
// exits. Wait past the timeout, then poll PostgreSQL's own view.
|
|
100
|
+
const deadline = Date.now() + 10_000;
|
|
101
|
+
let remaining = await backendsNamed("paperclip-idle-test");
|
|
102
|
+
while (remaining > 0 && Date.now() < deadline) {
|
|
103
|
+
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
104
|
+
remaining = await backendsNamed("paperclip-idle-test");
|
|
105
|
+
}
|
|
106
|
+
expect(remaining).toBe(0);
|
|
107
|
+
}, 30_000);
|
|
108
|
+
});
|
|
109
|
+
describeEmbeddedPostgres("resetPostgresDatabase", () => {
|
|
110
|
+
it("recreates an existing database so stale tables are removed", async () => {
|
|
111
|
+
const connectionString = await createTempDatabase();
|
|
112
|
+
const adminUrl = new URL(connectionString);
|
|
113
|
+
const databaseName = adminUrl.pathname.replace(/^\//, "");
|
|
114
|
+
adminUrl.pathname = "/postgres";
|
|
115
|
+
const setupSql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
116
|
+
try {
|
|
117
|
+
await setupSql.unsafe(`CREATE TABLE stale_reseed_target_only (id integer PRIMARY KEY)`);
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
await setupSql.end();
|
|
121
|
+
}
|
|
122
|
+
await resetPostgresDatabase(adminUrl.toString(), databaseName);
|
|
123
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
124
|
+
try {
|
|
125
|
+
const rows = await verifySql.unsafe(`SELECT to_regclass('public.stale_reseed_target_only')::text AS stale_table`);
|
|
126
|
+
expect(rows[0]?.stale_table).toBeNull();
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
await verifySql.end();
|
|
130
|
+
}
|
|
131
|
+
}, 30_000);
|
|
132
|
+
});
|
|
133
|
+
describeEmbeddedPostgres("applyPendingMigrations", () => {
|
|
134
|
+
it("upgrades an older clone whose replaced connection constraint is already absent", async () => {
|
|
135
|
+
const clusterUrl = new URL(await createTempDatabase());
|
|
136
|
+
const databaseName = "missing_connection_constraint";
|
|
137
|
+
clusterUrl.pathname = "/postgres";
|
|
138
|
+
await ensurePostgresDatabase(clusterUrl.toString(), databaseName);
|
|
139
|
+
clusterUrl.pathname = "/" + databaseName;
|
|
140
|
+
const connectionString = clusterUrl.toString();
|
|
141
|
+
const prefixFolder = await fs.promises.mkdtemp(join(tmpdir(), "paperclip-migration-prefix-"));
|
|
142
|
+
cleanups.push(() => fs.promises.rm(prefixFolder, { recursive: true, force: true }));
|
|
143
|
+
await fs.promises.mkdir(join(prefixFolder, "meta"));
|
|
144
|
+
const journal = JSON.parse(await fs.promises.readFile(new URL("./migrations/meta/_journal.json", import.meta.url), "utf8"));
|
|
145
|
+
journal.entries = journal.entries.filter((entry) => entry.idx < 255);
|
|
146
|
+
await fs.promises.writeFile(join(prefixFolder, "meta/_journal.json"), JSON.stringify(journal));
|
|
147
|
+
for (const entry of journal.entries) {
|
|
148
|
+
await fs.promises.copyFile(new URL(`./migrations/${entry.tag}.sql`, import.meta.url), join(prefixFolder, `${entry.tag}.sql`));
|
|
149
|
+
}
|
|
150
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
151
|
+
try {
|
|
152
|
+
await migrate(drizzle(sql), { migrationsFolder: prefixFolder });
|
|
153
|
+
await sql `ALTER TABLE "tool_connections" DROP CONSTRAINT "tool_connections_transport_check"`;
|
|
154
|
+
await applyPendingMigrations(connectionString);
|
|
155
|
+
expect((await inspectMigrations(connectionString)).status).toBe("upToDate");
|
|
156
|
+
const [constraint] = await sql `
|
|
157
|
+
SELECT pg_get_constraintdef(oid) AS definition FROM pg_constraint
|
|
158
|
+
WHERE conrelid = 'tool_connections'::regclass AND conname = 'tool_connections_transport_check'
|
|
159
|
+
`;
|
|
160
|
+
expect(constraint?.definition).toContain("chat_sdk");
|
|
161
|
+
expect(constraint?.definition).toContain("runtime_auth");
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
await sql.end();
|
|
165
|
+
}
|
|
166
|
+
}, 30_000);
|
|
167
|
+
it("upgrades renumbered recovery migrations and replays their schema idempotently", async () => {
|
|
168
|
+
const connectionString = await createTempDatabase();
|
|
169
|
+
await applyPendingMigrations(connectionString);
|
|
170
|
+
const recoveryFiles = [
|
|
171
|
+
"0250_exotic_dakota_north.sql", "0251_narrow_mastermind.sql",
|
|
172
|
+
"0252_friendly_kate_bishop.sql", "0253_real_firebrand.sql",
|
|
173
|
+
"0254_military_calypso.sql",
|
|
174
|
+
];
|
|
175
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
176
|
+
try {
|
|
177
|
+
// An instance may have applied this identical SQL under the pre-rebase
|
|
178
|
+
// numbers, before the new session-goal and tool-action migrations existed.
|
|
179
|
+
for (const file of recoveryFiles) {
|
|
180
|
+
const hash = await migrationHash(file);
|
|
181
|
+
await sql `UPDATE "drizzle"."__drizzle_migrations" SET created_at = 1788825600000 WHERE hash = ${hash}`;
|
|
182
|
+
const source = await fs.promises.readFile(new URL(`./migrations/${file}`, import.meta.url), "utf8");
|
|
183
|
+
for (const statement of source.split("--> statement-breakpoint")) {
|
|
184
|
+
if (statement.trim())
|
|
185
|
+
await sql.unsafe(statement);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
for (const file of ["0248_small_manta.sql", "0249_fast_silverclaw.sql"]) {
|
|
189
|
+
const hash = await migrationHash(file);
|
|
190
|
+
await sql `DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = ${hash}`;
|
|
191
|
+
}
|
|
192
|
+
await applyPendingMigrations(connectionString);
|
|
193
|
+
expect((await inspectMigrations(connectionString)).status).toBe("upToDate");
|
|
194
|
+
for (const file of recoveryFiles) {
|
|
195
|
+
const hash = await migrationHash(file);
|
|
196
|
+
const rows = await sql `SELECT id FROM "drizzle"."__drizzle_migrations" WHERE hash = ${hash}`;
|
|
197
|
+
expect(rows).toHaveLength(1);
|
|
198
|
+
}
|
|
199
|
+
const indexes = await sql `SELECT indexname FROM pg_indexes WHERE indexname = 'heartbeat_runs_native_replacement_predecessor_uq'`;
|
|
200
|
+
expect(indexes).toHaveLength(1);
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
await sql.end();
|
|
204
|
+
}
|
|
205
|
+
}, 30_000);
|
|
206
|
+
it("rejects unallowlisted migration backfills that bump updated_at on user-visible tables", async () => {
|
|
207
|
+
const entries = await fs.promises.readdir(new URL("./migrations", import.meta.url), {
|
|
208
|
+
withFileTypes: true,
|
|
209
|
+
});
|
|
210
|
+
const violations = [];
|
|
211
|
+
for (const entry of entries) {
|
|
212
|
+
if (!entry.isFile() || !entry.name.endsWith(".sql"))
|
|
213
|
+
continue;
|
|
214
|
+
const content = await fs.promises.readFile(new URL(`./migrations/${entry.name}`, import.meta.url), "utf8");
|
|
215
|
+
violations.push(...findUserVisibleUpdatedAtBackfillViolations(entry.name, content));
|
|
216
|
+
}
|
|
217
|
+
expect(violations).toEqual([]);
|
|
218
|
+
expect(findUserVisibleUpdatedAtBackfillViolations("9999_bad_backfill.sql", `
|
|
219
|
+
UPDATE "issues" AS i
|
|
220
|
+
SET "responsible_user_id" = 'owner-user',
|
|
221
|
+
"updated_at" = now()
|
|
222
|
+
WHERE i."responsible_user_id" IS NULL;
|
|
223
|
+
`)).toEqual(['9999_bad_backfill.sql: UPDATE "issues" sets updated_at']);
|
|
224
|
+
});
|
|
225
|
+
it("applies an inserted earlier migration without replaying later legacy migrations", async () => {
|
|
226
|
+
const connectionString = await createTempDatabase();
|
|
227
|
+
await applyPendingMigrations(connectionString);
|
|
228
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
229
|
+
try {
|
|
230
|
+
const richMagnetoHash = await migrationHash("0030_rich_magneto.sql");
|
|
231
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${richMagnetoHash}'`);
|
|
232
|
+
await sql.unsafe(`DROP TABLE "company_logos"`);
|
|
233
|
+
}
|
|
234
|
+
finally {
|
|
235
|
+
await sql.end();
|
|
236
|
+
}
|
|
237
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
238
|
+
expect(pendingState).toMatchObject({
|
|
239
|
+
status: "needsMigrations",
|
|
240
|
+
pendingMigrations: ["0030_rich_magneto.sql"],
|
|
241
|
+
reason: "pending-migrations",
|
|
242
|
+
});
|
|
243
|
+
await applyPendingMigrations(connectionString);
|
|
244
|
+
const finalState = await inspectMigrations(connectionString);
|
|
245
|
+
expect(finalState.status).toBe("upToDate");
|
|
246
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
247
|
+
try {
|
|
248
|
+
const rows = await verifySql.unsafe(`
|
|
249
|
+
SELECT table_name
|
|
250
|
+
FROM information_schema.tables
|
|
251
|
+
WHERE table_schema = 'public'
|
|
252
|
+
AND table_name IN ('company_logos', 'execution_workspaces')
|
|
253
|
+
ORDER BY table_name
|
|
254
|
+
`);
|
|
255
|
+
expect(rows.map((row) => row.table_name)).toEqual([
|
|
256
|
+
"company_logos",
|
|
257
|
+
"execution_workspaces",
|
|
258
|
+
]);
|
|
259
|
+
}
|
|
260
|
+
finally {
|
|
261
|
+
await verifySql.end();
|
|
262
|
+
}
|
|
263
|
+
}, 20_000);
|
|
264
|
+
it("replays migration 0044 safely when its schema changes already exist", async () => {
|
|
265
|
+
const connectionString = await createTempDatabase();
|
|
266
|
+
await applyPendingMigrations(connectionString);
|
|
267
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
268
|
+
try {
|
|
269
|
+
const illegalToadHash = await migrationHash("0044_illegal_toad.sql");
|
|
270
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${illegalToadHash}'`);
|
|
271
|
+
const columns = await sql.unsafe(`
|
|
272
|
+
SELECT column_name
|
|
273
|
+
FROM information_schema.columns
|
|
274
|
+
WHERE table_schema = 'public'
|
|
275
|
+
AND table_name = 'instance_settings'
|
|
276
|
+
AND column_name = 'general'
|
|
277
|
+
`);
|
|
278
|
+
expect(columns).toHaveLength(1);
|
|
279
|
+
}
|
|
280
|
+
finally {
|
|
281
|
+
await sql.end();
|
|
282
|
+
}
|
|
283
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
284
|
+
expect(pendingState).toMatchObject({
|
|
285
|
+
status: "needsMigrations",
|
|
286
|
+
pendingMigrations: ["0044_illegal_toad.sql"],
|
|
287
|
+
reason: "pending-migrations",
|
|
288
|
+
});
|
|
289
|
+
await applyPendingMigrations(connectionString);
|
|
290
|
+
const finalState = await inspectMigrations(connectionString);
|
|
291
|
+
expect(finalState.status).toBe("upToDate");
|
|
292
|
+
}, 20_000);
|
|
293
|
+
it("enforces a unique board_api_keys.key_hash after migration 0044", async () => {
|
|
294
|
+
const connectionString = await createTempDatabase();
|
|
295
|
+
await applyPendingMigrations(connectionString);
|
|
296
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
297
|
+
try {
|
|
298
|
+
await sql.unsafe(`
|
|
299
|
+
INSERT INTO "user" ("id", "name", "email", "email_verified", "created_at", "updated_at")
|
|
300
|
+
VALUES ('user-1', 'User One', 'user@example.com', true, now(), now())
|
|
301
|
+
`);
|
|
302
|
+
await sql.unsafe(`
|
|
303
|
+
INSERT INTO "board_api_keys" ("id", "user_id", "name", "key_hash", "created_at")
|
|
304
|
+
VALUES ('00000000-0000-0000-0000-000000000001', 'user-1', 'Key One', 'dup-hash', now())
|
|
305
|
+
`);
|
|
306
|
+
await expect(sql.unsafe(`
|
|
307
|
+
INSERT INTO "board_api_keys" ("id", "user_id", "name", "key_hash", "created_at")
|
|
308
|
+
VALUES ('00000000-0000-0000-0000-000000000002', 'user-1', 'Key Two', 'dup-hash', now())
|
|
309
|
+
`)).rejects.toThrow();
|
|
310
|
+
}
|
|
311
|
+
finally {
|
|
312
|
+
await sql.end();
|
|
313
|
+
}
|
|
314
|
+
}, 20_000);
|
|
315
|
+
it("replays migration 0046 safely when document revision columns already exist", async () => {
|
|
316
|
+
const connectionString = await createTempDatabase();
|
|
317
|
+
await applyPendingMigrations(connectionString);
|
|
318
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
319
|
+
try {
|
|
320
|
+
const smoothSentinelsHash = await migrationHash("0046_smooth_sentinels.sql");
|
|
321
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${smoothSentinelsHash}'`);
|
|
322
|
+
const columns = await sql.unsafe(`
|
|
323
|
+
SELECT column_name, is_nullable, column_default
|
|
324
|
+
FROM information_schema.columns
|
|
325
|
+
WHERE table_schema = 'public'
|
|
326
|
+
AND table_name = 'document_revisions'
|
|
327
|
+
AND column_name IN ('title', 'format')
|
|
328
|
+
ORDER BY column_name
|
|
329
|
+
`);
|
|
330
|
+
expect(columns).toHaveLength(2);
|
|
331
|
+
}
|
|
332
|
+
finally {
|
|
333
|
+
await sql.end();
|
|
334
|
+
}
|
|
335
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
336
|
+
expect(pendingState).toMatchObject({
|
|
337
|
+
status: "needsMigrations",
|
|
338
|
+
pendingMigrations: ["0046_smooth_sentinels.sql"],
|
|
339
|
+
reason: "pending-migrations",
|
|
340
|
+
});
|
|
341
|
+
await applyPendingMigrations(connectionString);
|
|
342
|
+
const finalState = await inspectMigrations(connectionString);
|
|
343
|
+
expect(finalState.status).toBe("upToDate");
|
|
344
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
345
|
+
try {
|
|
346
|
+
const columns = await verifySql.unsafe(`
|
|
347
|
+
SELECT column_name, is_nullable, column_default
|
|
348
|
+
FROM information_schema.columns
|
|
349
|
+
WHERE table_schema = 'public'
|
|
350
|
+
AND table_name = 'document_revisions'
|
|
351
|
+
AND column_name IN ('title', 'format')
|
|
352
|
+
ORDER BY column_name
|
|
353
|
+
`);
|
|
354
|
+
expect(columns).toEqual([
|
|
355
|
+
expect.objectContaining({
|
|
356
|
+
column_name: "format",
|
|
357
|
+
is_nullable: "NO",
|
|
358
|
+
}),
|
|
359
|
+
expect.objectContaining({
|
|
360
|
+
column_name: "title",
|
|
361
|
+
is_nullable: "YES",
|
|
362
|
+
}),
|
|
363
|
+
]);
|
|
364
|
+
expect(columns[0]?.column_default).toContain("'markdown'");
|
|
365
|
+
}
|
|
366
|
+
finally {
|
|
367
|
+
await verifySql.end();
|
|
368
|
+
}
|
|
369
|
+
}, 20_000);
|
|
370
|
+
it("replays migration 0047 safely when feedback tables and run columns already exist", async () => {
|
|
371
|
+
const connectionString = await createTempDatabase();
|
|
372
|
+
await applyPendingMigrations(connectionString);
|
|
373
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
374
|
+
try {
|
|
375
|
+
const overjoyedGrootHash = await migrationHash("0047_overjoyed_groot.sql");
|
|
376
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${overjoyedGrootHash}'`);
|
|
377
|
+
const tables = await sql.unsafe(`
|
|
378
|
+
SELECT table_name
|
|
379
|
+
FROM information_schema.tables
|
|
380
|
+
WHERE table_schema = 'public'
|
|
381
|
+
AND table_name IN ('feedback_exports', 'feedback_votes')
|
|
382
|
+
ORDER BY table_name
|
|
383
|
+
`);
|
|
384
|
+
expect(tables.map((row) => row.table_name)).toEqual([
|
|
385
|
+
"feedback_exports",
|
|
386
|
+
"feedback_votes",
|
|
387
|
+
]);
|
|
388
|
+
const columns = await sql.unsafe(`
|
|
389
|
+
SELECT table_name, column_name
|
|
390
|
+
FROM information_schema.columns
|
|
391
|
+
WHERE table_schema = 'public'
|
|
392
|
+
AND (
|
|
393
|
+
(table_name = 'companies' AND column_name IN (
|
|
394
|
+
'feedback_data_sharing_enabled',
|
|
395
|
+
'feedback_data_sharing_consent_at',
|
|
396
|
+
'feedback_data_sharing_consent_by_user_id',
|
|
397
|
+
'feedback_data_sharing_terms_version'
|
|
398
|
+
))
|
|
399
|
+
OR (table_name = 'document_revisions' AND column_name = 'created_by_run_id')
|
|
400
|
+
OR (table_name = 'issue_comments' AND column_name = 'created_by_run_id')
|
|
401
|
+
)
|
|
402
|
+
ORDER BY table_name, column_name
|
|
403
|
+
`);
|
|
404
|
+
expect(columns).toHaveLength(6);
|
|
405
|
+
}
|
|
406
|
+
finally {
|
|
407
|
+
await sql.end();
|
|
408
|
+
}
|
|
409
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
410
|
+
expect(pendingState).toMatchObject({
|
|
411
|
+
status: "needsMigrations",
|
|
412
|
+
pendingMigrations: ["0047_overjoyed_groot.sql"],
|
|
413
|
+
reason: "pending-migrations",
|
|
414
|
+
});
|
|
415
|
+
await applyPendingMigrations(connectionString);
|
|
416
|
+
const finalState = await inspectMigrations(connectionString);
|
|
417
|
+
expect(finalState.status).toBe("upToDate");
|
|
418
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
419
|
+
try {
|
|
420
|
+
const constraints = await verifySql.unsafe(`
|
|
421
|
+
SELECT conname
|
|
422
|
+
FROM pg_constraint
|
|
423
|
+
WHERE conname IN (
|
|
424
|
+
'feedback_exports_company_id_companies_id_fk',
|
|
425
|
+
'feedback_exports_feedback_vote_id_feedback_votes_id_fk',
|
|
426
|
+
'feedback_exports_issue_id_issues_id_fk',
|
|
427
|
+
'feedback_votes_company_id_companies_id_fk',
|
|
428
|
+
'feedback_votes_issue_id_issues_id_fk'
|
|
429
|
+
)
|
|
430
|
+
ORDER BY conname
|
|
431
|
+
`);
|
|
432
|
+
expect(constraints.map((row) => row.conname)).toEqual([
|
|
433
|
+
"feedback_exports_company_id_companies_id_fk",
|
|
434
|
+
"feedback_exports_feedback_vote_id_feedback_votes_id_fk",
|
|
435
|
+
"feedback_exports_issue_id_issues_id_fk",
|
|
436
|
+
"feedback_votes_company_id_companies_id_fk",
|
|
437
|
+
"feedback_votes_issue_id_issues_id_fk",
|
|
438
|
+
]);
|
|
439
|
+
}
|
|
440
|
+
finally {
|
|
441
|
+
await verifySql.end();
|
|
442
|
+
}
|
|
443
|
+
}, 20_000);
|
|
444
|
+
it("replays migration 0048 safely when routines.variables already exists", async () => {
|
|
445
|
+
const connectionString = await createTempDatabase();
|
|
446
|
+
await applyPendingMigrations(connectionString);
|
|
447
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
448
|
+
try {
|
|
449
|
+
const flashyMarrowHash = await migrationHash("0048_flashy_marrow.sql");
|
|
450
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${flashyMarrowHash}'`);
|
|
451
|
+
const columns = await sql.unsafe(`
|
|
452
|
+
SELECT column_name
|
|
453
|
+
FROM information_schema.columns
|
|
454
|
+
WHERE table_schema = 'public'
|
|
455
|
+
AND table_name = 'routines'
|
|
456
|
+
AND column_name = 'variables'
|
|
457
|
+
`);
|
|
458
|
+
expect(columns).toHaveLength(1);
|
|
459
|
+
}
|
|
460
|
+
finally {
|
|
461
|
+
await sql.end();
|
|
462
|
+
}
|
|
463
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
464
|
+
expect(pendingState).toMatchObject({
|
|
465
|
+
status: "needsMigrations",
|
|
466
|
+
pendingMigrations: ["0048_flashy_marrow.sql"],
|
|
467
|
+
reason: "pending-migrations",
|
|
468
|
+
});
|
|
469
|
+
await applyPendingMigrations(connectionString);
|
|
470
|
+
const finalState = await inspectMigrations(connectionString);
|
|
471
|
+
expect(finalState.status).toBe("upToDate");
|
|
472
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
473
|
+
try {
|
|
474
|
+
const columns = await verifySql.unsafe(`
|
|
475
|
+
SELECT column_name, is_nullable, data_type
|
|
476
|
+
FROM information_schema.columns
|
|
477
|
+
WHERE table_schema = 'public'
|
|
478
|
+
AND table_name = 'routines'
|
|
479
|
+
AND column_name = 'variables'
|
|
480
|
+
`);
|
|
481
|
+
expect(columns).toEqual([
|
|
482
|
+
expect.objectContaining({
|
|
483
|
+
column_name: "variables",
|
|
484
|
+
is_nullable: "NO",
|
|
485
|
+
data_type: "jsonb",
|
|
486
|
+
}),
|
|
487
|
+
]);
|
|
488
|
+
}
|
|
489
|
+
finally {
|
|
490
|
+
await verifySql.end();
|
|
491
|
+
}
|
|
492
|
+
}, 20_000);
|
|
493
|
+
it("replays migration 0050 safely when projects.env already exists", async () => {
|
|
494
|
+
const connectionString = await createTempDatabase();
|
|
495
|
+
await applyPendingMigrations(connectionString);
|
|
496
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
497
|
+
try {
|
|
498
|
+
const stiffLuckmanHash = await migrationHash("0050_stiff_luckman.sql");
|
|
499
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${stiffLuckmanHash}'`);
|
|
500
|
+
const columns = await sql.unsafe(`
|
|
501
|
+
SELECT column_name
|
|
502
|
+
FROM information_schema.columns
|
|
503
|
+
WHERE table_schema = 'public'
|
|
504
|
+
AND table_name = 'projects'
|
|
505
|
+
AND column_name = 'env'
|
|
506
|
+
`);
|
|
507
|
+
expect(columns).toHaveLength(1);
|
|
508
|
+
}
|
|
509
|
+
finally {
|
|
510
|
+
await sql.end();
|
|
511
|
+
}
|
|
512
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
513
|
+
expect(pendingState).toMatchObject({
|
|
514
|
+
status: "needsMigrations",
|
|
515
|
+
pendingMigrations: ["0050_stiff_luckman.sql"],
|
|
516
|
+
reason: "pending-migrations",
|
|
517
|
+
});
|
|
518
|
+
await applyPendingMigrations(connectionString);
|
|
519
|
+
const finalState = await inspectMigrations(connectionString);
|
|
520
|
+
expect(finalState.status).toBe("upToDate");
|
|
521
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
522
|
+
try {
|
|
523
|
+
const columns = await verifySql.unsafe(`
|
|
524
|
+
SELECT column_name, is_nullable, data_type
|
|
525
|
+
FROM information_schema.columns
|
|
526
|
+
WHERE table_schema = 'public'
|
|
527
|
+
AND table_name = 'projects'
|
|
528
|
+
AND column_name = 'env'
|
|
529
|
+
`);
|
|
530
|
+
expect(columns).toEqual([
|
|
531
|
+
expect.objectContaining({
|
|
532
|
+
column_name: "env",
|
|
533
|
+
is_nullable: "YES",
|
|
534
|
+
data_type: "jsonb",
|
|
535
|
+
}),
|
|
536
|
+
]);
|
|
537
|
+
}
|
|
538
|
+
finally {
|
|
539
|
+
await verifySql.end();
|
|
540
|
+
}
|
|
541
|
+
}, 20_000);
|
|
542
|
+
it("replays migration 0059 safely when plugin_database_namespaces already exists", async () => {
|
|
543
|
+
const connectionString = await createTempDatabase();
|
|
544
|
+
await applyPendingMigrations(connectionString);
|
|
545
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
546
|
+
try {
|
|
547
|
+
const pluginNamespacesHash = await migrationHash("0059_plugin_database_namespaces.sql");
|
|
548
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${pluginNamespacesHash}'`);
|
|
549
|
+
const tables = await sql.unsafe(`
|
|
550
|
+
SELECT table_name
|
|
551
|
+
FROM information_schema.tables
|
|
552
|
+
WHERE table_schema = 'public'
|
|
553
|
+
AND table_name IN ('plugin_database_namespaces', 'plugin_migrations')
|
|
554
|
+
ORDER BY table_name
|
|
555
|
+
`);
|
|
556
|
+
expect(tables.map((row) => row.table_name)).toEqual([
|
|
557
|
+
"plugin_database_namespaces",
|
|
558
|
+
"plugin_migrations",
|
|
559
|
+
]);
|
|
560
|
+
}
|
|
561
|
+
finally {
|
|
562
|
+
await sql.end();
|
|
563
|
+
}
|
|
564
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
565
|
+
expect(pendingState).toMatchObject({
|
|
566
|
+
status: "needsMigrations",
|
|
567
|
+
pendingMigrations: ["0059_plugin_database_namespaces.sql"],
|
|
568
|
+
reason: "pending-migrations",
|
|
569
|
+
});
|
|
570
|
+
await applyPendingMigrations(connectionString);
|
|
571
|
+
const finalState = await inspectMigrations(connectionString);
|
|
572
|
+
expect(finalState.status).toBe("upToDate");
|
|
573
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
574
|
+
try {
|
|
575
|
+
const indexes = await verifySql.unsafe(`
|
|
576
|
+
SELECT indexname
|
|
577
|
+
FROM pg_indexes
|
|
578
|
+
WHERE schemaname = 'public'
|
|
579
|
+
AND tablename IN ('plugin_database_namespaces', 'plugin_migrations')
|
|
580
|
+
ORDER BY indexname
|
|
581
|
+
`);
|
|
582
|
+
expect(indexes.map((row) => row.indexname)).toEqual(expect.arrayContaining([
|
|
583
|
+
"plugin_database_namespaces_namespace_idx",
|
|
584
|
+
"plugin_database_namespaces_plugin_idx",
|
|
585
|
+
"plugin_database_namespaces_status_idx",
|
|
586
|
+
"plugin_migrations_plugin_idx",
|
|
587
|
+
"plugin_migrations_plugin_key_idx",
|
|
588
|
+
"plugin_migrations_status_idx",
|
|
589
|
+
]));
|
|
590
|
+
}
|
|
591
|
+
finally {
|
|
592
|
+
await verifySql.end();
|
|
593
|
+
}
|
|
594
|
+
}, 20_000);
|
|
595
|
+
it("replays the built-in managed resources migration after the legacy 0136 journal entry", async () => {
|
|
596
|
+
const connectionString = await createTempDatabase();
|
|
597
|
+
await applyPendingMigrations(connectionString);
|
|
598
|
+
const builtInResourcesHash = await migrationHash("0140_built_in_managed_resources.sql");
|
|
599
|
+
const legacyBuiltInResourcesHash = createHash("sha256")
|
|
600
|
+
.update("legacy 0136_built_in_managed_resources.sql")
|
|
601
|
+
.digest("hex");
|
|
602
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
603
|
+
try {
|
|
604
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${builtInResourcesHash}'`);
|
|
605
|
+
await sql.unsafe(`
|
|
606
|
+
INSERT INTO "drizzle"."__drizzle_migrations" ("hash", "created_at")
|
|
607
|
+
VALUES ('${legacyBuiltInResourcesHash}', 1783555200000)
|
|
608
|
+
`);
|
|
609
|
+
await sql.unsafe(`
|
|
610
|
+
ALTER TABLE "built_in_managed_resources"
|
|
611
|
+
DROP CONSTRAINT IF EXISTS "built_in_managed_resources_company_id_companies_id_fk"
|
|
612
|
+
`);
|
|
613
|
+
await sql.unsafe(`DROP INDEX IF EXISTS "built_in_managed_resources_company_idx"`);
|
|
614
|
+
await sql.unsafe(`DROP INDEX IF EXISTS "built_in_managed_resources_resource_idx"`);
|
|
615
|
+
await sql.unsafe(`DROP INDEX IF EXISTS "built_in_managed_resources_company_bundle_resource_uq"`);
|
|
616
|
+
}
|
|
617
|
+
finally {
|
|
618
|
+
await sql.end();
|
|
619
|
+
}
|
|
620
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
621
|
+
expect(pendingState).toMatchObject({
|
|
622
|
+
status: "needsMigrations",
|
|
623
|
+
pendingMigrations: ["0140_built_in_managed_resources.sql"],
|
|
624
|
+
reason: "pending-migrations",
|
|
625
|
+
});
|
|
626
|
+
await applyPendingMigrations(connectionString);
|
|
627
|
+
const finalState = await inspectMigrations(connectionString);
|
|
628
|
+
expect(finalState.status).toBe("upToDate");
|
|
629
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
630
|
+
try {
|
|
631
|
+
const rows = await verifySql.unsafe(`
|
|
632
|
+
SELECT
|
|
633
|
+
EXISTS (
|
|
634
|
+
SELECT 1
|
|
635
|
+
FROM "pg_constraint" c
|
|
636
|
+
JOIN "pg_class" t ON t.oid = c.conrelid
|
|
637
|
+
JOIN "pg_namespace" n ON n.oid = t.relnamespace
|
|
638
|
+
WHERE n.nspname = 'public'
|
|
639
|
+
AND t.relname = 'built_in_managed_resources'
|
|
640
|
+
AND c.conname = 'built_in_managed_resources_company_id_companies_id_fk'
|
|
641
|
+
) AS "foreign_key_exists",
|
|
642
|
+
EXISTS (
|
|
643
|
+
SELECT 1
|
|
644
|
+
FROM "pg_class" c
|
|
645
|
+
JOIN "pg_namespace" n ON n.oid = c.relnamespace
|
|
646
|
+
WHERE n.nspname = 'public'
|
|
647
|
+
AND c.relkind = 'i'
|
|
648
|
+
AND c.relname = 'built_in_managed_resources_company_idx'
|
|
649
|
+
) AS "company_index_exists",
|
|
650
|
+
EXISTS (
|
|
651
|
+
SELECT 1
|
|
652
|
+
FROM "pg_class" c
|
|
653
|
+
JOIN "pg_namespace" n ON n.oid = c.relnamespace
|
|
654
|
+
WHERE n.nspname = 'public'
|
|
655
|
+
AND c.relkind = 'i'
|
|
656
|
+
AND c.relname = 'built_in_managed_resources_resource_idx'
|
|
657
|
+
) AS "resource_index_exists",
|
|
658
|
+
EXISTS (
|
|
659
|
+
SELECT 1
|
|
660
|
+
FROM "pg_class" c
|
|
661
|
+
JOIN "pg_namespace" n ON n.oid = c.relnamespace
|
|
662
|
+
WHERE n.nspname = 'public'
|
|
663
|
+
AND c.relkind = 'i'
|
|
664
|
+
AND c.relname = 'built_in_managed_resources_company_bundle_resource_uq'
|
|
665
|
+
) AS "unique_index_exists"
|
|
666
|
+
`);
|
|
667
|
+
expect(rows[0]).toEqual({
|
|
668
|
+
foreign_key_exists: true,
|
|
669
|
+
company_index_exists: true,
|
|
670
|
+
resource_index_exists: true,
|
|
671
|
+
unique_index_exists: true,
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
finally {
|
|
675
|
+
await verifySql.end();
|
|
676
|
+
}
|
|
677
|
+
}, 20_000);
|
|
678
|
+
it("replays migration 0134 without bumping issue updated_at for inbox archives", async () => {
|
|
679
|
+
const connectionString = await createTempDatabase();
|
|
680
|
+
await applyPendingMigrations(connectionString);
|
|
681
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
682
|
+
try {
|
|
683
|
+
const runResponsibleUserHash = await migrationHash("0134_run_responsible_user_invariant.sql");
|
|
684
|
+
await sql.unsafe(`
|
|
685
|
+
INSERT INTO "companies" ("id", "name", "issue_prefix", "created_at", "updated_at")
|
|
686
|
+
VALUES (
|
|
687
|
+
'00000000-0000-0000-0000-000000000120',
|
|
688
|
+
'Migration Inbox Co',
|
|
689
|
+
'TST120',
|
|
690
|
+
'2026-03-26T09:00:00.000Z',
|
|
691
|
+
'2026-03-26T09:00:00.000Z'
|
|
692
|
+
)
|
|
693
|
+
`);
|
|
694
|
+
await sql.unsafe(`
|
|
695
|
+
INSERT INTO "company_memberships" (
|
|
696
|
+
"id",
|
|
697
|
+
"company_id",
|
|
698
|
+
"principal_type",
|
|
699
|
+
"principal_id",
|
|
700
|
+
"status",
|
|
701
|
+
"membership_role",
|
|
702
|
+
"created_at",
|
|
703
|
+
"updated_at"
|
|
704
|
+
)
|
|
705
|
+
VALUES (
|
|
706
|
+
'00000000-0000-0000-0000-000000000121',
|
|
707
|
+
'00000000-0000-0000-0000-000000000120',
|
|
708
|
+
'user',
|
|
709
|
+
'owner-user',
|
|
710
|
+
'active',
|
|
711
|
+
'owner',
|
|
712
|
+
'2026-03-26T09:00:00.000Z',
|
|
713
|
+
'2026-03-26T09:00:00.000Z'
|
|
714
|
+
)
|
|
715
|
+
`);
|
|
716
|
+
await sql.unsafe(`
|
|
717
|
+
INSERT INTO "issues" (
|
|
718
|
+
"id",
|
|
719
|
+
"company_id",
|
|
720
|
+
"title",
|
|
721
|
+
"status",
|
|
722
|
+
"responsible_user_id",
|
|
723
|
+
"created_at",
|
|
724
|
+
"updated_at"
|
|
725
|
+
)
|
|
726
|
+
VALUES (
|
|
727
|
+
'00000000-0000-0000-0000-000000000122',
|
|
728
|
+
'00000000-0000-0000-0000-000000000120',
|
|
729
|
+
'Archived issue needing responsible user backfill',
|
|
730
|
+
'todo',
|
|
731
|
+
NULL,
|
|
732
|
+
'2026-03-26T10:00:00.000Z',
|
|
733
|
+
'2026-03-26T10:00:00.000Z'
|
|
734
|
+
)
|
|
735
|
+
`);
|
|
736
|
+
await sql.unsafe(`
|
|
737
|
+
INSERT INTO "issue_inbox_archives" (
|
|
738
|
+
"id",
|
|
739
|
+
"company_id",
|
|
740
|
+
"issue_id",
|
|
741
|
+
"user_id",
|
|
742
|
+
"archived_at",
|
|
743
|
+
"created_at",
|
|
744
|
+
"updated_at"
|
|
745
|
+
)
|
|
746
|
+
VALUES (
|
|
747
|
+
'00000000-0000-0000-0000-000000000123',
|
|
748
|
+
'00000000-0000-0000-0000-000000000120',
|
|
749
|
+
'00000000-0000-0000-0000-000000000122',
|
|
750
|
+
'owner-user',
|
|
751
|
+
'2026-03-26T12:00:00.000Z',
|
|
752
|
+
'2026-03-26T12:00:00.000Z',
|
|
753
|
+
'2026-03-26T12:00:00.000Z'
|
|
754
|
+
)
|
|
755
|
+
`);
|
|
756
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${runResponsibleUserHash}'`);
|
|
757
|
+
}
|
|
758
|
+
finally {
|
|
759
|
+
await sql.end();
|
|
760
|
+
}
|
|
761
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
762
|
+
expect(pendingState).toMatchObject({
|
|
763
|
+
status: "needsMigrations",
|
|
764
|
+
pendingMigrations: ["0134_run_responsible_user_invariant.sql"],
|
|
765
|
+
reason: "pending-migrations",
|
|
766
|
+
});
|
|
767
|
+
await applyPendingMigrations(connectionString);
|
|
768
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
769
|
+
try {
|
|
770
|
+
const rows = await verifySql.unsafe(`
|
|
771
|
+
SELECT
|
|
772
|
+
i."responsible_user_id",
|
|
773
|
+
i."updated_at",
|
|
774
|
+
EXISTS (
|
|
775
|
+
SELECT 1
|
|
776
|
+
FROM "issue_inbox_archives" AS archive
|
|
777
|
+
WHERE archive."company_id" = i."company_id"
|
|
778
|
+
AND archive."issue_id" = i."id"
|
|
779
|
+
AND archive."user_id" = 'owner-user'
|
|
780
|
+
AND archive."archived_at" >= i."updated_at"
|
|
781
|
+
) AS "inbox_archive_still_current"
|
|
782
|
+
FROM "issues" AS i
|
|
783
|
+
WHERE i."id" = '00000000-0000-0000-0000-000000000122'
|
|
784
|
+
`);
|
|
785
|
+
expect(rows).toHaveLength(1);
|
|
786
|
+
expect(rows[0]?.responsible_user_id).toBe("owner-user");
|
|
787
|
+
expect(rows[0]?.updated_at.toISOString()).toBe("2026-03-26T10:00:00.000Z");
|
|
788
|
+
expect(rows[0]?.inbox_archive_still_current).toBe(true);
|
|
789
|
+
}
|
|
790
|
+
finally {
|
|
791
|
+
await verifySql.end();
|
|
792
|
+
}
|
|
793
|
+
}, 20_000);
|
|
794
|
+
it("replays migration 0135 to repair updated_at sweeps and no-op when clean", async () => {
|
|
795
|
+
const connectionString = await createTempDatabase();
|
|
796
|
+
await applyPendingMigrations(connectionString);
|
|
797
|
+
const repairSweepHash = await migrationHash("0135_repair_run_responsible_user_updated_at_sweep.sql");
|
|
798
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
799
|
+
try {
|
|
800
|
+
await sql.unsafe(`
|
|
801
|
+
INSERT INTO "companies" ("id", "name", "issue_prefix", "created_at", "updated_at")
|
|
802
|
+
VALUES (
|
|
803
|
+
'00000000-0000-0000-0000-000000000240',
|
|
804
|
+
'Clean Migration Co',
|
|
805
|
+
'CLN134',
|
|
806
|
+
'2026-04-01T09:00:00.000Z',
|
|
807
|
+
'2026-04-02T09:00:00.000Z'
|
|
808
|
+
)
|
|
809
|
+
`);
|
|
810
|
+
await sql.unsafe(`
|
|
811
|
+
INSERT INTO "issues" ("id", "company_id", "title", "status", "created_at", "updated_at")
|
|
812
|
+
VALUES (
|
|
813
|
+
'00000000-0000-0000-0000-000000000241',
|
|
814
|
+
'00000000-0000-0000-0000-000000000240',
|
|
815
|
+
'Clean issue should not be touched',
|
|
816
|
+
'todo',
|
|
817
|
+
'2026-04-01T10:00:00.000Z',
|
|
818
|
+
'2026-04-02T10:00:00.000Z'
|
|
819
|
+
)
|
|
820
|
+
`);
|
|
821
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${repairSweepHash}'`);
|
|
822
|
+
}
|
|
823
|
+
finally {
|
|
824
|
+
await sql.end();
|
|
825
|
+
}
|
|
826
|
+
await applyPendingMigrations(connectionString);
|
|
827
|
+
const afterCleanReplay = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
828
|
+
try {
|
|
829
|
+
const cleanRows = await afterCleanReplay.unsafe(`
|
|
830
|
+
SELECT "updated_at"
|
|
831
|
+
FROM "issues"
|
|
832
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000241'
|
|
833
|
+
`);
|
|
834
|
+
expect(cleanRows[0]?.updated_at.toISOString()).toBe("2026-04-02T10:00:00.000Z");
|
|
835
|
+
await afterCleanReplay.unsafe(`
|
|
836
|
+
INSERT INTO "companies" ("id", "name", "issue_prefix", "created_at", "updated_at")
|
|
837
|
+
VALUES (
|
|
838
|
+
'00000000-0000-0000-0000-000000000250',
|
|
839
|
+
'Sweep Migration Co',
|
|
840
|
+
'SWP134',
|
|
841
|
+
'2026-01-01T00:00:00.000Z',
|
|
842
|
+
'2026-04-03T12:00:00.123456Z'
|
|
843
|
+
)
|
|
844
|
+
`);
|
|
845
|
+
await afterCleanReplay.unsafe(`
|
|
846
|
+
INSERT INTO "agents" ("id", "company_id", "name", "role", "adapter_type", "created_at", "updated_at")
|
|
847
|
+
VALUES (
|
|
848
|
+
'00000000-0000-0000-0000-000000000251',
|
|
849
|
+
'00000000-0000-0000-0000-000000000250',
|
|
850
|
+
'Sweep Agent',
|
|
851
|
+
'general',
|
|
852
|
+
'process',
|
|
853
|
+
'2026-01-02T00:00:00.000Z',
|
|
854
|
+
'2026-01-02T00:00:00.000Z'
|
|
855
|
+
)
|
|
856
|
+
`);
|
|
857
|
+
await afterCleanReplay.unsafe(`
|
|
858
|
+
INSERT INTO "issues" ("id", "company_id", "title", "status", "created_at", "updated_at")
|
|
859
|
+
SELECT
|
|
860
|
+
('10000000-0000-0000-0000-' || lpad(gs::text, 12, '0'))::uuid,
|
|
861
|
+
'00000000-0000-0000-0000-000000000250',
|
|
862
|
+
'Swept issue ' || gs::text,
|
|
863
|
+
'todo',
|
|
864
|
+
'2026-02-01T00:00:00.000Z'::timestamptz + (gs::text || ' minutes')::interval,
|
|
865
|
+
'2026-04-03T12:00:00.123456Z'
|
|
866
|
+
FROM generate_series(1, 101) AS gs
|
|
867
|
+
`);
|
|
868
|
+
await afterCleanReplay.unsafe(`
|
|
869
|
+
UPDATE "issues"
|
|
870
|
+
SET
|
|
871
|
+
"status" = 'done',
|
|
872
|
+
"completed_at" = '2026-04-03T12:00:00.123456Z'
|
|
873
|
+
WHERE "id" = '10000000-0000-0000-0000-000000000003'
|
|
874
|
+
`);
|
|
875
|
+
await afterCleanReplay.unsafe(`
|
|
876
|
+
INSERT INTO "issue_comments" ("id", "company_id", "issue_id", "body", "created_at", "updated_at")
|
|
877
|
+
VALUES (
|
|
878
|
+
'00000000-0000-0000-0000-000000000252',
|
|
879
|
+
'00000000-0000-0000-0000-000000000250',
|
|
880
|
+
'10000000-0000-0000-0000-000000000001',
|
|
881
|
+
'Latest pre-sweep activity',
|
|
882
|
+
'2026-03-01T15:30:00.000Z',
|
|
883
|
+
'2026-03-02T16:45:00.000Z'
|
|
884
|
+
)
|
|
885
|
+
`);
|
|
886
|
+
await afterCleanReplay.unsafe(`
|
|
887
|
+
INSERT INTO "heartbeat_runs" (
|
|
888
|
+
"id",
|
|
889
|
+
"company_id",
|
|
890
|
+
"agent_id",
|
|
891
|
+
"status",
|
|
892
|
+
"started_at",
|
|
893
|
+
"finished_at",
|
|
894
|
+
"created_at",
|
|
895
|
+
"updated_at"
|
|
896
|
+
)
|
|
897
|
+
VALUES (
|
|
898
|
+
'00000000-0000-0000-0000-000000000253',
|
|
899
|
+
'00000000-0000-0000-0000-000000000250',
|
|
900
|
+
'00000000-0000-0000-0000-000000000251',
|
|
901
|
+
'completed',
|
|
902
|
+
'2026-02-10T10:00:00.000Z',
|
|
903
|
+
'2026-02-10T10:30:00.000Z',
|
|
904
|
+
'2026-02-10T09:55:00.000Z',
|
|
905
|
+
'2026-04-03T12:00:00.123456Z'
|
|
906
|
+
)
|
|
907
|
+
`);
|
|
908
|
+
await afterCleanReplay.unsafe(`
|
|
909
|
+
INSERT INTO "heartbeat_runs" (
|
|
910
|
+
"id",
|
|
911
|
+
"company_id",
|
|
912
|
+
"agent_id",
|
|
913
|
+
"status",
|
|
914
|
+
"started_at",
|
|
915
|
+
"last_output_at",
|
|
916
|
+
"created_at",
|
|
917
|
+
"updated_at"
|
|
918
|
+
)
|
|
919
|
+
VALUES (
|
|
920
|
+
'00000000-0000-0000-0000-000000000256',
|
|
921
|
+
'00000000-0000-0000-0000-000000000250',
|
|
922
|
+
'00000000-0000-0000-0000-000000000251',
|
|
923
|
+
'running',
|
|
924
|
+
'2026-02-10T11:00:00.000Z',
|
|
925
|
+
'2026-04-03T12:00:00.123456Z',
|
|
926
|
+
'2026-02-10T10:55:00.000Z',
|
|
927
|
+
'2026-04-03T12:00:00.123456Z'
|
|
928
|
+
)
|
|
929
|
+
`);
|
|
930
|
+
await afterCleanReplay.unsafe(`
|
|
931
|
+
INSERT INTO "routines" (
|
|
932
|
+
"id",
|
|
933
|
+
"company_id",
|
|
934
|
+
"title",
|
|
935
|
+
"last_triggered_at",
|
|
936
|
+
"last_enqueued_at",
|
|
937
|
+
"created_at",
|
|
938
|
+
"updated_at"
|
|
939
|
+
)
|
|
940
|
+
VALUES (
|
|
941
|
+
'00000000-0000-0000-0000-000000000254',
|
|
942
|
+
'00000000-0000-0000-0000-000000000250',
|
|
943
|
+
'Swept routine',
|
|
944
|
+
'2026-03-20T10:00:00.000Z',
|
|
945
|
+
'2026-03-21T11:00:00.000Z',
|
|
946
|
+
'2026-02-11T00:00:00.000Z',
|
|
947
|
+
'2026-04-03T12:00:00.123456Z'
|
|
948
|
+
)
|
|
949
|
+
`);
|
|
950
|
+
await afterCleanReplay.unsafe(`
|
|
951
|
+
INSERT INTO "routines" (
|
|
952
|
+
"id",
|
|
953
|
+
"company_id",
|
|
954
|
+
"title",
|
|
955
|
+
"last_triggered_at",
|
|
956
|
+
"last_enqueued_at",
|
|
957
|
+
"created_at",
|
|
958
|
+
"updated_at"
|
|
959
|
+
)
|
|
960
|
+
VALUES (
|
|
961
|
+
'00000000-0000-0000-0000-000000000257',
|
|
962
|
+
'00000000-0000-0000-0000-000000000250',
|
|
963
|
+
'Same-timestamp active routine',
|
|
964
|
+
'2026-03-20T10:00:00.000Z',
|
|
965
|
+
'2026-04-03T12:00:00.123456Z',
|
|
966
|
+
'2026-02-11T00:00:00.000Z',
|
|
967
|
+
'2026-04-03T12:00:00.123456Z'
|
|
968
|
+
)
|
|
969
|
+
`);
|
|
970
|
+
await afterCleanReplay.unsafe(`
|
|
971
|
+
INSERT INTO "routine_runs" (
|
|
972
|
+
"id",
|
|
973
|
+
"company_id",
|
|
974
|
+
"routine_id",
|
|
975
|
+
"source",
|
|
976
|
+
"status",
|
|
977
|
+
"completed_at",
|
|
978
|
+
"created_at",
|
|
979
|
+
"updated_at"
|
|
980
|
+
)
|
|
981
|
+
VALUES (
|
|
982
|
+
'00000000-0000-0000-0000-000000000255',
|
|
983
|
+
'00000000-0000-0000-0000-000000000250',
|
|
984
|
+
'00000000-0000-0000-0000-000000000254',
|
|
985
|
+
'schedule',
|
|
986
|
+
'completed',
|
|
987
|
+
'2026-02-12T12:00:00.000Z',
|
|
988
|
+
'2026-02-12T11:00:00.000Z',
|
|
989
|
+
'2026-04-03T12:00:00.123456Z'
|
|
990
|
+
)
|
|
991
|
+
`);
|
|
992
|
+
await afterCleanReplay.unsafe(`
|
|
993
|
+
INSERT INTO "routine_runs" (
|
|
994
|
+
"id",
|
|
995
|
+
"company_id",
|
|
996
|
+
"routine_id",
|
|
997
|
+
"source",
|
|
998
|
+
"status",
|
|
999
|
+
"triggered_at",
|
|
1000
|
+
"created_at",
|
|
1001
|
+
"updated_at"
|
|
1002
|
+
)
|
|
1003
|
+
VALUES (
|
|
1004
|
+
'00000000-0000-0000-0000-000000000258',
|
|
1005
|
+
'00000000-0000-0000-0000-000000000250',
|
|
1006
|
+
'00000000-0000-0000-0000-000000000257',
|
|
1007
|
+
'schedule',
|
|
1008
|
+
'running',
|
|
1009
|
+
'2026-04-03T12:00:00.123456Z',
|
|
1010
|
+
'2026-02-12T13:00:00.000Z',
|
|
1011
|
+
'2026-04-03T12:00:00.123456Z'
|
|
1012
|
+
)
|
|
1013
|
+
`);
|
|
1014
|
+
await afterCleanReplay.unsafe(`
|
|
1015
|
+
INSERT INTO "companies" ("id", "name", "issue_prefix", "created_at", "updated_at")
|
|
1016
|
+
VALUES (
|
|
1017
|
+
'00000000-0000-0000-0000-000000000260',
|
|
1018
|
+
'Coincident Timestamp Co',
|
|
1019
|
+
'CTS134',
|
|
1020
|
+
'2026-01-05T00:00:00.000Z',
|
|
1021
|
+
'2026-04-03T12:00:00.123456Z'
|
|
1022
|
+
)
|
|
1023
|
+
`);
|
|
1024
|
+
await afterCleanReplay.unsafe(`
|
|
1025
|
+
INSERT INTO "agents" ("id", "company_id", "name", "role", "adapter_type", "created_at", "updated_at")
|
|
1026
|
+
VALUES (
|
|
1027
|
+
'00000000-0000-0000-0000-000000000261',
|
|
1028
|
+
'00000000-0000-0000-0000-000000000260',
|
|
1029
|
+
'Coincident Agent',
|
|
1030
|
+
'general',
|
|
1031
|
+
'process',
|
|
1032
|
+
'2026-01-05T00:10:00.000Z',
|
|
1033
|
+
'2026-01-05T00:10:00.000Z'
|
|
1034
|
+
)
|
|
1035
|
+
`);
|
|
1036
|
+
await afterCleanReplay.unsafe(`
|
|
1037
|
+
INSERT INTO "issues" ("id", "company_id", "title", "status", "created_at", "updated_at")
|
|
1038
|
+
VALUES (
|
|
1039
|
+
'20000000-0000-0000-0000-000000000001',
|
|
1040
|
+
'00000000-0000-0000-0000-000000000260',
|
|
1041
|
+
'Coincident timestamp issue should not be touched',
|
|
1042
|
+
'todo',
|
|
1043
|
+
'2026-02-05T00:00:00.000Z',
|
|
1044
|
+
'2026-04-03T12:00:00.123456Z'
|
|
1045
|
+
)
|
|
1046
|
+
`);
|
|
1047
|
+
await afterCleanReplay.unsafe(`
|
|
1048
|
+
INSERT INTO "heartbeat_runs" (
|
|
1049
|
+
"id",
|
|
1050
|
+
"company_id",
|
|
1051
|
+
"agent_id",
|
|
1052
|
+
"status",
|
|
1053
|
+
"started_at",
|
|
1054
|
+
"finished_at",
|
|
1055
|
+
"created_at",
|
|
1056
|
+
"updated_at"
|
|
1057
|
+
)
|
|
1058
|
+
VALUES (
|
|
1059
|
+
'00000000-0000-0000-0000-000000000262',
|
|
1060
|
+
'00000000-0000-0000-0000-000000000260',
|
|
1061
|
+
'00000000-0000-0000-0000-000000000261',
|
|
1062
|
+
'completed',
|
|
1063
|
+
'2026-02-05T10:00:00.000Z',
|
|
1064
|
+
'2026-02-05T10:30:00.000Z',
|
|
1065
|
+
'2026-02-05T09:55:00.000Z',
|
|
1066
|
+
'2026-04-03T12:00:00.123456Z'
|
|
1067
|
+
)
|
|
1068
|
+
`);
|
|
1069
|
+
await afterCleanReplay.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${repairSweepHash}'`);
|
|
1070
|
+
}
|
|
1071
|
+
finally {
|
|
1072
|
+
await afterCleanReplay.end();
|
|
1073
|
+
}
|
|
1074
|
+
await applyPendingMigrations(connectionString);
|
|
1075
|
+
const afterRepair = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1076
|
+
try {
|
|
1077
|
+
const repairedRows = await afterRepair.unsafe(`
|
|
1078
|
+
SELECT 'company' AS subject, "updated_at"
|
|
1079
|
+
FROM "companies"
|
|
1080
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000250'
|
|
1081
|
+
UNION ALL
|
|
1082
|
+
SELECT 'issue_with_comment' AS subject, "updated_at"
|
|
1083
|
+
FROM "issues"
|
|
1084
|
+
WHERE "id" = '10000000-0000-0000-0000-000000000001'
|
|
1085
|
+
UNION ALL
|
|
1086
|
+
SELECT 'issue_without_comment' AS subject, "updated_at"
|
|
1087
|
+
FROM "issues"
|
|
1088
|
+
WHERE "id" = '10000000-0000-0000-0000-000000000002'
|
|
1089
|
+
UNION ALL
|
|
1090
|
+
SELECT 'issue_with_state_activity' AS subject, "updated_at"
|
|
1091
|
+
FROM "issues"
|
|
1092
|
+
WHERE "id" = '10000000-0000-0000-0000-000000000003'
|
|
1093
|
+
UNION ALL
|
|
1094
|
+
SELECT 'heartbeat_run' AS subject, "updated_at"
|
|
1095
|
+
FROM "heartbeat_runs"
|
|
1096
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000253'
|
|
1097
|
+
UNION ALL
|
|
1098
|
+
SELECT 'heartbeat_run_with_output' AS subject, "updated_at"
|
|
1099
|
+
FROM "heartbeat_runs"
|
|
1100
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000256'
|
|
1101
|
+
UNION ALL
|
|
1102
|
+
SELECT 'other_company' AS subject, "updated_at"
|
|
1103
|
+
FROM "companies"
|
|
1104
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000260'
|
|
1105
|
+
UNION ALL
|
|
1106
|
+
SELECT 'other_heartbeat_run' AS subject, "updated_at"
|
|
1107
|
+
FROM "heartbeat_runs"
|
|
1108
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000262'
|
|
1109
|
+
UNION ALL
|
|
1110
|
+
SELECT 'other_issue' AS subject, "updated_at"
|
|
1111
|
+
FROM "issues"
|
|
1112
|
+
WHERE "id" = '20000000-0000-0000-0000-000000000001'
|
|
1113
|
+
UNION ALL
|
|
1114
|
+
SELECT 'routine' AS subject, "updated_at"
|
|
1115
|
+
FROM "routines"
|
|
1116
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000254'
|
|
1117
|
+
UNION ALL
|
|
1118
|
+
SELECT 'routine_with_activity' AS subject, "updated_at"
|
|
1119
|
+
FROM "routines"
|
|
1120
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000257'
|
|
1121
|
+
UNION ALL
|
|
1122
|
+
SELECT 'routine_run' AS subject, "updated_at"
|
|
1123
|
+
FROM "routine_runs"
|
|
1124
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000255'
|
|
1125
|
+
UNION ALL
|
|
1126
|
+
SELECT 'routine_run_with_trigger' AS subject, "updated_at"
|
|
1127
|
+
FROM "routine_runs"
|
|
1128
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000258'
|
|
1129
|
+
ORDER BY subject
|
|
1130
|
+
`);
|
|
1131
|
+
const repaired = Object.fromEntries(repairedRows.map((row) => [row.subject, row.updated_at.toISOString()]));
|
|
1132
|
+
expect(repaired).toEqual({
|
|
1133
|
+
company: "2026-01-01T00:00:00.000Z",
|
|
1134
|
+
heartbeat_run: "2026-02-10T10:30:00.000Z",
|
|
1135
|
+
heartbeat_run_with_output: "2026-04-03T12:00:00.123Z",
|
|
1136
|
+
issue_with_comment: "2026-03-02T16:45:00.000Z",
|
|
1137
|
+
issue_with_state_activity: "2026-04-03T12:00:00.123Z",
|
|
1138
|
+
issue_without_comment: "2026-02-01T00:02:00.000Z",
|
|
1139
|
+
other_company: "2026-04-03T12:00:00.123Z",
|
|
1140
|
+
other_heartbeat_run: "2026-04-03T12:00:00.123Z",
|
|
1141
|
+
other_issue: "2026-04-03T12:00:00.123Z",
|
|
1142
|
+
routine: "2026-03-21T11:00:00.000Z",
|
|
1143
|
+
routine_run_with_trigger: "2026-04-03T12:00:00.123Z",
|
|
1144
|
+
routine_with_activity: "2026-04-03T12:00:00.123Z",
|
|
1145
|
+
routine_run: "2026-02-12T12:00:00.000Z",
|
|
1146
|
+
});
|
|
1147
|
+
await afterRepair.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${repairSweepHash}'`);
|
|
1148
|
+
}
|
|
1149
|
+
finally {
|
|
1150
|
+
await afterRepair.end();
|
|
1151
|
+
}
|
|
1152
|
+
await applyPendingMigrations(connectionString);
|
|
1153
|
+
const afterSecondRun = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1154
|
+
try {
|
|
1155
|
+
const secondRunRows = await afterSecondRun.unsafe(`
|
|
1156
|
+
SELECT "updated_at"
|
|
1157
|
+
FROM "issues"
|
|
1158
|
+
WHERE "id" = '10000000-0000-0000-0000-000000000001'
|
|
1159
|
+
`);
|
|
1160
|
+
expect(secondRunRows[0]?.updated_at.toISOString()).toBe("2026-03-02T16:45:00.000Z");
|
|
1161
|
+
}
|
|
1162
|
+
finally {
|
|
1163
|
+
await afterSecondRun.end();
|
|
1164
|
+
}
|
|
1165
|
+
}, 20_000);
|
|
1166
|
+
it("replays the run responsible user repair migration when heartbeat run issue refs are identifiers", async () => {
|
|
1167
|
+
const connectionString = await createTempDatabase();
|
|
1168
|
+
await applyPendingMigrations(connectionString);
|
|
1169
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1170
|
+
try {
|
|
1171
|
+
const runResponsibleUserRepairHash = await migrationHash("0131_repair_run_responsible_user_context_refs.sql");
|
|
1172
|
+
await sql.unsafe(`
|
|
1173
|
+
INSERT INTO "companies" ("id", "name", "issue_prefix", "created_at", "updated_at")
|
|
1174
|
+
VALUES ('00000000-0000-0000-0000-000000000130', 'Migration Test Co', 'TST130', now(), now())
|
|
1175
|
+
`);
|
|
1176
|
+
await sql.unsafe(`
|
|
1177
|
+
INSERT INTO "company_memberships" (
|
|
1178
|
+
"id",
|
|
1179
|
+
"company_id",
|
|
1180
|
+
"principal_type",
|
|
1181
|
+
"principal_id",
|
|
1182
|
+
"status",
|
|
1183
|
+
"membership_role",
|
|
1184
|
+
"created_at",
|
|
1185
|
+
"updated_at"
|
|
1186
|
+
)
|
|
1187
|
+
VALUES (
|
|
1188
|
+
'00000000-0000-0000-0000-000000000131',
|
|
1189
|
+
'00000000-0000-0000-0000-000000000130',
|
|
1190
|
+
'user',
|
|
1191
|
+
'owner-user',
|
|
1192
|
+
'active',
|
|
1193
|
+
'owner',
|
|
1194
|
+
now(),
|
|
1195
|
+
now()
|
|
1196
|
+
)
|
|
1197
|
+
`);
|
|
1198
|
+
await sql.unsafe(`
|
|
1199
|
+
INSERT INTO "agents" ("id", "company_id", "name", "role", "adapter_type", "created_at", "updated_at")
|
|
1200
|
+
VALUES (
|
|
1201
|
+
'00000000-0000-0000-0000-000000000132',
|
|
1202
|
+
'00000000-0000-0000-0000-000000000130',
|
|
1203
|
+
'Migration Agent',
|
|
1204
|
+
'general',
|
|
1205
|
+
'process',
|
|
1206
|
+
now(),
|
|
1207
|
+
now()
|
|
1208
|
+
)
|
|
1209
|
+
`);
|
|
1210
|
+
await sql.unsafe(`
|
|
1211
|
+
INSERT INTO "issues" (
|
|
1212
|
+
"id",
|
|
1213
|
+
"company_id",
|
|
1214
|
+
"title",
|
|
1215
|
+
"status",
|
|
1216
|
+
"responsible_user_id",
|
|
1217
|
+
"identifier",
|
|
1218
|
+
"created_at",
|
|
1219
|
+
"updated_at"
|
|
1220
|
+
)
|
|
1221
|
+
VALUES (
|
|
1222
|
+
'00000000-0000-0000-0000-000000000133',
|
|
1223
|
+
'00000000-0000-0000-0000-000000000130',
|
|
1224
|
+
'Identifier referenced issue',
|
|
1225
|
+
'todo',
|
|
1226
|
+
'issue-user',
|
|
1227
|
+
'TST130-1',
|
|
1228
|
+
now(),
|
|
1229
|
+
now()
|
|
1230
|
+
)
|
|
1231
|
+
`);
|
|
1232
|
+
await sql.unsafe(`
|
|
1233
|
+
INSERT INTO "heartbeat_runs" (
|
|
1234
|
+
"id",
|
|
1235
|
+
"company_id",
|
|
1236
|
+
"agent_id",
|
|
1237
|
+
"status",
|
|
1238
|
+
"responsible_user_id",
|
|
1239
|
+
"context_snapshot",
|
|
1240
|
+
"created_at",
|
|
1241
|
+
"updated_at"
|
|
1242
|
+
)
|
|
1243
|
+
VALUES (
|
|
1244
|
+
'00000000-0000-0000-0000-000000000134',
|
|
1245
|
+
'00000000-0000-0000-0000-000000000130',
|
|
1246
|
+
'00000000-0000-0000-0000-000000000132',
|
|
1247
|
+
'completed',
|
|
1248
|
+
NULL,
|
|
1249
|
+
'{"issueId":"TST130-1"}'::jsonb,
|
|
1250
|
+
now(),
|
|
1251
|
+
now()
|
|
1252
|
+
)
|
|
1253
|
+
`);
|
|
1254
|
+
await sql.unsafe(`DELETE FROM "drizzle"."__drizzle_migrations" WHERE hash = '${runResponsibleUserRepairHash}'`);
|
|
1255
|
+
}
|
|
1256
|
+
finally {
|
|
1257
|
+
await sql.end();
|
|
1258
|
+
}
|
|
1259
|
+
const pendingState = await inspectMigrations(connectionString);
|
|
1260
|
+
expect(pendingState).toMatchObject({
|
|
1261
|
+
status: "needsMigrations",
|
|
1262
|
+
pendingMigrations: ["0131_repair_run_responsible_user_context_refs.sql"],
|
|
1263
|
+
reason: "pending-migrations",
|
|
1264
|
+
});
|
|
1265
|
+
await applyPendingMigrations(connectionString);
|
|
1266
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1267
|
+
try {
|
|
1268
|
+
const runs = await verifySql.unsafe(`
|
|
1269
|
+
SELECT "responsible_user_id"
|
|
1270
|
+
FROM "heartbeat_runs"
|
|
1271
|
+
WHERE "id" = '00000000-0000-0000-0000-000000000134'
|
|
1272
|
+
`);
|
|
1273
|
+
expect(runs).toEqual([{ responsible_user_id: "issue-user" }]);
|
|
1274
|
+
}
|
|
1275
|
+
finally {
|
|
1276
|
+
await verifySql.end();
|
|
1277
|
+
}
|
|
1278
|
+
}, 20_000);
|
|
1279
|
+
it("preserves legacy runs while adding native persistence and replay-safe status versioning", async () => {
|
|
1280
|
+
const clusterUrl = await createTempDatabase();
|
|
1281
|
+
await ensurePostgresDatabase(clusterUrl, "native_legacy");
|
|
1282
|
+
const legacyUrl = new URL(clusterUrl);
|
|
1283
|
+
legacyUrl.pathname = "/native_legacy";
|
|
1284
|
+
const connectionString = legacyUrl.href;
|
|
1285
|
+
cleanups.push(() => closeRegisteredClients(connectionString));
|
|
1286
|
+
const directory = await fs.promises.mkdtemp(join(tmpdir(), "paperclip-native-prior-migrations-"));
|
|
1287
|
+
cleanups.push(() => fs.promises.rm(directory, { recursive: true, force: true }));
|
|
1288
|
+
const migrationsRoot = new URL("./migrations/", import.meta.url);
|
|
1289
|
+
const journal = JSON.parse(await fs.promises.readFile(new URL("meta/_journal.json", migrationsRoot), "utf8"));
|
|
1290
|
+
const priorEntries = journal.entries.filter((entry) => entry.idx < 227);
|
|
1291
|
+
await fs.promises.mkdir(join(directory, "meta"));
|
|
1292
|
+
for (const entry of priorEntries) {
|
|
1293
|
+
await fs.promises.copyFile(new URL(`${entry.tag}.sql`, migrationsRoot), join(directory, `${entry.tag}.sql`));
|
|
1294
|
+
}
|
|
1295
|
+
await fs.promises.writeFile(join(directory, "meta/_journal.json"), JSON.stringify({ ...journal, entries: priorEntries }));
|
|
1296
|
+
const nativePersistenceHash = await migrationHash("0227_modern_pandemic.sql");
|
|
1297
|
+
const eventSequenceUniquenessHash = await migrationHash("0235_heartbeat_run_event_sequence_uniqueness.sql");
|
|
1298
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1299
|
+
const companyId = "10000000-0000-4000-8000-000000000227";
|
|
1300
|
+
const agentId = "20000000-0000-4000-8000-000000000227";
|
|
1301
|
+
const runId = "30000000-0000-4000-8000-000000000227";
|
|
1302
|
+
const issueId = "40000000-0000-4000-8000-000000000227";
|
|
1303
|
+
const contractId = "50000000-0000-4000-8000-000000000227";
|
|
1304
|
+
const resultId = "60000000-0000-4000-8000-000000000227";
|
|
1305
|
+
const assessmentId = "70000000-0000-4000-8000-000000000227";
|
|
1306
|
+
const decisionId = "80000000-0000-4000-8000-000000000227";
|
|
1307
|
+
const otherCompanyId = "11000000-0000-4000-8000-000000000227";
|
|
1308
|
+
const otherAgentId = "21000000-0000-4000-8000-000000000227";
|
|
1309
|
+
const otherRunId = "31000000-0000-4000-8000-000000000227";
|
|
1310
|
+
const otherIssueId = "41000000-0000-4000-8000-000000000227";
|
|
1311
|
+
const otherContractId = "51000000-0000-4000-8000-000000000227";
|
|
1312
|
+
const otherResultId = "61000000-0000-4000-8000-000000000227";
|
|
1313
|
+
const otherAssessmentId = "71000000-0000-4000-8000-000000000227";
|
|
1314
|
+
const otherDecisionId = "81000000-0000-4000-8000-000000000227";
|
|
1315
|
+
try {
|
|
1316
|
+
// Build the real pre-native schema. Downgrading the latest schema by
|
|
1317
|
+
// dropping its unique index is invalid once later tenant FKs use it.
|
|
1318
|
+
await migrate(drizzle(sql), { migrationsFolder: directory });
|
|
1319
|
+
expect(await sql `SELECT to_regclass('public.native_run_results') AS native_results`).toEqual([{ native_results: null }]);
|
|
1320
|
+
await sql `
|
|
1321
|
+
INSERT INTO companies (id, name, issue_prefix)
|
|
1322
|
+
VALUES (${companyId}, 'Native persistence fixture', 'NPF')
|
|
1323
|
+
`;
|
|
1324
|
+
await sql `
|
|
1325
|
+
INSERT INTO agents (id, company_id, name)
|
|
1326
|
+
VALUES (${agentId}, ${companyId}, 'Legacy migration agent')
|
|
1327
|
+
`;
|
|
1328
|
+
await sql `
|
|
1329
|
+
INSERT INTO heartbeat_runs (id, company_id, agent_id, status)
|
|
1330
|
+
VALUES (${runId}, ${companyId}, ${agentId}, 'succeeded')
|
|
1331
|
+
`;
|
|
1332
|
+
await sql `
|
|
1333
|
+
INSERT INTO issues (id, company_id, title, status)
|
|
1334
|
+
VALUES (${issueId}, ${companyId}, 'Legacy migration issue', 'in_progress')
|
|
1335
|
+
`;
|
|
1336
|
+
await sql.unsafe(`
|
|
1337
|
+
INSERT INTO heartbeat_run_events
|
|
1338
|
+
(company_id, run_id, agent_id, seq, event_type, stream, level, message, payload, created_at)
|
|
1339
|
+
VALUES
|
|
1340
|
+
('${companyId}', '${runId}', '${agentId}', 1, 'legacy.start', 'system', 'info', 'one', '{"bytes":"alpha-1"}'::jsonb, '2026-08-01T00:00:01.000Z'),
|
|
1341
|
+
('${companyId}', '${runId}', '${agentId}', 5, 'legacy.log', 'stdout', 'info', 'first-five', '{"bytes":"beta-5a"}'::jsonb, '2026-08-01T00:00:02.000Z'),
|
|
1342
|
+
('${companyId}', '${runId}', '${agentId}', 5, 'legacy.log', 'stderr', 'warn', 'duplicate-five', '{"bytes":"gamma-5b"}'::jsonb, '2026-08-01T00:00:03.000Z'),
|
|
1343
|
+
('${companyId}', '${runId}', '${agentId}', 9, 'legacy.end', 'system', 'info', 'nine', '{"bytes":"delta-9"}'::jsonb, '2026-08-01T00:00:04.000Z')
|
|
1344
|
+
`);
|
|
1345
|
+
}
|
|
1346
|
+
finally {
|
|
1347
|
+
await sql.end();
|
|
1348
|
+
}
|
|
1349
|
+
await applyPendingMigrations(connectionString);
|
|
1350
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1351
|
+
try {
|
|
1352
|
+
const events = await verifySql.unsafe(`
|
|
1353
|
+
SELECT seq, event_type, stream, level, message, payload, created_at
|
|
1354
|
+
FROM heartbeat_run_events
|
|
1355
|
+
WHERE run_id = '${runId}'
|
|
1356
|
+
ORDER BY id
|
|
1357
|
+
`);
|
|
1358
|
+
// 0235 preserves every legacy event while moving only duplicate
|
|
1359
|
+
// sequence values above the old run maximum before installing the
|
|
1360
|
+
// durable (run_id, seq) uniqueness invariant.
|
|
1361
|
+
expect(events.map((event) => Number(event.seq))).toEqual([1, 5, 10, 9]);
|
|
1362
|
+
expect(events.map(({ seq: _seq, ...event }) => ({
|
|
1363
|
+
...event,
|
|
1364
|
+
created_at: event.created_at.toISOString(),
|
|
1365
|
+
}))).toEqual([
|
|
1366
|
+
{
|
|
1367
|
+
event_type: "legacy.start",
|
|
1368
|
+
stream: "system",
|
|
1369
|
+
level: "info",
|
|
1370
|
+
message: "one",
|
|
1371
|
+
payload: { bytes: "alpha-1" },
|
|
1372
|
+
created_at: "2026-08-01T00:00:01.000Z",
|
|
1373
|
+
},
|
|
1374
|
+
{
|
|
1375
|
+
event_type: "legacy.log",
|
|
1376
|
+
stream: "stdout",
|
|
1377
|
+
level: "info",
|
|
1378
|
+
message: "first-five",
|
|
1379
|
+
payload: { bytes: "beta-5a" },
|
|
1380
|
+
created_at: "2026-08-01T00:00:02.000Z",
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
event_type: "legacy.log",
|
|
1384
|
+
stream: "stderr",
|
|
1385
|
+
level: "warn",
|
|
1386
|
+
message: "duplicate-five",
|
|
1387
|
+
payload: { bytes: "gamma-5b" },
|
|
1388
|
+
created_at: "2026-08-01T00:00:03.000Z",
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
event_type: "legacy.end",
|
|
1392
|
+
stream: "system",
|
|
1393
|
+
level: "info",
|
|
1394
|
+
message: "nine",
|
|
1395
|
+
payload: { bytes: "delta-9" },
|
|
1396
|
+
created_at: "2026-08-01T00:00:04.000Z",
|
|
1397
|
+
},
|
|
1398
|
+
]);
|
|
1399
|
+
const runs = await verifySql.unsafe(`
|
|
1400
|
+
SELECT runtime_mode, next_event_seq
|
|
1401
|
+
FROM heartbeat_runs
|
|
1402
|
+
WHERE id = '${runId}'
|
|
1403
|
+
`);
|
|
1404
|
+
expect(runs.map((run) => ({
|
|
1405
|
+
runtimeMode: run.runtime_mode,
|
|
1406
|
+
nextEventSeq: Number(run.next_event_seq),
|
|
1407
|
+
}))).toEqual([{ runtimeMode: "legacy", nextEventSeq: 11 }]);
|
|
1408
|
+
const nativeRowsBefore = await verifySql.unsafe(`
|
|
1409
|
+
SELECT 'completion_contracts' AS table_name, count(*)::int AS row_count FROM completion_contracts
|
|
1410
|
+
UNION ALL SELECT 'native_run_results', count(*)::int FROM native_run_results
|
|
1411
|
+
UNION ALL SELECT 'native_run_finalizations', count(*)::int FROM native_run_finalizations
|
|
1412
|
+
UNION ALL SELECT 'work_assessments', count(*)::int FROM work_assessments
|
|
1413
|
+
UNION ALL SELECT 'status_decisions', count(*)::int FROM status_decisions
|
|
1414
|
+
UNION ALL SELECT 'status_decision_effects', count(*)::int FROM status_decision_effects
|
|
1415
|
+
ORDER BY table_name
|
|
1416
|
+
`);
|
|
1417
|
+
expect(nativeRowsBefore.every((row) => row.row_count === 0)).toBe(true);
|
|
1418
|
+
await verifySql `
|
|
1419
|
+
INSERT INTO companies (id, name, issue_prefix)
|
|
1420
|
+
VALUES (${otherCompanyId}, 'Other native persistence fixture', 'ONP')
|
|
1421
|
+
`;
|
|
1422
|
+
await verifySql `
|
|
1423
|
+
INSERT INTO agents (id, company_id, name)
|
|
1424
|
+
VALUES (${otherAgentId}, ${otherCompanyId}, 'Other native migration agent')
|
|
1425
|
+
`;
|
|
1426
|
+
await verifySql `
|
|
1427
|
+
INSERT INTO heartbeat_runs (
|
|
1428
|
+
id, company_id, agent_id, status, native_issue_id, completion_contract_id
|
|
1429
|
+
) VALUES (
|
|
1430
|
+
${otherRunId}, ${otherCompanyId}, ${otherAgentId}, 'succeeded',
|
|
1431
|
+
${otherIssueId}, ${otherContractId}
|
|
1432
|
+
)
|
|
1433
|
+
`;
|
|
1434
|
+
await verifySql `
|
|
1435
|
+
INSERT INTO issues (id, company_id, title, status)
|
|
1436
|
+
VALUES (${otherIssueId}, ${otherCompanyId}, 'Other native issue', 'in_progress')
|
|
1437
|
+
`;
|
|
1438
|
+
await verifySql `
|
|
1439
|
+
UPDATE heartbeat_runs
|
|
1440
|
+
SET native_issue_id = ${issueId}, completion_contract_id = ${contractId}
|
|
1441
|
+
WHERE id = ${runId}
|
|
1442
|
+
`;
|
|
1443
|
+
await expect(verifySql `
|
|
1444
|
+
INSERT INTO completion_contracts (
|
|
1445
|
+
company_id, issue_id, revision, schema_version, policy_version,
|
|
1446
|
+
risk, completion_authority, incomplete_criteria_policy, contract_json,
|
|
1447
|
+
canonical_sha256, created_by_actor_type, created_by_actor_id
|
|
1448
|
+
) VALUES (
|
|
1449
|
+
${companyId}, ${otherIssueId}, 1, 'paperclip.completion-contract.v1',
|
|
1450
|
+
'policy-v1', 'low', 'server', 'review', ${JSON.stringify({ criteria: [] })}::jsonb,
|
|
1451
|
+
'cross-company-contract-sha', 'system', 'migration-test'
|
|
1452
|
+
)
|
|
1453
|
+
`).rejects.toThrow(/completion_contracts_issue_company_fk/);
|
|
1454
|
+
await verifySql `
|
|
1455
|
+
INSERT INTO completion_contracts (
|
|
1456
|
+
id, company_id, issue_id, revision, schema_version, policy_version,
|
|
1457
|
+
risk, completion_authority, incomplete_criteria_policy, contract_json,
|
|
1458
|
+
canonical_sha256, created_by_actor_type, created_by_actor_id
|
|
1459
|
+
) VALUES (
|
|
1460
|
+
${contractId}, ${companyId}, ${issueId}, 1, 'paperclip.completion-contract.v1',
|
|
1461
|
+
'policy-v1', 'low', 'server', 'review', ${JSON.stringify({ criteria: [] })}::jsonb,
|
|
1462
|
+
'contract-sha', 'system', 'migration-test'
|
|
1463
|
+
)
|
|
1464
|
+
`;
|
|
1465
|
+
await verifySql `
|
|
1466
|
+
INSERT INTO completion_contracts (
|
|
1467
|
+
id, company_id, issue_id, revision, schema_version, policy_version,
|
|
1468
|
+
risk, completion_authority, incomplete_criteria_policy, contract_json,
|
|
1469
|
+
canonical_sha256, created_by_actor_type, created_by_actor_id
|
|
1470
|
+
) VALUES (
|
|
1471
|
+
${otherContractId}, ${otherCompanyId}, ${otherIssueId}, 1,
|
|
1472
|
+
'paperclip.completion-contract.v1', 'policy-v1', 'low', 'server', 'review',
|
|
1473
|
+
${JSON.stringify({ criteria: [] })}::jsonb, 'other-contract-sha',
|
|
1474
|
+
'system', 'migration-test'
|
|
1475
|
+
)
|
|
1476
|
+
`;
|
|
1477
|
+
await expect(verifySql `
|
|
1478
|
+
INSERT INTO native_run_results (
|
|
1479
|
+
company_id, issue_id, run_id, completion_contract_id,
|
|
1480
|
+
server_fingerprint, schema_status, result_json, canonical_sha256
|
|
1481
|
+
) VALUES (
|
|
1482
|
+
${companyId}, ${issueId}, ${otherRunId}, ${contractId},
|
|
1483
|
+
'cross-company-run', 'valid', ${JSON.stringify({ summary: "invalid" })}::jsonb,
|
|
1484
|
+
'cross-company-run-sha'
|
|
1485
|
+
)
|
|
1486
|
+
`).rejects.toThrow(/native_run_results_run_contract_owner_fk/);
|
|
1487
|
+
await expect(verifySql `
|
|
1488
|
+
INSERT INTO native_run_results (
|
|
1489
|
+
company_id, issue_id, run_id, completion_contract_id,
|
|
1490
|
+
server_fingerprint, schema_status, result_json, canonical_sha256
|
|
1491
|
+
) VALUES (
|
|
1492
|
+
${companyId}, ${issueId}, ${runId}, ${otherContractId},
|
|
1493
|
+
'cross-company-contract', 'valid', ${JSON.stringify({ summary: "invalid" })}::jsonb,
|
|
1494
|
+
'cross-company-contract-sha'
|
|
1495
|
+
)
|
|
1496
|
+
`).rejects.toThrow(/native_run_results_run_contract_owner_fk/);
|
|
1497
|
+
await verifySql `
|
|
1498
|
+
INSERT INTO native_run_results (
|
|
1499
|
+
id, company_id, issue_id, run_id, completion_contract_id,
|
|
1500
|
+
server_fingerprint, schema_status, result_json, canonical_sha256
|
|
1501
|
+
) VALUES (
|
|
1502
|
+
${resultId}, ${companyId}, ${issueId}, ${runId}, ${contractId},
|
|
1503
|
+
'result-fingerprint', 'valid', ${JSON.stringify({ summary: "done" })}::jsonb, 'result-sha'
|
|
1504
|
+
)
|
|
1505
|
+
`;
|
|
1506
|
+
await verifySql `
|
|
1507
|
+
INSERT INTO native_run_results (
|
|
1508
|
+
id, company_id, issue_id, run_id, completion_contract_id,
|
|
1509
|
+
server_fingerprint, schema_status, result_json, canonical_sha256
|
|
1510
|
+
) VALUES (
|
|
1511
|
+
${otherResultId}, ${otherCompanyId}, ${otherIssueId}, ${otherRunId},
|
|
1512
|
+
${otherContractId}, 'other-result-fingerprint', 'valid',
|
|
1513
|
+
${JSON.stringify({ summary: "other" })}::jsonb, 'other-result-sha'
|
|
1514
|
+
)
|
|
1515
|
+
`;
|
|
1516
|
+
await expect(verifySql `
|
|
1517
|
+
INSERT INTO work_assessments (
|
|
1518
|
+
company_id, issue_id, run_id, contract_id, result_id,
|
|
1519
|
+
trigger_kind, trigger_actor_company_id, prior_issue_status,
|
|
1520
|
+
prior_status_version, policy_version, assessment_json, input_digest
|
|
1521
|
+
) VALUES (
|
|
1522
|
+
${companyId}, ${issueId}, ${runId}, ${contractId}, ${otherResultId},
|
|
1523
|
+
'run_terminal', ${companyId}, 'in_progress', 0, 'policy-v1',
|
|
1524
|
+
${JSON.stringify({ disposition: "invalid" })}::jsonb,
|
|
1525
|
+
'cross-company-assessment-input-sha'
|
|
1526
|
+
)
|
|
1527
|
+
`).rejects.toThrow(/work_assessments_result_owner_fk/);
|
|
1528
|
+
await expect(verifySql `
|
|
1529
|
+
INSERT INTO work_assessments (
|
|
1530
|
+
company_id, issue_id, run_id, contract_id, result_id,
|
|
1531
|
+
trigger_kind, trigger_actor_company_id, prior_issue_status,
|
|
1532
|
+
prior_status_version, policy_version, assessment_json, input_digest
|
|
1533
|
+
) VALUES (
|
|
1534
|
+
${companyId}, ${issueId}, ${runId}, ${contractId}, ${resultId},
|
|
1535
|
+
'run_terminal', ${otherCompanyId}, 'in_progress', 0, 'policy-v1',
|
|
1536
|
+
${JSON.stringify({ disposition: "invalid" })}::jsonb,
|
|
1537
|
+
'cross-company-trigger-input-sha'
|
|
1538
|
+
)
|
|
1539
|
+
`).rejects.toThrow(/work_assessments_trigger_actor_company_check/);
|
|
1540
|
+
await verifySql `
|
|
1541
|
+
INSERT INTO work_assessments (
|
|
1542
|
+
id, company_id, issue_id, run_id, contract_id, result_id,
|
|
1543
|
+
trigger_kind, trigger_actor_company_id, prior_issue_status,
|
|
1544
|
+
prior_status_version, policy_version, assessment_json, input_digest
|
|
1545
|
+
) VALUES (
|
|
1546
|
+
${assessmentId}, ${companyId}, ${issueId}, ${runId}, ${contractId}, ${resultId},
|
|
1547
|
+
'run_terminal', ${companyId}, 'in_progress', 0, 'policy-v1',
|
|
1548
|
+
${JSON.stringify({ disposition: "done" })}::jsonb, 'assessment-input-sha'
|
|
1549
|
+
)
|
|
1550
|
+
`;
|
|
1551
|
+
await verifySql `
|
|
1552
|
+
INSERT INTO work_assessments (
|
|
1553
|
+
id, company_id, issue_id, run_id, contract_id, result_id,
|
|
1554
|
+
trigger_kind, trigger_actor_company_id, prior_issue_status,
|
|
1555
|
+
prior_status_version, policy_version, assessment_json, input_digest
|
|
1556
|
+
) VALUES (
|
|
1557
|
+
${otherAssessmentId}, ${otherCompanyId}, ${otherIssueId}, ${otherRunId},
|
|
1558
|
+
${otherContractId}, ${otherResultId}, 'run_terminal', ${otherCompanyId},
|
|
1559
|
+
'in_progress', 0, 'policy-v1',
|
|
1560
|
+
${JSON.stringify({ disposition: "done" })}::jsonb, 'other-assessment-input-sha'
|
|
1561
|
+
)
|
|
1562
|
+
`;
|
|
1563
|
+
await expect(verifySql `
|
|
1564
|
+
INSERT INTO status_decisions (
|
|
1565
|
+
company_id, issue_id, run_id, assessment_id, decision_version,
|
|
1566
|
+
policy_version, from_status, to_status, reason_code,
|
|
1567
|
+
decision_json, decision_digest
|
|
1568
|
+
) VALUES (
|
|
1569
|
+
${companyId}, ${issueId}, ${runId}, ${otherAssessmentId}, 1,
|
|
1570
|
+
'policy-v1', 'in_progress', 'done', 'native_result_accepted',
|
|
1571
|
+
${JSON.stringify({ toStatus: "done" })}::jsonb, 'cross-company-decision-sha'
|
|
1572
|
+
)
|
|
1573
|
+
`).rejects.toThrow(/status_decisions_assessment_owner_fk/);
|
|
1574
|
+
await verifySql `
|
|
1575
|
+
INSERT INTO status_decisions (
|
|
1576
|
+
id, company_id, issue_id, run_id, assessment_id, decision_version,
|
|
1577
|
+
policy_version, from_status, to_status, reason_code,
|
|
1578
|
+
decision_json, decision_digest
|
|
1579
|
+
) VALUES (
|
|
1580
|
+
${decisionId}, ${companyId}, ${issueId}, ${runId}, ${assessmentId}, 1,
|
|
1581
|
+
'policy-v1', 'in_progress', 'done', 'native_result_accepted',
|
|
1582
|
+
${JSON.stringify({ toStatus: "done" })}::jsonb, 'decision-sha'
|
|
1583
|
+
)
|
|
1584
|
+
`;
|
|
1585
|
+
await verifySql `
|
|
1586
|
+
INSERT INTO status_decisions (
|
|
1587
|
+
id, company_id, issue_id, run_id, assessment_id, decision_version,
|
|
1588
|
+
policy_version, from_status, to_status, reason_code,
|
|
1589
|
+
decision_json, decision_digest
|
|
1590
|
+
) VALUES (
|
|
1591
|
+
${otherDecisionId}, ${otherCompanyId}, ${otherIssueId}, ${otherRunId},
|
|
1592
|
+
${otherAssessmentId}, 1, 'policy-v1', 'in_progress', 'done',
|
|
1593
|
+
'native_result_accepted', ${JSON.stringify({ toStatus: "done" })}::jsonb,
|
|
1594
|
+
'other-decision-sha'
|
|
1595
|
+
)
|
|
1596
|
+
`;
|
|
1597
|
+
await expect(verifySql `
|
|
1598
|
+
INSERT INTO status_decision_effects (
|
|
1599
|
+
company_id, issue_id, decision_id, ordinal, effect_kind,
|
|
1600
|
+
target_type, idempotency_key, payload
|
|
1601
|
+
) VALUES (
|
|
1602
|
+
${companyId}, ${issueId}, ${otherDecisionId}, 0, 'update_issue_status',
|
|
1603
|
+
'issue', 'cross-company-decision-effect', ${JSON.stringify({ status: "done" })}::jsonb
|
|
1604
|
+
)
|
|
1605
|
+
`).rejects.toThrow(/status_decision_effects_decision_owner_fk/);
|
|
1606
|
+
await verifySql `
|
|
1607
|
+
INSERT INTO status_decision_effects (
|
|
1608
|
+
company_id, issue_id, decision_id, ordinal, effect_kind,
|
|
1609
|
+
target_type, idempotency_key, payload
|
|
1610
|
+
) VALUES (
|
|
1611
|
+
${companyId}, ${issueId}, ${decisionId}, 0, 'update_issue_status',
|
|
1612
|
+
'issue', 'decision-effect-1', ${JSON.stringify({ status: "done" })}::jsonb
|
|
1613
|
+
)
|
|
1614
|
+
`;
|
|
1615
|
+
await expect(verifySql `
|
|
1616
|
+
INSERT INTO native_run_finalizations (
|
|
1617
|
+
run_id, company_id, issue_id, phase, result_id, assessment_id, decision_id
|
|
1618
|
+
) VALUES (
|
|
1619
|
+
${runId}, ${companyId}, ${issueId}, 'committed', ${resultId},
|
|
1620
|
+
${assessmentId}, ${otherDecisionId}
|
|
1621
|
+
)
|
|
1622
|
+
`).rejects.toThrow(/native_run_finalizations_decision_owner_fk/);
|
|
1623
|
+
await verifySql `
|
|
1624
|
+
INSERT INTO native_run_finalizations (
|
|
1625
|
+
run_id, company_id, issue_id, phase, result_id, assessment_id, decision_id
|
|
1626
|
+
) VALUES (
|
|
1627
|
+
${runId}, ${companyId}, ${issueId}, 'committed', ${resultId}, ${assessmentId}, ${decisionId}
|
|
1628
|
+
)
|
|
1629
|
+
`;
|
|
1630
|
+
await verifySql `UPDATE issues SET title = 'Renamed legacy issue' WHERE id = ${issueId}`;
|
|
1631
|
+
await verifySql `UPDATE issues SET status = 'done' WHERE id = ${issueId}`;
|
|
1632
|
+
const issues = await verifySql.unsafe(`
|
|
1633
|
+
SELECT status, status_version
|
|
1634
|
+
FROM issues
|
|
1635
|
+
WHERE id = '${issueId}'
|
|
1636
|
+
`);
|
|
1637
|
+
expect(issues.map((issue) => ({
|
|
1638
|
+
status: issue.status,
|
|
1639
|
+
statusVersion: Number(issue.status_version),
|
|
1640
|
+
}))).toEqual([{ status: "done", statusVersion: 1 }]);
|
|
1641
|
+
await verifySql `DELETE FROM "drizzle"."__drizzle_migrations" WHERE "hash" = ${nativePersistenceHash}`;
|
|
1642
|
+
await verifySql `DELETE FROM "drizzle"."__drizzle_migrations" WHERE "hash" = ${eventSequenceUniquenessHash}`;
|
|
1643
|
+
}
|
|
1644
|
+
finally {
|
|
1645
|
+
await verifySql.end();
|
|
1646
|
+
}
|
|
1647
|
+
await expect(applyPendingMigrations(connectionString)).resolves.toBeUndefined();
|
|
1648
|
+
await expect(inspectMigrations(connectionString)).resolves.toMatchObject({
|
|
1649
|
+
status: "upToDate",
|
|
1650
|
+
});
|
|
1651
|
+
const replaySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1652
|
+
try {
|
|
1653
|
+
const replayed = await replaySql.unsafe(`
|
|
1654
|
+
SELECT
|
|
1655
|
+
issue.status_version,
|
|
1656
|
+
run.next_event_seq,
|
|
1657
|
+
(
|
|
1658
|
+
SELECT count(*)::int
|
|
1659
|
+
FROM pg_trigger
|
|
1660
|
+
WHERE tgname = 'paperclip_issue_status_version_trigger'
|
|
1661
|
+
AND NOT tgisinternal
|
|
1662
|
+
) AS trigger_count,
|
|
1663
|
+
(
|
|
1664
|
+
SELECT count(*)::int
|
|
1665
|
+
FROM native_run_finalizations
|
|
1666
|
+
WHERE run_id = '${runId}'
|
|
1667
|
+
) AS finalization_count
|
|
1668
|
+
FROM issues issue
|
|
1669
|
+
CROSS JOIN heartbeat_runs run
|
|
1670
|
+
WHERE issue.id = '${issueId}' AND run.id = '${runId}'
|
|
1671
|
+
`);
|
|
1672
|
+
expect(replayed.map((row) => ({
|
|
1673
|
+
statusVersion: Number(row.status_version),
|
|
1674
|
+
nextEventSeq: Number(row.next_event_seq),
|
|
1675
|
+
triggerCount: row.trigger_count,
|
|
1676
|
+
finalizationCount: row.finalization_count,
|
|
1677
|
+
}))).toEqual([{
|
|
1678
|
+
statusVersion: 1,
|
|
1679
|
+
nextEventSeq: 11,
|
|
1680
|
+
triggerCount: 1,
|
|
1681
|
+
finalizationCount: 1,
|
|
1682
|
+
}]);
|
|
1683
|
+
}
|
|
1684
|
+
finally {
|
|
1685
|
+
await replaySql.end();
|
|
1686
|
+
}
|
|
1687
|
+
}, 60_000);
|
|
1688
|
+
it("replays the idempotent provider trace migration", async () => {
|
|
1689
|
+
const connectionString = await createTempDatabase();
|
|
1690
|
+
await applyPendingMigrations(connectionString);
|
|
1691
|
+
const hash = await migrationHash("0234_provider_trace_records.sql");
|
|
1692
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1693
|
+
try {
|
|
1694
|
+
await sql `
|
|
1695
|
+
DELETE FROM "drizzle"."__drizzle_migrations"
|
|
1696
|
+
WHERE "hash" = ${hash}
|
|
1697
|
+
`;
|
|
1698
|
+
}
|
|
1699
|
+
finally {
|
|
1700
|
+
await sql.end();
|
|
1701
|
+
}
|
|
1702
|
+
await expect(applyPendingMigrations(connectionString)).resolves.toBeUndefined();
|
|
1703
|
+
await expect(inspectMigrations(connectionString)).resolves.toMatchObject({
|
|
1704
|
+
status: "upToDate",
|
|
1705
|
+
});
|
|
1706
|
+
}, 30_000);
|
|
1707
|
+
it("removes retired model profiles from live records and configuration revisions", async () => {
|
|
1708
|
+
const connectionString = await createTempDatabase();
|
|
1709
|
+
await applyPendingMigrations(connectionString);
|
|
1710
|
+
const hash = await migrationHash("0236_remove_cheap_model_profiles.sql");
|
|
1711
|
+
const companyId = "10000000-0000-4000-8000-000000000236";
|
|
1712
|
+
const agentId = "20000000-0000-4000-8000-000000000236";
|
|
1713
|
+
const issueId = "30000000-0000-4000-8000-000000000236";
|
|
1714
|
+
const sql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1715
|
+
try {
|
|
1716
|
+
await sql `
|
|
1717
|
+
INSERT INTO companies (id, name, issue_prefix)
|
|
1718
|
+
VALUES (${companyId}, 'Model profile migration fixture', 'MPF')
|
|
1719
|
+
`;
|
|
1720
|
+
await sql `
|
|
1721
|
+
INSERT INTO agents (id, company_id, name, runtime_config)
|
|
1722
|
+
VALUES (
|
|
1723
|
+
${agentId},
|
|
1724
|
+
${companyId},
|
|
1725
|
+
'Legacy model profile agent',
|
|
1726
|
+
'{"heartbeat":{"enabled":true},"modelProfiles":{"cheap":{"model":"legacy"}}}'::jsonb
|
|
1727
|
+
)
|
|
1728
|
+
`;
|
|
1729
|
+
await sql `
|
|
1730
|
+
INSERT INTO issues (id, company_id, title, assignee_adapter_overrides)
|
|
1731
|
+
VALUES (
|
|
1732
|
+
${issueId},
|
|
1733
|
+
${companyId},
|
|
1734
|
+
'Legacy model profile issue',
|
|
1735
|
+
'{"modelProfile":"cheap","workingDirectory":"/workspace"}'::jsonb
|
|
1736
|
+
)
|
|
1737
|
+
`;
|
|
1738
|
+
await sql `
|
|
1739
|
+
INSERT INTO agent_config_revisions (
|
|
1740
|
+
company_id,
|
|
1741
|
+
agent_id,
|
|
1742
|
+
changed_keys,
|
|
1743
|
+
before_config,
|
|
1744
|
+
after_config
|
|
1745
|
+
)
|
|
1746
|
+
VALUES (
|
|
1747
|
+
${companyId},
|
|
1748
|
+
${agentId},
|
|
1749
|
+
'["runtimeConfig"]'::jsonb,
|
|
1750
|
+
'{"name":"Legacy model profile agent","runtimeConfig":{"modelProfiles":{"cheap":{"model":"legacy-before"}},"heartbeat":{"enabled":true}}}'::jsonb,
|
|
1751
|
+
'{"name":"Legacy model profile agent","runtimeConfig":{"modelProfiles":{"cheap":{"model":"legacy-after"}},"heartbeat":{"enabled":false}}}'::jsonb
|
|
1752
|
+
)
|
|
1753
|
+
`;
|
|
1754
|
+
await sql `
|
|
1755
|
+
DELETE FROM "drizzle"."__drizzle_migrations"
|
|
1756
|
+
WHERE "hash" = ${hash}
|
|
1757
|
+
`;
|
|
1758
|
+
}
|
|
1759
|
+
finally {
|
|
1760
|
+
await sql.end();
|
|
1761
|
+
}
|
|
1762
|
+
await applyPendingMigrations(connectionString);
|
|
1763
|
+
const verifySql = postgres(connectionString, { max: 1, onnotice: () => { } });
|
|
1764
|
+
try {
|
|
1765
|
+
const [result] = await verifySql.unsafe(`
|
|
1766
|
+
SELECT
|
|
1767
|
+
agent.runtime_config,
|
|
1768
|
+
issue.assignee_adapter_overrides,
|
|
1769
|
+
revision.before_config,
|
|
1770
|
+
revision.after_config
|
|
1771
|
+
FROM agents agent
|
|
1772
|
+
JOIN issues issue ON issue.company_id = agent.company_id
|
|
1773
|
+
JOIN agent_config_revisions revision ON revision.agent_id = agent.id
|
|
1774
|
+
WHERE agent.id = '${agentId}' AND issue.id = '${issueId}'
|
|
1775
|
+
`);
|
|
1776
|
+
expect(result.runtime_config).toEqual({ heartbeat: { enabled: true } });
|
|
1777
|
+
expect(result.assignee_adapter_overrides).toEqual({ workingDirectory: "/workspace" });
|
|
1778
|
+
expect(result.before_config).toEqual({
|
|
1779
|
+
name: "Legacy model profile agent",
|
|
1780
|
+
runtimeConfig: { heartbeat: { enabled: true } },
|
|
1781
|
+
});
|
|
1782
|
+
expect(result.after_config).toEqual({
|
|
1783
|
+
name: "Legacy model profile agent",
|
|
1784
|
+
runtimeConfig: { heartbeat: { enabled: false } },
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
finally {
|
|
1788
|
+
await verifySql.end();
|
|
1789
|
+
}
|
|
1790
|
+
}, 30_000);
|
|
1791
|
+
});
|
|
1792
|
+
//# sourceMappingURL=client.test.js.map
|