@automagik/omni 2.260502.2 → 2.260503.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/server/index.js +671 -35
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -114209,7 +114209,7 @@ import { fileURLToPath } from "url";
|
|
|
114209
114209
|
// package.json
|
|
114210
114210
|
var package_default = {
|
|
114211
114211
|
name: "@automagik/omni",
|
|
114212
|
-
version: "2.
|
|
114212
|
+
version: "2.260503.1",
|
|
114213
114213
|
description: "LLM-optimized CLI for Omni",
|
|
114214
114214
|
type: "module",
|
|
114215
114215
|
bin: {
|
package/dist/server/index.js
CHANGED
|
@@ -224686,7 +224686,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
224686
224686
|
var require_package8 = __commonJS((exports, module) => {
|
|
224687
224687
|
module.exports = {
|
|
224688
224688
|
name: "@omni/api",
|
|
224689
|
-
version: "2.
|
|
224689
|
+
version: "2.260503.1",
|
|
224690
224690
|
type: "module",
|
|
224691
224691
|
exports: {
|
|
224692
224692
|
".": {
|
|
@@ -233856,7 +233856,591 @@ var init_src5 = __esm(() => {
|
|
|
233856
233856
|
init_schema2();
|
|
233857
233857
|
});
|
|
233858
233858
|
|
|
233859
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
233859
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/settings-schema.cjs
|
|
233860
|
+
var require_settings_schema = __commonJS((exports, module) => {
|
|
233861
|
+
var SCHEMA_VERSION = 1;
|
|
233862
|
+
var GUC_NAME_REGEX = /^[a-z][a-z0-9_]*$/;
|
|
233863
|
+
var FORBIDDEN_VALUE_CHARS = /[\n\r\0]/;
|
|
233864
|
+
var SCHEMA = {
|
|
233865
|
+
server: {
|
|
233866
|
+
port: {
|
|
233867
|
+
type: "int",
|
|
233868
|
+
default: 8432,
|
|
233869
|
+
env: ["AUTOPG_PORT", "PGSERVE_PORT"],
|
|
233870
|
+
range: [1, 65535],
|
|
233871
|
+
description: "Router TCP port (clients connect here)"
|
|
233872
|
+
},
|
|
233873
|
+
host: {
|
|
233874
|
+
type: "string",
|
|
233875
|
+
default: "127.0.0.1",
|
|
233876
|
+
env: ["AUTOPG_HOST", "PGSERVE_HOST"],
|
|
233877
|
+
description: "Bind address for the router"
|
|
233878
|
+
},
|
|
233879
|
+
pgPort: {
|
|
233880
|
+
type: "int",
|
|
233881
|
+
default: 6432,
|
|
233882
|
+
env: ["AUTOPG_PG_PORT", "PGSERVE_PG_PORT"],
|
|
233883
|
+
range: [1, 65535],
|
|
233884
|
+
description: "Internal PostgreSQL backend port"
|
|
233885
|
+
},
|
|
233886
|
+
pgSocketPath: {
|
|
233887
|
+
type: "string",
|
|
233888
|
+
default: "",
|
|
233889
|
+
env: ["AUTOPG_PG_SOCKET", "PGSERVE_PG_SOCKET"],
|
|
233890
|
+
description: "Unix socket path for backend (empty = TCP only)",
|
|
233891
|
+
nullable: true
|
|
233892
|
+
},
|
|
233893
|
+
pgUser: {
|
|
233894
|
+
type: "string",
|
|
233895
|
+
default: "postgres",
|
|
233896
|
+
env: ["AUTOPG_PG_USER", "PGSERVE_PG_USER"],
|
|
233897
|
+
description: "Backend superuser"
|
|
233898
|
+
},
|
|
233899
|
+
pgPassword: {
|
|
233900
|
+
type: "string",
|
|
233901
|
+
default: "postgres",
|
|
233902
|
+
env: ["AUTOPG_PG_PASSWORD", "PGSERVE_PG_PASSWORD"],
|
|
233903
|
+
secret: true,
|
|
233904
|
+
description: "Backend superuser password (file is chmod 0600)"
|
|
233905
|
+
}
|
|
233906
|
+
},
|
|
233907
|
+
runtime: {
|
|
233908
|
+
logLevel: {
|
|
233909
|
+
type: "enum",
|
|
233910
|
+
default: "info",
|
|
233911
|
+
enum: ["debug", "info", "warn", "error"],
|
|
233912
|
+
env: ["AUTOPG_LOG_LEVEL", "PGSERVE_LOG_LEVEL", "LOG_LEVEL"],
|
|
233913
|
+
description: "Log verbosity"
|
|
233914
|
+
},
|
|
233915
|
+
autoProvision: {
|
|
233916
|
+
type: "bool",
|
|
233917
|
+
default: true,
|
|
233918
|
+
env: ["AUTOPG_AUTO_PROVISION", "PGSERVE_AUTO_PROVISION"],
|
|
233919
|
+
description: "Auto-create missing databases on first connect"
|
|
233920
|
+
},
|
|
233921
|
+
enablePgvector: {
|
|
233922
|
+
type: "bool",
|
|
233923
|
+
default: false,
|
|
233924
|
+
env: ["AUTOPG_ENABLE_PGVECTOR", "PGSERVE_ENABLE_PGVECTOR"],
|
|
233925
|
+
description: "Load pgvector extension on database create"
|
|
233926
|
+
},
|
|
233927
|
+
dataDir: {
|
|
233928
|
+
type: "string",
|
|
233929
|
+
default: "",
|
|
233930
|
+
env: ["AUTOPG_DATA_DIR", "PGSERVE_DATA_DIR"],
|
|
233931
|
+
description: "PG cluster data directory (empty = <configDir>/data)",
|
|
233932
|
+
nullable: true
|
|
233933
|
+
},
|
|
233934
|
+
cluster: {
|
|
233935
|
+
type: "enum",
|
|
233936
|
+
default: "auto",
|
|
233937
|
+
enum: ["auto", "on", "off"],
|
|
233938
|
+
env: ["AUTOPG_CLUSTER", "PGSERVE_CLUSTER"],
|
|
233939
|
+
description: "Cluster mode (auto = on for multi-core hosts)"
|
|
233940
|
+
},
|
|
233941
|
+
workers: {
|
|
233942
|
+
type: "int",
|
|
233943
|
+
default: 0,
|
|
233944
|
+
range: [0, 256],
|
|
233945
|
+
env: ["AUTOPG_WORKERS", "PGSERVE_WORKERS"],
|
|
233946
|
+
description: "Worker processes (0 = CPU cores)"
|
|
233947
|
+
},
|
|
233948
|
+
ramMode: {
|
|
233949
|
+
type: "bool",
|
|
233950
|
+
default: false,
|
|
233951
|
+
env: ["AUTOPG_RAM", "PGSERVE_RAM"],
|
|
233952
|
+
description: "Use /dev/shm storage (Linux only, ~2x faster)"
|
|
233953
|
+
},
|
|
233954
|
+
statsDashboard: {
|
|
233955
|
+
type: "bool",
|
|
233956
|
+
default: true,
|
|
233957
|
+
env: ["AUTOPG_STATS", "PGSERVE_STATS"],
|
|
233958
|
+
description: "Show TTY stats dashboard when running in foreground"
|
|
233959
|
+
}
|
|
233960
|
+
},
|
|
233961
|
+
sync: {
|
|
233962
|
+
enabled: {
|
|
233963
|
+
type: "bool",
|
|
233964
|
+
default: false,
|
|
233965
|
+
env: ["AUTOPG_SYNC_ENABLED", "PGSERVE_SYNC_ENABLED"],
|
|
233966
|
+
description: "Enable WAL-based logical replication"
|
|
233967
|
+
},
|
|
233968
|
+
url: {
|
|
233969
|
+
type: "string",
|
|
233970
|
+
default: "",
|
|
233971
|
+
env: ["AUTOPG_SYNC_TO", "PGSERVE_SYNC_TO"],
|
|
233972
|
+
description: "Upstream PostgreSQL URL for replication (--sync-to)",
|
|
233973
|
+
secret: true,
|
|
233974
|
+
nullable: true
|
|
233975
|
+
},
|
|
233976
|
+
databases: {
|
|
233977
|
+
type: "string",
|
|
233978
|
+
default: "*",
|
|
233979
|
+
env: ["AUTOPG_SYNC_DATABASES", "PGSERVE_SYNC_DATABASES"],
|
|
233980
|
+
description: "Database glob patterns to sync, comma-separated (--sync-databases)"
|
|
233981
|
+
}
|
|
233982
|
+
},
|
|
233983
|
+
supervision: {
|
|
233984
|
+
maxMemory: {
|
|
233985
|
+
type: "string",
|
|
233986
|
+
default: "4G",
|
|
233987
|
+
env: ["AUTOPG_MAX_MEMORY", "PGSERVE_MAX_MEMORY"],
|
|
233988
|
+
description: "pm2 memory ceiling (e.g. 4G, 8G)"
|
|
233989
|
+
},
|
|
233990
|
+
maxRestarts: {
|
|
233991
|
+
type: "int",
|
|
233992
|
+
default: 50,
|
|
233993
|
+
env: ["AUTOPG_MAX_RESTARTS", "PGSERVE_MAX_RESTARTS"],
|
|
233994
|
+
range: [1, 1000],
|
|
233995
|
+
description: "pm2 max rapid restarts before giving up"
|
|
233996
|
+
},
|
|
233997
|
+
minUptimeMs: {
|
|
233998
|
+
type: "int",
|
|
233999
|
+
default: 1e4,
|
|
234000
|
+
env: ["AUTOPG_MIN_UPTIME_MS", "PGSERVE_MIN_UPTIME_MS"],
|
|
234001
|
+
range: [0, 600000],
|
|
234002
|
+
description: "pm2 min uptime to count as a healthy start"
|
|
234003
|
+
},
|
|
234004
|
+
restartDelayMs: {
|
|
234005
|
+
type: "int",
|
|
234006
|
+
default: 4000,
|
|
234007
|
+
range: [0, 600000],
|
|
234008
|
+
env: ["AUTOPG_RESTART_DELAY_MS", "PGSERVE_RESTART_DELAY_MS"],
|
|
234009
|
+
description: "pm2 fixed delay before each restart"
|
|
234010
|
+
},
|
|
234011
|
+
expBackoffRestartDelayMs: {
|
|
234012
|
+
type: "int",
|
|
234013
|
+
default: 100,
|
|
234014
|
+
range: [0, 600000],
|
|
234015
|
+
env: ["AUTOPG_EXP_BACKOFF_DELAY_MS", "PGSERVE_EXP_BACKOFF_DELAY_MS"],
|
|
234016
|
+
description: "pm2 initial exponential-backoff delay"
|
|
234017
|
+
},
|
|
234018
|
+
expBackoffMaxMs: {
|
|
234019
|
+
type: "int",
|
|
234020
|
+
default: 60000,
|
|
234021
|
+
range: [1000, 600000],
|
|
234022
|
+
env: ["AUTOPG_EXP_BACKOFF_MAX_MS", "PGSERVE_EXP_BACKOFF_MAX_MS"],
|
|
234023
|
+
description: "pm2 exponential-backoff ceiling (ramp cap ~60s)"
|
|
234024
|
+
},
|
|
234025
|
+
killTimeoutMs: {
|
|
234026
|
+
type: "int",
|
|
234027
|
+
default: 60000,
|
|
234028
|
+
env: ["AUTOPG_KILL_TIMEOUT_MS", "PGSERVE_KILL_TIMEOUT_MS"],
|
|
234029
|
+
range: [1000, 600000],
|
|
234030
|
+
description: "Graceful shutdown window before SIGKILL"
|
|
234031
|
+
},
|
|
234032
|
+
logDateFormat: {
|
|
234033
|
+
type: "string",
|
|
234034
|
+
default: "YYYY-MM-DD HH:mm:ss.SSS",
|
|
234035
|
+
env: ["AUTOPG_LOG_DATE_FORMAT", "PGSERVE_LOG_DATE_FORMAT"],
|
|
234036
|
+
description: "pm2 log timestamp format string"
|
|
234037
|
+
}
|
|
234038
|
+
},
|
|
234039
|
+
security: {
|
|
234040
|
+
handshakeDeadlineMs: {
|
|
234041
|
+
type: "int",
|
|
234042
|
+
default: 5000,
|
|
234043
|
+
range: [100, 60000],
|
|
234044
|
+
env: ["AUTOPG_HANDSHAKE_DEADLINE_MS", "PGSERVE_HANDSHAKE_DEADLINE_MS"],
|
|
234045
|
+
description: "Control-socket peer handshake deadline before forced close"
|
|
234046
|
+
}
|
|
234047
|
+
},
|
|
234048
|
+
audit: {
|
|
234049
|
+
target: {
|
|
234050
|
+
type: "string",
|
|
234051
|
+
default: "",
|
|
234052
|
+
env: ["AUTOPG_AUDIT_TARGET", "PGSERVE_AUDIT_TARGET"],
|
|
234053
|
+
description: "Audit event destination (JSONL file path or HTTP endpoint)",
|
|
234054
|
+
nullable: true
|
|
234055
|
+
}
|
|
234056
|
+
},
|
|
234057
|
+
postgres: {
|
|
234058
|
+
max_connections: {
|
|
234059
|
+
type: "int",
|
|
234060
|
+
default: 1000,
|
|
234061
|
+
range: [1, 262143],
|
|
234062
|
+
guc: true,
|
|
234063
|
+
description: "Maximum concurrent connections"
|
|
234064
|
+
},
|
|
234065
|
+
shared_buffers: {
|
|
234066
|
+
type: "string",
|
|
234067
|
+
default: "128MB",
|
|
234068
|
+
guc: true,
|
|
234069
|
+
description: "Shared memory buffer pool"
|
|
234070
|
+
},
|
|
234071
|
+
work_mem: {
|
|
234072
|
+
type: "string",
|
|
234073
|
+
default: "4MB",
|
|
234074
|
+
guc: true,
|
|
234075
|
+
description: "Per-operation work memory"
|
|
234076
|
+
},
|
|
234077
|
+
maintenance_work_mem: {
|
|
234078
|
+
type: "string",
|
|
234079
|
+
default: "64MB",
|
|
234080
|
+
guc: true,
|
|
234081
|
+
description: "Memory for VACUUM / CREATE INDEX"
|
|
234082
|
+
},
|
|
234083
|
+
effective_cache_size: {
|
|
234084
|
+
type: "string",
|
|
234085
|
+
default: "4GB",
|
|
234086
|
+
guc: true,
|
|
234087
|
+
description: "Planner estimate of OS cache"
|
|
234088
|
+
},
|
|
234089
|
+
wal_level: {
|
|
234090
|
+
type: "enum",
|
|
234091
|
+
default: "logical",
|
|
234092
|
+
enum: ["minimal", "replica", "logical"],
|
|
234093
|
+
guc: true,
|
|
234094
|
+
description: "WAL detail level (logical = replication-ready)"
|
|
234095
|
+
},
|
|
234096
|
+
max_replication_slots: {
|
|
234097
|
+
type: "int",
|
|
234098
|
+
default: 10,
|
|
234099
|
+
range: [0, 1000],
|
|
234100
|
+
guc: true,
|
|
234101
|
+
description: "Max replication slots"
|
|
234102
|
+
},
|
|
234103
|
+
max_wal_senders: {
|
|
234104
|
+
type: "int",
|
|
234105
|
+
default: 10,
|
|
234106
|
+
range: [0, 1000],
|
|
234107
|
+
guc: true,
|
|
234108
|
+
description: "Max WAL sender processes"
|
|
234109
|
+
},
|
|
234110
|
+
wal_keep_size: {
|
|
234111
|
+
type: "string",
|
|
234112
|
+
default: "512MB",
|
|
234113
|
+
guc: true,
|
|
234114
|
+
description: "WAL retention for replicas to catch up"
|
|
234115
|
+
},
|
|
234116
|
+
log_statement: {
|
|
234117
|
+
type: "enum",
|
|
234118
|
+
default: "none",
|
|
234119
|
+
enum: ["none", "ddl", "mod", "all"],
|
|
234120
|
+
guc: true,
|
|
234121
|
+
description: "SQL statement logging level"
|
|
234122
|
+
},
|
|
234123
|
+
log_min_duration_statement: {
|
|
234124
|
+
type: "int",
|
|
234125
|
+
default: -1,
|
|
234126
|
+
range: [-1, 2147483647],
|
|
234127
|
+
guc: true,
|
|
234128
|
+
description: "Slow query threshold (ms, -1 = off)"
|
|
234129
|
+
},
|
|
234130
|
+
statement_timeout: {
|
|
234131
|
+
type: "int",
|
|
234132
|
+
default: 0,
|
|
234133
|
+
range: [0, 2147483647],
|
|
234134
|
+
guc: true,
|
|
234135
|
+
description: "Statement timeout (ms, 0 = none)"
|
|
234136
|
+
},
|
|
234137
|
+
idle_in_transaction_session_timeout: {
|
|
234138
|
+
type: "int",
|
|
234139
|
+
default: 0,
|
|
234140
|
+
range: [0, 2147483647],
|
|
234141
|
+
guc: true,
|
|
234142
|
+
description: "Idle-in-transaction timeout (ms, 0 = none)"
|
|
234143
|
+
},
|
|
234144
|
+
autovacuum: {
|
|
234145
|
+
type: "bool",
|
|
234146
|
+
default: true,
|
|
234147
|
+
guc: true,
|
|
234148
|
+
description: "Enable autovacuum daemon"
|
|
234149
|
+
},
|
|
234150
|
+
_extra: {
|
|
234151
|
+
type: "guc_map",
|
|
234152
|
+
default: {},
|
|
234153
|
+
description: "Raw passthrough GUC map (key=value applied as -c flags)"
|
|
234154
|
+
}
|
|
234155
|
+
},
|
|
234156
|
+
ui: {
|
|
234157
|
+
theme: {
|
|
234158
|
+
type: "enum",
|
|
234159
|
+
default: "mdr",
|
|
234160
|
+
enum: ["mdr", "lumon"],
|
|
234161
|
+
description: "Console theme"
|
|
234162
|
+
},
|
|
234163
|
+
phosphor: {
|
|
234164
|
+
type: "enum",
|
|
234165
|
+
default: "amber",
|
|
234166
|
+
enum: ["amber", "green", "white"],
|
|
234167
|
+
description: "CRT phosphor color"
|
|
234168
|
+
},
|
|
234169
|
+
density: {
|
|
234170
|
+
type: "enum",
|
|
234171
|
+
default: "comfortable",
|
|
234172
|
+
enum: ["compact", "comfortable", "spacious"],
|
|
234173
|
+
description: "Layout density"
|
|
234174
|
+
},
|
|
234175
|
+
crt: {
|
|
234176
|
+
type: "bool",
|
|
234177
|
+
default: true,
|
|
234178
|
+
description: "CRT scanline effect"
|
|
234179
|
+
}
|
|
234180
|
+
}
|
|
234181
|
+
};
|
|
234182
|
+
function flattenSchema(schema3 = SCHEMA) {
|
|
234183
|
+
const out = {};
|
|
234184
|
+
for (const [section, fields] of Object.entries(schema3)) {
|
|
234185
|
+
for (const [key, descriptor] of Object.entries(fields)) {
|
|
234186
|
+
out[`${section}.${key}`] = descriptor;
|
|
234187
|
+
}
|
|
234188
|
+
}
|
|
234189
|
+
return out;
|
|
234190
|
+
}
|
|
234191
|
+
function buildDefaults(schema3 = SCHEMA) {
|
|
234192
|
+
const out = {};
|
|
234193
|
+
for (const [section, fields] of Object.entries(schema3)) {
|
|
234194
|
+
out[section] = {};
|
|
234195
|
+
for (const [key, descriptor] of Object.entries(fields)) {
|
|
234196
|
+
const def = descriptor.default;
|
|
234197
|
+
if (def && typeof def === "object") {
|
|
234198
|
+
out[section][key] = Array.isArray(def) ? [...def] : { ...def };
|
|
234199
|
+
} else {
|
|
234200
|
+
out[section][key] = def;
|
|
234201
|
+
}
|
|
234202
|
+
}
|
|
234203
|
+
}
|
|
234204
|
+
return out;
|
|
234205
|
+
}
|
|
234206
|
+
module.exports = {
|
|
234207
|
+
SCHEMA,
|
|
234208
|
+
SCHEMA_VERSION,
|
|
234209
|
+
GUC_NAME_REGEX,
|
|
234210
|
+
FORBIDDEN_VALUE_CHARS,
|
|
234211
|
+
flattenSchema,
|
|
234212
|
+
buildDefaults
|
|
234213
|
+
};
|
|
234214
|
+
});
|
|
234215
|
+
|
|
234216
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/settings-loader.cjs
|
|
234217
|
+
var require_settings_loader = __commonJS((exports, module) => {
|
|
234218
|
+
var crypto5 = __require("crypto");
|
|
234219
|
+
var fs9 = __require("fs");
|
|
234220
|
+
var os6 = __require("os");
|
|
234221
|
+
var path2 = __require("path");
|
|
234222
|
+
var { SCHEMA, buildDefaults } = require_settings_schema();
|
|
234223
|
+
var SETTINGS_FILENAME = "settings.json";
|
|
234224
|
+
var EMPTY_FILE_ETAG = "sha256:empty";
|
|
234225
|
+
var _legacyEnvWarningEmitted = false;
|
|
234226
|
+
function getConfigDir() {
|
|
234227
|
+
if (process.env.AUTOPG_CONFIG_DIR)
|
|
234228
|
+
return process.env.AUTOPG_CONFIG_DIR;
|
|
234229
|
+
if (process.env.PGSERVE_CONFIG_DIR)
|
|
234230
|
+
return process.env.PGSERVE_CONFIG_DIR;
|
|
234231
|
+
return path2.join(os6.homedir(), ".autopg");
|
|
234232
|
+
}
|
|
234233
|
+
function getSettingsPath() {
|
|
234234
|
+
return path2.join(getConfigDir(), SETTINGS_FILENAME);
|
|
234235
|
+
}
|
|
234236
|
+
function readSettingsFile(settingsPath = getSettingsPath()) {
|
|
234237
|
+
if (!fs9.existsSync(settingsPath))
|
|
234238
|
+
return { raw: null, parsed: null };
|
|
234239
|
+
const raw = fs9.readFileSync(settingsPath);
|
|
234240
|
+
try {
|
|
234241
|
+
const parsed = JSON.parse(raw.toString("utf8"));
|
|
234242
|
+
return { raw, parsed };
|
|
234243
|
+
} catch (err) {
|
|
234244
|
+
const wrapped = new SyntaxError(`Failed to parse ${settingsPath}: ${err.message}`);
|
|
234245
|
+
wrapped.cause = err;
|
|
234246
|
+
wrapped.path = settingsPath;
|
|
234247
|
+
throw wrapped;
|
|
234248
|
+
}
|
|
234249
|
+
}
|
|
234250
|
+
function computeEtag(rawBytes) {
|
|
234251
|
+
if (!rawBytes || rawBytes.length === 0)
|
|
234252
|
+
return EMPTY_FILE_ETAG;
|
|
234253
|
+
const hash2 = crypto5.createHash("sha256").update(rawBytes).digest("hex");
|
|
234254
|
+
return `sha256:${hash2}`;
|
|
234255
|
+
}
|
|
234256
|
+
function castEnv(descriptor, raw) {
|
|
234257
|
+
switch (descriptor.type) {
|
|
234258
|
+
case "int": {
|
|
234259
|
+
const n2 = Number.parseInt(raw, 10);
|
|
234260
|
+
return Number.isFinite(n2) ? n2 : descriptor.default;
|
|
234261
|
+
}
|
|
234262
|
+
case "bool": {
|
|
234263
|
+
if (raw === "true" || raw === "1")
|
|
234264
|
+
return true;
|
|
234265
|
+
if (raw === "false" || raw === "0")
|
|
234266
|
+
return false;
|
|
234267
|
+
return descriptor.default;
|
|
234268
|
+
}
|
|
234269
|
+
default:
|
|
234270
|
+
return raw;
|
|
234271
|
+
}
|
|
234272
|
+
}
|
|
234273
|
+
function resolveEnv(descriptor, env2, logger6) {
|
|
234274
|
+
if (!Array.isArray(descriptor.env) || descriptor.env.length === 0)
|
|
234275
|
+
return null;
|
|
234276
|
+
for (const name of descriptor.env) {
|
|
234277
|
+
if (env2[name] !== undefined && env2[name] !== "") {
|
|
234278
|
+
const isLegacy = name.startsWith("PGSERVE_");
|
|
234279
|
+
if (isLegacy && !_legacyEnvWarningEmitted) {
|
|
234280
|
+
_legacyEnvWarningEmitted = true;
|
|
234281
|
+
logger6?.warn?.({ env: name }, `${name} is deprecated; prefer ${descriptor.env[0]}`);
|
|
234282
|
+
}
|
|
234283
|
+
return { envName: name, raw: env2[name] };
|
|
234284
|
+
}
|
|
234285
|
+
}
|
|
234286
|
+
return null;
|
|
234287
|
+
}
|
|
234288
|
+
function mergeWithSources({ defaults, fileSettings, env: env2, logger: logger6, schema: schema3 = SCHEMA }) {
|
|
234289
|
+
const settings = {};
|
|
234290
|
+
const sources = {};
|
|
234291
|
+
for (const [section, fields] of Object.entries(schema3)) {
|
|
234292
|
+
settings[section] = {};
|
|
234293
|
+
for (const [field, descriptor] of Object.entries(fields)) {
|
|
234294
|
+
const dotted = `${section}.${field}`;
|
|
234295
|
+
let value = clone(descriptor.default);
|
|
234296
|
+
let source = "default";
|
|
234297
|
+
const fileSection = fileSettings && fileSettings[section];
|
|
234298
|
+
if (fileSection && Object.prototype.hasOwnProperty.call(fileSection, field)) {
|
|
234299
|
+
value = clone(fileSection[field]);
|
|
234300
|
+
source = "file";
|
|
234301
|
+
}
|
|
234302
|
+
const envHit = resolveEnv(descriptor, env2, logger6);
|
|
234303
|
+
if (envHit) {
|
|
234304
|
+
value = castEnv(descriptor, envHit.raw);
|
|
234305
|
+
source = `env:${envHit.envName}`;
|
|
234306
|
+
}
|
|
234307
|
+
settings[section][field] = value;
|
|
234308
|
+
sources[dotted] = source;
|
|
234309
|
+
}
|
|
234310
|
+
}
|
|
234311
|
+
return { settings, sources };
|
|
234312
|
+
}
|
|
234313
|
+
function clone(value) {
|
|
234314
|
+
if (value === null || value === undefined)
|
|
234315
|
+
return value;
|
|
234316
|
+
if (typeof value !== "object")
|
|
234317
|
+
return value;
|
|
234318
|
+
if (Array.isArray(value))
|
|
234319
|
+
return value.map(clone);
|
|
234320
|
+
const out = {};
|
|
234321
|
+
for (const [k2, v2] of Object.entries(value))
|
|
234322
|
+
out[k2] = clone(v2);
|
|
234323
|
+
return out;
|
|
234324
|
+
}
|
|
234325
|
+
function loadEffectiveConfig({
|
|
234326
|
+
schema: schema3 = SCHEMA,
|
|
234327
|
+
env: env2 = process.env,
|
|
234328
|
+
logger: logger6,
|
|
234329
|
+
settingsPath = getSettingsPath()
|
|
234330
|
+
} = {}) {
|
|
234331
|
+
const fallbackLogger = logger6 || {
|
|
234332
|
+
warn: (data, msg) => console.warn(`[autopg] ${msg ?? ""} ${JSON.stringify(data ?? {})}`)
|
|
234333
|
+
};
|
|
234334
|
+
const { raw, parsed } = readSettingsFile(settingsPath);
|
|
234335
|
+
const defaults = buildDefaults(schema3);
|
|
234336
|
+
const { settings, sources } = mergeWithSources({
|
|
234337
|
+
defaults,
|
|
234338
|
+
fileSettings: parsed,
|
|
234339
|
+
env: env2,
|
|
234340
|
+
logger: fallbackLogger,
|
|
234341
|
+
schema: schema3
|
|
234342
|
+
});
|
|
234343
|
+
const etag = computeEtag(raw);
|
|
234344
|
+
return { settings, sources, etag, path: settingsPath };
|
|
234345
|
+
}
|
|
234346
|
+
function resetLegacyEnvWarning() {
|
|
234347
|
+
_legacyEnvWarningEmitted = false;
|
|
234348
|
+
}
|
|
234349
|
+
module.exports = {
|
|
234350
|
+
loadEffectiveConfig,
|
|
234351
|
+
computeEtag,
|
|
234352
|
+
readSettingsFile,
|
|
234353
|
+
getConfigDir,
|
|
234354
|
+
getSettingsPath,
|
|
234355
|
+
EMPTY_FILE_ETAG,
|
|
234356
|
+
SETTINGS_FILENAME,
|
|
234357
|
+
_internals: {
|
|
234358
|
+
castEnv,
|
|
234359
|
+
resolveEnv,
|
|
234360
|
+
mergeWithSources,
|
|
234361
|
+
resetLegacyEnvWarning
|
|
234362
|
+
}
|
|
234363
|
+
};
|
|
234364
|
+
});
|
|
234365
|
+
|
|
234366
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/settings-pg-args.cjs
|
|
234367
|
+
var require_settings_pg_args = __commonJS((exports, module) => {
|
|
234368
|
+
var {
|
|
234369
|
+
GUC_NAME_REGEX,
|
|
234370
|
+
FORBIDDEN_VALUE_CHARS
|
|
234371
|
+
} = require_settings_schema();
|
|
234372
|
+
function validateLeafEntry(name, value, logger6) {
|
|
234373
|
+
if (typeof name !== "string" || !GUC_NAME_REGEX.test(name)) {
|
|
234374
|
+
logger6?.warn?.({ guc: name, value }, `dropping invalid postgres GUC name (must match ${GUC_NAME_REGEX})`);
|
|
234375
|
+
return false;
|
|
234376
|
+
}
|
|
234377
|
+
return assertScalarSafe(name, value, logger6);
|
|
234378
|
+
}
|
|
234379
|
+
function validateExtraGuc(name, value, logger6) {
|
|
234380
|
+
if (typeof name !== "string" || !GUC_NAME_REGEX.test(name)) {
|
|
234381
|
+
logger6?.warn?.({ guc: name, value, source: "_extra" }, `dropping invalid postgres._extra GUC name (must match ${GUC_NAME_REGEX})`);
|
|
234382
|
+
return false;
|
|
234383
|
+
}
|
|
234384
|
+
return assertScalarSafe(`_extra.${name}`, value, logger6);
|
|
234385
|
+
}
|
|
234386
|
+
function assertScalarSafe(label, value, logger6) {
|
|
234387
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
234388
|
+
logger6?.warn?.({ guc: label, value }, "dropping postgres GUC: value must be a scalar primitive (string|number|boolean)");
|
|
234389
|
+
return false;
|
|
234390
|
+
}
|
|
234391
|
+
if (typeof value === "string") {
|
|
234392
|
+
if (FORBIDDEN_VALUE_CHARS.test(value)) {
|
|
234393
|
+
logger6?.warn?.({ guc: label, value }, "dropping postgres GUC: value contains forbidden control character (\\n, \\r, or \\0)");
|
|
234394
|
+
return false;
|
|
234395
|
+
}
|
|
234396
|
+
if (value.startsWith("-")) {
|
|
234397
|
+
logger6?.warn?.({ guc: label, value }, 'dropping postgres GUC: value must not start with "-" (looks like a CLI flag)');
|
|
234398
|
+
return false;
|
|
234399
|
+
}
|
|
234400
|
+
}
|
|
234401
|
+
return true;
|
|
234402
|
+
}
|
|
234403
|
+
function formatGucValue(value) {
|
|
234404
|
+
if (typeof value === "boolean")
|
|
234405
|
+
return value ? "on" : "off";
|
|
234406
|
+
return String(value);
|
|
234407
|
+
}
|
|
234408
|
+
function buildPostgresArgs(postgresSettings, { logger: logger6 } = {}) {
|
|
234409
|
+
const merged = new Map;
|
|
234410
|
+
const extras = postgresSettings && postgresSettings._extra;
|
|
234411
|
+
if (extras && typeof extras === "object" && !Array.isArray(extras)) {
|
|
234412
|
+
for (const [k2, v2] of Object.entries(extras)) {
|
|
234413
|
+
if (validateExtraGuc(k2, v2, logger6)) {
|
|
234414
|
+
merged.set(k2, formatGucValue(v2));
|
|
234415
|
+
}
|
|
234416
|
+
}
|
|
234417
|
+
}
|
|
234418
|
+
if (postgresSettings && typeof postgresSettings === "object") {
|
|
234419
|
+
for (const [k2, v2] of Object.entries(postgresSettings)) {
|
|
234420
|
+
if (k2 === "_extra")
|
|
234421
|
+
continue;
|
|
234422
|
+
if (validateLeafEntry(k2, v2, logger6)) {
|
|
234423
|
+
merged.set(k2, formatGucValue(v2));
|
|
234424
|
+
}
|
|
234425
|
+
}
|
|
234426
|
+
}
|
|
234427
|
+
const args = [];
|
|
234428
|
+
const applied = {};
|
|
234429
|
+
for (const [k2, v2] of merged) {
|
|
234430
|
+
args.push("-c", `${k2}=${v2}`);
|
|
234431
|
+
applied[k2] = v2;
|
|
234432
|
+
}
|
|
234433
|
+
return { args, applied };
|
|
234434
|
+
}
|
|
234435
|
+
module.exports = {
|
|
234436
|
+
buildPostgresArgs,
|
|
234437
|
+
validateLeafEntry,
|
|
234438
|
+
validateExtraGuc,
|
|
234439
|
+
formatGucValue
|
|
234440
|
+
};
|
|
234441
|
+
});
|
|
234442
|
+
|
|
234443
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/postgres.js
|
|
233860
234444
|
import { EventEmitter as EventEmitter4 } from "events";
|
|
233861
234445
|
import os6 from "os";
|
|
233862
234446
|
import path2 from "path";
|
|
@@ -233877,22 +234461,71 @@ function getPlatformKey() {
|
|
|
233877
234461
|
return "linux-arm64";
|
|
233878
234462
|
throw new Error(`Unsupported platform: ${platform3}-${arch2}`);
|
|
233879
234463
|
}
|
|
234464
|
+
function getAutopgRoot() {
|
|
234465
|
+
return process.env.AUTOPG_CONFIG_DIR || process.env.PGSERVE_CONFIG_DIR || path2.join(os6.homedir(), ".autopg");
|
|
234466
|
+
}
|
|
233880
234467
|
function getBinaryCacheDir() {
|
|
233881
234468
|
const platformKey = getPlatformKey();
|
|
233882
|
-
return path2.join(
|
|
234469
|
+
return path2.join(getAutopgRoot(), "bin", platformKey);
|
|
234470
|
+
}
|
|
234471
|
+
function readCachedVersion(cacheDir) {
|
|
234472
|
+
try {
|
|
234473
|
+
return fs9.readFileSync(path2.join(cacheDir, VERSION_MARKER_FILENAME), "utf8").trim();
|
|
234474
|
+
} catch {
|
|
234475
|
+
return null;
|
|
234476
|
+
}
|
|
234477
|
+
}
|
|
234478
|
+
function writeCachedVersion(cacheDir, version3) {
|
|
234479
|
+
try {
|
|
234480
|
+
fs9.writeFileSync(path2.join(cacheDir, VERSION_MARKER_FILENAME), `${version3}
|
|
234481
|
+
`, { mode: 420 });
|
|
234482
|
+
} catch {}
|
|
234483
|
+
}
|
|
234484
|
+
function isCachedValid(cacheBinDir, expectedVersion) {
|
|
234485
|
+
const platform3 = os6.platform();
|
|
234486
|
+
const initdbName = platform3 === "win32" ? "initdb.exe" : "initdb";
|
|
234487
|
+
const postgresName = platform3 === "win32" ? "postgres.exe" : "postgres";
|
|
234488
|
+
if (!fs9.existsSync(path2.join(cacheBinDir, initdbName)))
|
|
234489
|
+
return false;
|
|
234490
|
+
if (!fs9.existsSync(path2.join(cacheBinDir, postgresName)))
|
|
234491
|
+
return false;
|
|
234492
|
+
const cached = readCachedVersion(path2.dirname(cacheBinDir));
|
|
234493
|
+
return cached === expectedVersion;
|
|
234494
|
+
}
|
|
234495
|
+
function migrateLegacyBinaryCache() {
|
|
234496
|
+
const platformKey = getPlatformKey();
|
|
234497
|
+
const newDir = getBinaryCacheDir();
|
|
234498
|
+
if (fs9.existsSync(newDir))
|
|
234499
|
+
return;
|
|
234500
|
+
const oldDir = path2.join(os6.homedir(), ".pgserve", "bin", platformKey);
|
|
234501
|
+
if (!fs9.existsSync(oldDir))
|
|
234502
|
+
return;
|
|
234503
|
+
try {
|
|
234504
|
+
fs9.mkdirSync(path2.dirname(newDir), { recursive: true });
|
|
234505
|
+
fs9.renameSync(oldDir, newDir);
|
|
234506
|
+
console.log(`[pgserve] Migrated binary cache: ${oldDir} \u2192 ${newDir}`);
|
|
234507
|
+
} catch (err) {
|
|
234508
|
+
console.log(`[pgserve] Could not migrate legacy binary cache (${err.code || err.message}); will re-download`);
|
|
234509
|
+
}
|
|
233883
234510
|
}
|
|
233884
234511
|
async function downloadPostgresBinaries() {
|
|
233885
234512
|
const platform3 = os6.platform();
|
|
234513
|
+
migrateLegacyBinaryCache();
|
|
233886
234514
|
const cacheDir = getBinaryCacheDir();
|
|
233887
234515
|
const cacheBinDir = path2.join(cacheDir, "bin");
|
|
233888
|
-
|
|
233889
|
-
const postgresName = platform3 === "win32" ? "postgres.exe" : "postgres";
|
|
233890
|
-
if (fs9.existsSync(path2.join(cacheBinDir, initdbName)) && fs9.existsSync(path2.join(cacheBinDir, postgresName))) {
|
|
234516
|
+
if (isCachedValid(cacheBinDir, PINNED_PG_VERSION)) {
|
|
233891
234517
|
return cacheDir;
|
|
233892
234518
|
}
|
|
234519
|
+
const cachedVersion = readCachedVersion(cacheDir);
|
|
234520
|
+
if (cachedVersion && cachedVersion !== PINNED_PG_VERSION) {
|
|
234521
|
+
console.log(`[pgserve] Cached binaries are version ${cachedVersion}; pinned is ${PINNED_PG_VERSION} \u2014 re-downloading`);
|
|
234522
|
+
try {
|
|
234523
|
+
fs9.rmSync(cacheDir, { recursive: true, force: true });
|
|
234524
|
+
} catch {}
|
|
234525
|
+
}
|
|
233893
234526
|
const platformKey = getPlatformKey();
|
|
233894
234527
|
const pkgName = `@embedded-postgres/${platformKey}`;
|
|
233895
|
-
const pkgVersion =
|
|
234528
|
+
const pkgVersion = PINNED_PG_VERSION;
|
|
233896
234529
|
console.log(`[pgserve] PostgreSQL binaries not found.`);
|
|
233897
234530
|
console.log(`[pgserve] Downloading ${pkgName}@${pkgVersion}...`);
|
|
233898
234531
|
const registryUrl = `https://registry.npmjs.org/${pkgName}`;
|
|
@@ -233944,6 +234577,7 @@ async function downloadPostgresBinaries() {
|
|
|
233944
234577
|
try {
|
|
233945
234578
|
fs9.rmSync(tempDir, { recursive: true, force: true });
|
|
233946
234579
|
} catch {}
|
|
234580
|
+
writeCachedVersion(cacheDir, pkgVersion);
|
|
233947
234581
|
console.log(`[pgserve] PostgreSQL binaries installed to ${cacheDir}`);
|
|
233948
234582
|
return cacheDir;
|
|
233949
234583
|
}
|
|
@@ -234104,8 +234738,10 @@ function findAvailableTcpPort() {
|
|
|
234104
234738
|
server.stop(true);
|
|
234105
234739
|
return port;
|
|
234106
234740
|
}
|
|
234107
|
-
var PostgresManager;
|
|
234741
|
+
var import_settings_loader, import_settings_pg_args, PINNED_PG_VERSION = "18.3.0-beta.17", VERSION_MARKER_FILENAME = ".version", PostgresManager;
|
|
234108
234742
|
var init_postgres2 = __esm(() => {
|
|
234743
|
+
import_settings_loader = __toESM(require_settings_loader(), 1);
|
|
234744
|
+
import_settings_pg_args = __toESM(require_settings_pg_args(), 1);
|
|
234109
234745
|
PostgresManager = class PostgresManager extends EventEmitter4 {
|
|
234110
234746
|
constructor(options = {}) {
|
|
234111
234747
|
super();
|
|
@@ -234335,23 +234971,23 @@ var init_postgres2 = __esm(() => {
|
|
|
234335
234971
|
async _startPostgres() {
|
|
234336
234972
|
await this._ensureNoStalePostmasterLock();
|
|
234337
234973
|
return new Promise((resolve2, reject) => {
|
|
234974
|
+
const { settings } = import_settings_loader.loadEffectiveConfig({ logger: this.logger });
|
|
234975
|
+
const { args: gucArgs, applied: appliedGucs } = import_settings_pg_args.buildPostgresArgs(settings.postgres, { logger: this.logger });
|
|
234338
234976
|
const pgArgs = [
|
|
234339
234977
|
this.binaries.postgres,
|
|
234340
234978
|
"-D",
|
|
234341
234979
|
this.databaseDir,
|
|
234342
234980
|
"-p",
|
|
234343
234981
|
this.port.toString(),
|
|
234344
|
-
|
|
234345
|
-
"max_connections=1000"
|
|
234982
|
+
...gucArgs
|
|
234346
234983
|
];
|
|
234347
234984
|
if (this.socketDir) {
|
|
234348
234985
|
pgArgs.push("-k", this.socketDir);
|
|
234349
234986
|
} else {
|
|
234350
234987
|
pgArgs.push("-k", "");
|
|
234351
234988
|
}
|
|
234352
|
-
if (this.syncEnabled) {
|
|
234353
|
-
|
|
234354
|
-
this.logger.info("Logical replication enabled for sync");
|
|
234989
|
+
if (this.syncEnabled || settings.sync?.enabled) {
|
|
234990
|
+
this.logger.info({ walLevel: appliedGucs.wal_level }, "Logical replication enabled for sync");
|
|
234355
234991
|
}
|
|
234356
234992
|
this.process = Bun.spawn(buildCommand(pgArgs, this.binaries.libDir), {
|
|
234357
234993
|
env: buildSpawnEnv(this.binaries.libDir),
|
|
@@ -234829,7 +235465,7 @@ Output: ${startupOutput}`));
|
|
|
234829
235465
|
};
|
|
234830
235466
|
});
|
|
234831
235467
|
|
|
234832
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
235468
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/logger.js
|
|
234833
235469
|
function formatTime2() {
|
|
234834
235470
|
const now = new Date;
|
|
234835
235471
|
return `${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}:${String(now.getSeconds()).padStart(2, "0")}`;
|
|
@@ -234893,7 +235529,7 @@ var init_logger4 = __esm(() => {
|
|
|
234893
235529
|
LEVELS = { debug: 10, info: 20, warn: 30, error: 40 };
|
|
234894
235530
|
});
|
|
234895
235531
|
|
|
234896
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
235532
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/sync.js
|
|
234897
235533
|
var {SQL: SQL2 } = globalThis.Bun;
|
|
234898
235534
|
function matchesPattern2(dbName, patterns) {
|
|
234899
235535
|
if (!patterns || patterns.length === 0)
|
|
@@ -235110,7 +235746,7 @@ var init_sync = __esm(() => {
|
|
|
235110
235746
|
init_logger4();
|
|
235111
235747
|
});
|
|
235112
235748
|
|
|
235113
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
235749
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/pg-wire.js
|
|
235114
235750
|
import { createHash as createHash7 } from "crypto";
|
|
235115
235751
|
|
|
235116
235752
|
class PgWireClient {
|
|
@@ -235682,7 +236318,7 @@ var init_pg_wire = __esm(() => {
|
|
|
235682
236318
|
};
|
|
235683
236319
|
});
|
|
235684
236320
|
|
|
235685
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
236321
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/restore.js
|
|
235686
236322
|
function matchesPattern3(dbName, patterns) {
|
|
235687
236323
|
if (!patterns || patterns.length === 0)
|
|
235688
236324
|
return true;
|
|
@@ -236035,7 +236671,7 @@ var init_restore = __esm(() => {
|
|
|
236035
236671
|
init_logger4();
|
|
236036
236672
|
});
|
|
236037
236673
|
|
|
236038
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
236674
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/dashboard.js
|
|
236039
236675
|
import { readFileSync as readFileSync3 } from "fs";
|
|
236040
236676
|
import { join as join14, dirname as dirname5 } from "path";
|
|
236041
236677
|
import { fileURLToPath } from "url";
|
|
@@ -236179,7 +236815,7 @@ var init_dashboard = __esm(() => {
|
|
|
236179
236815
|
};
|
|
236180
236816
|
});
|
|
236181
236817
|
|
|
236182
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
236818
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/protocol.js
|
|
236183
236819
|
function parseStartupMessage(data, fastPath = true) {
|
|
236184
236820
|
const length = data.readInt32BE(0);
|
|
236185
236821
|
const version4 = data.readInt32BE(4);
|
|
@@ -236332,7 +236968,7 @@ function buildErrorResponse({ severity = "FATAL", sqlstate, message: message2 })
|
|
|
236332
236968
|
var PROTOCOL_VERSION_3 = 196608;
|
|
236333
236969
|
var init_protocol = () => {};
|
|
236334
236970
|
|
|
236335
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
236971
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/router.js
|
|
236336
236972
|
import fs10 from "fs";
|
|
236337
236973
|
import { EventEmitter as EventEmitter5 } from "events";
|
|
236338
236974
|
function flushPending(target, pending) {
|
|
@@ -236668,7 +237304,7 @@ var init_router = __esm(() => {
|
|
|
236668
237304
|
};
|
|
236669
237305
|
});
|
|
236670
237306
|
|
|
236671
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
237307
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/stats-collector.js
|
|
236672
237308
|
class StatsCollector {
|
|
236673
237309
|
constructor(options = {}) {
|
|
236674
237310
|
this.pgManager = options.pgManager;
|
|
@@ -236987,7 +237623,7 @@ class StatsCollector {
|
|
|
236987
237623
|
}
|
|
236988
237624
|
var CPU_SAMPLE_MIN_INTERVAL_MS = 100, PROC_DISKSTATS_MIN_FIELDS = 14;
|
|
236989
237625
|
|
|
236990
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
237626
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/stats-dashboard.js
|
|
236991
237627
|
class StatsDashboard {
|
|
236992
237628
|
constructor(options = {}) {
|
|
236993
237629
|
this.enabled = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
@@ -237251,7 +237887,7 @@ var init_stats_dashboard = __esm(() => {
|
|
|
237251
237887
|
};
|
|
237252
237888
|
});
|
|
237253
237889
|
|
|
237254
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
237890
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/audit.js
|
|
237255
237891
|
import fs11 from "fs";
|
|
237256
237892
|
import os7 from "os";
|
|
237257
237893
|
import path3 from "path";
|
|
@@ -237347,7 +237983,7 @@ var init_audit = __esm(() => {
|
|
|
237347
237983
|
});
|
|
237348
237984
|
});
|
|
237349
237985
|
|
|
237350
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
237986
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/fingerprint.js
|
|
237351
237987
|
import crypto6 from "crypto";
|
|
237352
237988
|
import { execFileSync } from "child_process";
|
|
237353
237989
|
import fs12 from "fs";
|
|
@@ -237626,7 +238262,7 @@ var init_fingerprint = __esm(() => {
|
|
|
237626
238262
|
init_audit();
|
|
237627
238263
|
});
|
|
237628
238264
|
|
|
237629
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
238265
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/tokens.js
|
|
237630
238266
|
import crypto7 from "crypto";
|
|
237631
238267
|
function mintToken() {
|
|
237632
238268
|
const id = crypto7.randomBytes(TOKEN_ID_BYTES).toString("hex");
|
|
@@ -237680,7 +238316,7 @@ var init_tokens = __esm(() => {
|
|
|
237680
238316
|
FP_RE = /^[0-9a-f]{12}$/;
|
|
237681
238317
|
});
|
|
237682
238318
|
|
|
237683
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
238319
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/control-db.js
|
|
237684
238320
|
function query(client, text3, params = [], opts = {}) {
|
|
237685
238321
|
if (client.supportsQueryOptions && opts && Object.keys(opts).length > 0) {
|
|
237686
238322
|
return client.query(text3, params, opts);
|
|
@@ -237817,7 +238453,7 @@ var init_control_db = __esm(() => {
|
|
|
237817
238453
|
init_tokens();
|
|
237818
238454
|
});
|
|
237819
238455
|
|
|
237820
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
238456
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/admin-client.js
|
|
237821
238457
|
var {SQL: SQL3 } = globalThis.Bun;
|
|
237822
238458
|
import fs13 from "fs";
|
|
237823
238459
|
import path5 from "path";
|
|
@@ -237960,7 +238596,7 @@ function removeAdminDiscovery(controlSocketDir) {
|
|
|
237960
238596
|
}
|
|
237961
238597
|
var init_admin_client = () => {};
|
|
237962
238598
|
|
|
237963
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
238599
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/tenancy.js
|
|
237964
238600
|
function sanitizeName(name) {
|
|
237965
238601
|
const raw = (typeof name === "string" ? name : "").toLowerCase();
|
|
237966
238602
|
const collapsed = raw.replace(/[^a-z0-9]+/g, "_");
|
|
@@ -237984,7 +238620,7 @@ function isFingerprintEnforcementDisabled(env2 = process.env) {
|
|
|
237984
238620
|
}
|
|
237985
238621
|
var KILL_SWITCH_ENV = "PGSERVE_DISABLE_FINGERPRINT_ENFORCEMENT", NAME_TRUNCATE = 30, MAX_DB_IDENT = 63;
|
|
237986
238622
|
|
|
237987
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
238623
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/daemon-shared.js
|
|
237988
238624
|
function flushPending2(target, pending) {
|
|
237989
238625
|
const written = target.write(pending);
|
|
237990
238626
|
if (written === pending.byteLength)
|
|
@@ -237994,7 +238630,7 @@ function flushPending2(target, pending) {
|
|
|
237994
238630
|
return pending.subarray(written);
|
|
237995
238631
|
}
|
|
237996
238632
|
|
|
237997
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
238633
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/daemon-control.js
|
|
237998
238634
|
import fs14 from "fs";
|
|
237999
238635
|
function attachControlHandlers(PgserveDaemon) {
|
|
238000
238636
|
PgserveDaemon.prototype.handleSocketOpen = handleSocketOpen;
|
|
@@ -238329,7 +238965,7 @@ var init_daemon_control = __esm(() => {
|
|
|
238329
238965
|
MAX_STARTUP_BUFFER_SIZE2 = 1024 * 1024;
|
|
238330
238966
|
});
|
|
238331
238967
|
|
|
238332
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
238968
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/daemon-tcp.js
|
|
238333
238969
|
import fs15 from "fs";
|
|
238334
238970
|
function attachTcpHandlers(PgserveDaemon) {
|
|
238335
238971
|
PgserveDaemon.prototype.bindTcpListener = bindTcpListener;
|
|
@@ -238598,7 +239234,7 @@ var init_daemon_tcp = __esm(() => {
|
|
|
238598
239234
|
MAX_STARTUP_BUFFER_SIZE3 = 1024 * 1024;
|
|
238599
239235
|
});
|
|
238600
239236
|
|
|
238601
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
239237
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/gc.js
|
|
238602
239238
|
function defaultIsProcessAlive(pid) {
|
|
238603
239239
|
if (!Number.isInteger(pid) || pid <= 0)
|
|
238604
239240
|
return false;
|
|
@@ -238814,7 +239450,7 @@ var init_gc = __esm(() => {
|
|
|
238814
239450
|
HOURLY_MS = 60 * 60 * 1000;
|
|
238815
239451
|
});
|
|
238816
239452
|
|
|
238817
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
239453
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/daemon.js
|
|
238818
239454
|
import fs16 from "fs";
|
|
238819
239455
|
import path6 from "path";
|
|
238820
239456
|
import { EventEmitter as EventEmitter6 } from "events";
|
|
@@ -239311,7 +239947,7 @@ var init_daemon = __esm(() => {
|
|
|
239311
239947
|
attachTcpHandlers(PgserveDaemon);
|
|
239312
239948
|
});
|
|
239313
239949
|
|
|
239314
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
239950
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/sdk.js
|
|
239315
239951
|
import { spawn as spawn4 } from "child_process";
|
|
239316
239952
|
import fs17 from "fs";
|
|
239317
239953
|
import path7 from "path";
|
|
@@ -239434,7 +240070,7 @@ var init_sdk4 = __esm(() => {
|
|
|
239434
240070
|
__dirname2 = path7.dirname(fileURLToPath2(import.meta.url));
|
|
239435
240071
|
});
|
|
239436
240072
|
|
|
239437
|
-
// ../../node_modules/.bun/pgserve@2.
|
|
240073
|
+
// ../../node_modules/.bun/pgserve@2.2.0/node_modules/pgserve/src/index.js
|
|
239438
240074
|
var exports_src2 = {};
|
|
239439
240075
|
__export(exports_src2, {
|
|
239440
240076
|
stopDaemon: () => stopDaemon,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automagik/omni",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.260503.1",
|
|
4
4
|
"description": "LLM-optimized CLI for Omni",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
"qrcode-terminal": "^0.12.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@omni/api": "2.260502.
|
|
55
|
-
"@omni/channel-discord": "2.260502.
|
|
56
|
-
"@omni/channel-gupshup": "2.260502.
|
|
57
|
-
"@omni/channel-sdk": "2.260502.
|
|
58
|
-
"@omni/channel-slack": "2.260502.
|
|
59
|
-
"@omni/channel-telegram": "2.260502.
|
|
60
|
-
"@omni/channel-whatsapp": "2.260502.
|
|
61
|
-
"@omni/core": "2.260502.
|
|
62
|
-
"@omni/sdk": "2.260502.
|
|
54
|
+
"@omni/api": "2.260502.2",
|
|
55
|
+
"@omni/channel-discord": "2.260502.2",
|
|
56
|
+
"@omni/channel-gupshup": "2.260502.2",
|
|
57
|
+
"@omni/channel-sdk": "2.260502.2",
|
|
58
|
+
"@omni/channel-slack": "2.260502.2",
|
|
59
|
+
"@omni/channel-telegram": "2.260502.2",
|
|
60
|
+
"@omni/channel-whatsapp": "2.260502.2",
|
|
61
|
+
"@omni/core": "2.260502.2",
|
|
62
|
+
"@omni/sdk": "2.260502.2",
|
|
63
63
|
"@types/node": "^22.10.3",
|
|
64
64
|
"@types/qrcode-terminal": "^0.12.2",
|
|
65
65
|
"typescript": "^5.7.3"
|