gencow 0.1.157 → 0.1.159
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/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -92913,6 +92913,39 @@ async function ensureServiceCreditGrantPolicySchema(params) {
|
|
|
92913
92913
|
}
|
|
92914
92914
|
}
|
|
92915
92915
|
|
|
92916
|
+
// ../server/src/server-platform-ai-stream-bootstrap.ts
|
|
92917
|
+
async function ensurePlatformAiStreamSessionsSchema(params) {
|
|
92918
|
+
await params.rawSql(`
|
|
92919
|
+
CREATE TABLE IF NOT EXISTS platform_ai_stream_sessions (
|
|
92920
|
+
id SERIAL PRIMARY KEY,
|
|
92921
|
+
request_id TEXT NOT NULL UNIQUE,
|
|
92922
|
+
user_id TEXT NOT NULL,
|
|
92923
|
+
app_id INTEGER,
|
|
92924
|
+
app_name TEXT,
|
|
92925
|
+
model TEXT NOT NULL,
|
|
92926
|
+
auth_type TEXT NOT NULL,
|
|
92927
|
+
state TEXT NOT NULL,
|
|
92928
|
+
reserved_credits REAL NOT NULL,
|
|
92929
|
+
estimated_input_tokens INTEGER NOT NULL,
|
|
92930
|
+
estimated_output_tokens INTEGER NOT NULL,
|
|
92931
|
+
actual_input_tokens INTEGER,
|
|
92932
|
+
actual_output_tokens INTEGER,
|
|
92933
|
+
actual_total_tokens INTEGER,
|
|
92934
|
+
credits_captured REAL,
|
|
92935
|
+
provider_request_id TEXT,
|
|
92936
|
+
reservation_ledger_entry_id INTEGER,
|
|
92937
|
+
settlement_owner TEXT,
|
|
92938
|
+
settlement_attempted_at TIMESTAMPTZ,
|
|
92939
|
+
settled_at TIMESTAMPTZ,
|
|
92940
|
+
last_error_code TEXT,
|
|
92941
|
+
last_error_detail TEXT,
|
|
92942
|
+
started_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
92943
|
+
ended_at TIMESTAMPTZ,
|
|
92944
|
+
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
92945
|
+
)
|
|
92946
|
+
`);
|
|
92947
|
+
}
|
|
92948
|
+
|
|
92916
92949
|
// ../server/src/server-platform-analytics-bootstrap.ts
|
|
92917
92950
|
async function ensurePlatformAnalyticsSchema(params) {
|
|
92918
92951
|
await params.rawSql(`CREATE TABLE IF NOT EXISTS analytics_sites (
|
|
@@ -92962,6 +92995,9 @@ async function ensurePlatformAnalyticsSchema(params) {
|
|
|
92962
92995
|
metadata_json TEXT NOT NULL DEFAULT '{}'
|
|
92963
92996
|
)`);
|
|
92964
92997
|
await params.rawSql(`CREATE INDEX IF NOT EXISTS analytics_events_site_day_idx ON analytics_events_raw (site_id, day)`);
|
|
92998
|
+
await params.rawSql(
|
|
92999
|
+
`CREATE INDEX IF NOT EXISTS analytics_events_site_occurred_idx ON analytics_events_raw (site_id, occurred_at)`
|
|
93000
|
+
);
|
|
92965
93001
|
await params.rawSql(
|
|
92966
93002
|
`CREATE INDEX IF NOT EXISTS analytics_events_site_received_idx ON analytics_events_raw (site_id, received_at DESC)`
|
|
92967
93003
|
);
|
|
@@ -93263,6 +93299,7 @@ async function ensurePlatformSchemaUpgrade(params) {
|
|
|
93263
93299
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS custom_domain TEXT UNIQUE`);
|
|
93264
93300
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS custom_domain_status TEXT`);
|
|
93265
93301
|
await ensurePlatformAnalyticsSchema({ rawSql: params.rawSql });
|
|
93302
|
+
await ensurePlatformAiStreamSessionsSchema({ rawSql: params.rawSql });
|
|
93266
93303
|
await ensurePlatformNodeSchema({ rawSql: params.rawSql });
|
|
93267
93304
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS status_reason TEXT`);
|
|
93268
93305
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS status_message TEXT`);
|
|
@@ -113276,11 +113313,16 @@ function captureEnvSnapshot() {
|
|
|
113276
113313
|
}
|
|
113277
113314
|
}
|
|
113278
113315
|
}
|
|
113316
|
+
var CAPTURE_AI_STREAM_CONFIG_SNAPSHOT_KEY = "__gencowCaptureAiStreamConfigSnapshot";
|
|
113279
113317
|
function sanitizeSystemEnvVars() {
|
|
113280
113318
|
const captureProviderSecrets = globalThis[CAPTURE_PLATFORM_PROVIDER_SECRET_ENV_SNAPSHOT_KEY];
|
|
113281
113319
|
if (typeof captureProviderSecrets === "function") {
|
|
113282
113320
|
captureProviderSecrets(process.env);
|
|
113283
113321
|
}
|
|
113322
|
+
const captureAiStreamConfig = globalThis[CAPTURE_AI_STREAM_CONFIG_SNAPSHOT_KEY];
|
|
113323
|
+
if (typeof captureAiStreamConfig === "function") {
|
|
113324
|
+
captureAiStreamConfig(process.env);
|
|
113325
|
+
}
|
|
113284
113326
|
let sanitizedCount = 0;
|
|
113285
113327
|
for (const key of SYSTEM_ENV_KEYS) {
|
|
113286
113328
|
if (process.env[key] !== void 0) {
|