gencow 0.1.157 → 0.1.158
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 (
|
|
@@ -93263,6 +93296,7 @@ async function ensurePlatformSchemaUpgrade(params) {
|
|
|
93263
93296
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS custom_domain TEXT UNIQUE`);
|
|
93264
93297
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS custom_domain_status TEXT`);
|
|
93265
93298
|
await ensurePlatformAnalyticsSchema({ rawSql: params.rawSql });
|
|
93299
|
+
await ensurePlatformAiStreamSessionsSchema({ rawSql: params.rawSql });
|
|
93266
93300
|
await ensurePlatformNodeSchema({ rawSql: params.rawSql });
|
|
93267
93301
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS status_reason TEXT`);
|
|
93268
93302
|
await params.rawSql(`ALTER TABLE apps ADD COLUMN IF NOT EXISTS status_message TEXT`);
|
|
@@ -113276,11 +113310,16 @@ function captureEnvSnapshot() {
|
|
|
113276
113310
|
}
|
|
113277
113311
|
}
|
|
113278
113312
|
}
|
|
113313
|
+
var CAPTURE_AI_STREAM_CONFIG_SNAPSHOT_KEY = "__gencowCaptureAiStreamConfigSnapshot";
|
|
113279
113314
|
function sanitizeSystemEnvVars() {
|
|
113280
113315
|
const captureProviderSecrets = globalThis[CAPTURE_PLATFORM_PROVIDER_SECRET_ENV_SNAPSHOT_KEY];
|
|
113281
113316
|
if (typeof captureProviderSecrets === "function") {
|
|
113282
113317
|
captureProviderSecrets(process.env);
|
|
113283
113318
|
}
|
|
113319
|
+
const captureAiStreamConfig = globalThis[CAPTURE_AI_STREAM_CONFIG_SNAPSHOT_KEY];
|
|
113320
|
+
if (typeof captureAiStreamConfig === "function") {
|
|
113321
|
+
captureAiStreamConfig(process.env);
|
|
113322
|
+
}
|
|
113284
113323
|
let sanitizedCount = 0;
|
|
113285
113324
|
for (const key of SYSTEM_ENV_KEYS) {
|
|
113286
113325
|
if (process.env[key] !== void 0) {
|