openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 6.74 kB
JavaScript
import{n as e,t}from"./transcript-version-B8n3Ftv8.mjs";import{n}from"./transcript-openclaw-root-MOWp8O-B.mjs";import{o as r}from"./transcript-kysely-sync-cache-state-DHCXK7mb.mjs";import{t as i}from"./transcript-startup-maintenance-required-DocYc5R6.mjs";const a=/^(?<year>\d{4})\.(?<month>[1-9]\d?)\.(?<patch>[1-9]\d*)(?:-(?:(?<channel>alpha|beta)\.(?<prerelease>[1-9]\d*)|(?<correction>[1-9]\d*)))?$/;function parseReleaseVersion(e){let t=e.trim(),n=a.exec(t)?.groups;if(!n)return null;let r=Number(n.year),i=Number(n.month),o=Number(n.patch),s=n.prerelease===void 0?void 0:Number(n.prerelease),c=n.correction===void 0?void 0:Number(n.correction);if(!Number.isSafeInteger(r)||!Number.isSafeInteger(i)||!Number.isSafeInteger(o)||i<1||i>12||o<1||s!==void 0&&!Number.isSafeInteger(s)||c!==void 0&&!Number.isSafeInteger(c))return null;let l=n.channel===`alpha`?`alpha`:n.channel===`beta`?`beta`:`stable`;return{version:t,baseVersion:`${r}.${i}.${o}`,channel:l,year:r,month:i,patch:o,alphaNumber:l===`alpha`?s:void 0,betaNumber:l===`beta`?s:void 0,...c===void 0?{}:{correctionNumber:c}}}function compareReleaseVersions(e,t){let n=parseReleaseVersion(e),r=parseReleaseVersion(t);if(n===null||r===null)return null;if(n.year!==r.year)return Math.sign(n.year-r.year);if(n.month!==r.month)return Math.sign(n.month-r.month);if(n.patch!==r.patch)return Math.sign(n.patch-r.patch);if(n.channel!==r.channel){let e={alpha:0,beta:1,stable:2};return Math.sign(e[n.channel]-e[r.channel])}return n.channel===`alpha`&&r.channel===`alpha`?Math.sign((n.alphaNumber??0)-(r.alphaNumber??0)):n.channel===`beta`&&r.channel===`beta`?Math.sign((n.betaNumber??0)-(r.betaNumber??0)):Math.sign((n.correctionNumber??0)-(r.correctionNumber??0))}const o=[`agent_deletion_journal`],s=/* @__PURE__ */ `sandbox_persistent_execs.user_profile_identities.user_background_images.local_workspace_projections.local_workspace_manifest_nodes.local_workspace_tree_packs.local_workspace_source_path_sets.update_runs.session_repository_workspaces.github_repository_publication_requests.github_publication_session_lifecycles.skill_library_entries.skill_library_revisions.skill_library_events.skill_library_uploads.github_personal_publication_requests.cron_job_runtime_authorities.cron_run_trigger_state_retirements.execution_identity_contexts.mcp_oauth_pending_authorizations.node_worker_launch_containers.node_worker_launch_boots.node_worker_launch_cleanup.node_worker_launch_process_scopes.node_worker_launches.node_worker_prepared_workspaces.node_worker_turns.operator_approval_execution_identities.operator_approval_standing_grants.operator_approval_standing_grant_generations.web_push_approval_deliveries.execution_decision_facts.execution_owner_lifecycle_bindings.outbound_message_execution_bindings.outbound_message_progress`.split(`.`),c=[`idx_sandbox_persistent_execs_container`,`idx_sandbox_persistent_execs_container_name`,`idx_sandbox_persistent_execs_source`,`idx_user_profile_identities_profile_id`,`idx_user_profile_identities_authorization`,`idx_update_runs_created`,`idx_update_runs_active`,`idx_github_repository_publication_shared_request`,`idx_github_repository_publication_personal_request`,`idx_github_personal_publication_owner_session`,`idx_github_personal_publication_pending`,`idx_node_worker_launches_terminal_completed`,`idx_node_worker_turns_terminal_completed`,`idx_node_worker_turns_active_owner`,`idx_operator_approval_standing_grants_binding`,`idx_web_push_approval_deliveries_subscription`,`execution_identity_contexts_run_created_idx`,`execution_decision_facts_cursor_id_idx`,`execution_decision_facts_context_occurred_idx`,`execution_decision_facts_run_occurred_idx`,`outbound_message_execution_bindings_execution_event_idx`,`outbound_message_progress_occurred_idx`,`outbound_message_progress_run_occurred_idx`],l=[...s,`agent_provenance`,`cron_run_receipts`,`config_revision_keys`,`secret_store_entries`,`projects`,`worktree_templates`,`user_preferences`,`device_pair_setup_completions`,`github_publication_requests`,`device_pairing_join_codes`,`skill_workshop_changes`,`worker_environment_ssh_fallback_ports`,`worker_session_placement_moves`],u=[...c,`cron_run_receipts_cursor_id_idx`,`idx_cron_run_receipts_active_job`,`idx_cron_run_receipts_job_history`,`idx_github_publication_requests_pending`,`secret_store_entries_live_idx`,`skill_workshop_changes_cursor_id_idx`,`idx_skill_workshop_changes_agent_time`],d=5e3,f=`https://docs.openclaw.ai/reference/database-schemas`,p=`SqliteSchemaVersionError`;var SqliteSchemaVersionError=class extends i{constructor(e){super(`newer-schema`,e),this.name=p}};function isSqliteSchemaVersionError(e){return e instanceof SqliteSchemaVersionError||e instanceof Error&&e.name===p}function readSqliteUserVersion(e){let t=r(e,`PRAGMA user_version`,[],e=>e.get());return Number(t?.user_version??0)}function readSqliteWriterAppVersion(e){try{let t=r(e,`SELECT app_version FROM schema_meta WHERE meta_key = 'primary' LIMIT 1`,[],e=>e.get());return typeof t?.app_version==`string`&&t.app_version.length>0?t.app_version:void 0}catch{return}}function writeSqliteUserVersion(e,t){if(!Number.isInteger(t)||t<0||t>2147483647)throw RangeError(`SQLite user_version must be an integer from 0 through 2147483647.`);e.exec(`PRAGMA user_version = ${t}`)}function describeRunningOpenClawBuild(){let r=e(),i=n({moduleUrl:import.meta.url}),a=r?`OpenClaw ${t} (${r})`:`OpenClaw ${t}`;return i?`${a} installed at ${i}`:a}function isNewerSqliteWriterVersion(e){return(compareReleaseVersions(e??``,t)??0)>0}function createNewerSqliteSchemaVersionError(e,n,r,i,a,o=`runtime`){let s=isNewerSqliteWriterVersion(a),c=s?`; it is newer than this Gateway (${t}).`:o===`runtime`?`; run openclaw doctor --fix to inspect this database.`:`.`;return new SqliteSchemaVersionError(`This OpenClaw build cannot open your existing data.
${e} ${n} uses newer schema version ${r}; this build supports ${i}.\n`+(a&&(o===`runtime`||a!==t)?`It was written by OpenClaw ${a}${c}\n`:``)+`Refused by ${describeRunningOpenClawBuild()}.\n`+(s?`Use the newer install that supports schema ${r} or newer, or run openclaw update to update this Gateway service before restarting. To use an older build, restore your pre-update backup created with openclaw backup create.\n`:`Use a build that supports schema ${r} or newer with this state directory. To use an older build, restore your pre-update backup created with openclaw backup create.\n`)+`See ${f}.`)}export{isSqliteSchemaVersionError as a,writeSqliteUserVersion as c,s as d,u as f,d as h,isNewerSqliteWriterVersion as i,o as l,f as m,createNewerSqliteSchemaVersionError as n,readSqliteUserVersion as o,l as p,describeRunningOpenClawBuild as r,readSqliteWriterAppVersion as s,SqliteSchemaVersionError as t,c as u};