gencow 0.1.229 → 0.1.230
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 +3 -3
- package/runtime/server.mjs +169 -142
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gencow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.230",
|
|
4
4
|
"description": "Gencow — AI Backend Engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@types/node": "^25.9.5",
|
|
39
39
|
"better-auth": "^1.6.23",
|
|
40
40
|
"@gencow/core": "0.1.44",
|
|
41
|
-
"@gencow/
|
|
42
|
-
"@gencow/
|
|
41
|
+
"@gencow/client": "0.2.7",
|
|
42
|
+
"@gencow/react": "0.2.7"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"prebuild": "pnpm --filter @gencow/migration-contract run build && pnpm --filter @gencow/server run build",
|
package/runtime/server.mjs
CHANGED
|
@@ -106033,7 +106033,7 @@ var require_package = __commonJS({
|
|
|
106033
106033
|
var require_libvips = __commonJS({
|
|
106034
106034
|
"../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/libvips.js"(exports2, module2) {
|
|
106035
106035
|
var { spawnSync: spawnSync2 } = __require("node:child_process");
|
|
106036
|
-
var { createHash:
|
|
106036
|
+
var { createHash: createHash90 } = __require("node:crypto");
|
|
106037
106037
|
var semverCoerce = require_coerce();
|
|
106038
106038
|
var semverGreaterThanOrEqualTo = require_gte();
|
|
106039
106039
|
var semverSatisfies = require_satisfies();
|
|
@@ -106124,7 +106124,7 @@ var require_libvips = __commonJS({
|
|
|
106124
106124
|
}
|
|
106125
106125
|
return false;
|
|
106126
106126
|
};
|
|
106127
|
-
var sha512 = (s3) =>
|
|
106127
|
+
var sha512 = (s3) => createHash90("sha512").update(s3).digest("hex");
|
|
106128
106128
|
var yarnLocator = () => {
|
|
106129
106129
|
try {
|
|
106130
106130
|
const identHash = sha512(`imgsharp-libvips-${buildPlatformArch()}`);
|
|
@@ -153344,6 +153344,19 @@ var init_server_platform_custom_domain_http_entry = __esm({
|
|
|
153344
153344
|
}
|
|
153345
153345
|
});
|
|
153346
153346
|
|
|
153347
|
+
// ../server/dist/custom-domain-route-marker.js
|
|
153348
|
+
import { createHash as createHash24 } from "node:crypto";
|
|
153349
|
+
function buildCustomDomainRouteMarker(host, appName) {
|
|
153350
|
+
return `v1.${createHash24("sha256").update("gencow-domain-route\0").update(host.trim().toLowerCase()).update("\0").update(appName).digest("base64url")}`;
|
|
153351
|
+
}
|
|
153352
|
+
var CUSTOM_DOMAIN_VERIFICATION_PATH;
|
|
153353
|
+
var init_custom_domain_route_marker = __esm({
|
|
153354
|
+
"../server/dist/custom-domain-route-marker.js"() {
|
|
153355
|
+
"use strict";
|
|
153356
|
+
CUSTOM_DOMAIN_VERIFICATION_PATH = "/.well-known/gencow-domain-verification";
|
|
153357
|
+
}
|
|
153358
|
+
});
|
|
153359
|
+
|
|
153347
153360
|
// ../server/dist/server-platform-app-proxy-pre-route.js
|
|
153348
153361
|
function buildAppProjectionBlockedResponse() {
|
|
153349
153362
|
return Response.json({
|
|
@@ -153356,6 +153369,19 @@ async function maybeBuildPlatformAppProxyPreRouteResponse(params) {
|
|
|
153356
153369
|
if (isTlsReadyProbe && await params.findTlsAuthorizableDomainApp?.(params.host)) {
|
|
153357
153370
|
return new Response(null, { status: 204, headers: { "X-Gencow-Domain-Ready": "1" } });
|
|
153358
153371
|
}
|
|
153372
|
+
if (params.requestPath === CUSTOM_DOMAIN_VERIFICATION_PATH && (params.request.method === "GET" || params.request.method === "HEAD")) {
|
|
153373
|
+
const appName = await params.findTlsAuthorizableDomainApp?.(params.host);
|
|
153374
|
+
if (appName) {
|
|
153375
|
+
return new Response(null, {
|
|
153376
|
+
status: 204,
|
|
153377
|
+
headers: {
|
|
153378
|
+
"Cache-Control": "no-store",
|
|
153379
|
+
"X-Content-Type-Options": "nosniff",
|
|
153380
|
+
"X-Gencow-Domain-Verification": buildCustomDomainRouteMarker(params.host, appName)
|
|
153381
|
+
}
|
|
153382
|
+
});
|
|
153383
|
+
}
|
|
153384
|
+
}
|
|
153359
153385
|
const httpEntryResponse = await maybeBuildCustomDomainHttpEntryResponse({
|
|
153360
153386
|
request: params.request,
|
|
153361
153387
|
host: params.host,
|
|
@@ -153369,6 +153395,7 @@ var init_server_platform_app_proxy_pre_route = __esm({
|
|
|
153369
153395
|
"../server/dist/server-platform-app-proxy-pre-route.js"() {
|
|
153370
153396
|
"use strict";
|
|
153371
153397
|
init_server_platform_custom_domain_http_entry();
|
|
153398
|
+
init_custom_domain_route_marker();
|
|
153372
153399
|
}
|
|
153373
153400
|
});
|
|
153374
153401
|
|
|
@@ -166926,7 +166953,7 @@ var init_server_platform_notification_worker_runtime = __esm({
|
|
|
166926
166953
|
});
|
|
166927
166954
|
|
|
166928
166955
|
// ../server/src/server-node-proxy-signature.ts
|
|
166929
|
-
import { createHash as
|
|
166956
|
+
import { createHash as createHash25, createHmac as createHmac9, timingSafeEqual as timingSafeEqual11 } from "crypto";
|
|
166930
166957
|
function sanitizeNodeProxyForwardHeaders(headers) {
|
|
166931
166958
|
const sanitized = new Headers();
|
|
166932
166959
|
for (const [key, value] of headers.entries()) {
|
|
@@ -166949,7 +166976,7 @@ function canonicalSignedHeaderHash2(headers) {
|
|
|
166949
166976
|
const value = headers?.get(name) ?? "";
|
|
166950
166977
|
return `${name}:${value.trim()}`;
|
|
166951
166978
|
}).join("\n");
|
|
166952
|
-
return
|
|
166979
|
+
return createHash25("sha256").update(canonical).digest("base64url");
|
|
166953
166980
|
}
|
|
166954
166981
|
function buildSignaturePayload2(input) {
|
|
166955
166982
|
return [
|
|
@@ -176533,7 +176560,7 @@ var init_postgres_temporal2 = __esm({
|
|
|
176533
176560
|
});
|
|
176534
176561
|
|
|
176535
176562
|
// ../platform/src/deployment-executor-operation.ts
|
|
176536
|
-
import { createHash as
|
|
176563
|
+
import { createHash as createHash26 } from "node:crypto";
|
|
176537
176564
|
function sanitizeDeploymentExecutorWarnings(warnings) {
|
|
176538
176565
|
if (!Array.isArray(warnings) || warnings.length > 1e3) {
|
|
176539
176566
|
throw new Error("DEPLOYMENT_EXECUTOR_RECEIPT_WARNING_INVALID");
|
|
@@ -176589,7 +176616,7 @@ function sanitizeDeploymentExecutorReceipt(input) {
|
|
|
176589
176616
|
};
|
|
176590
176617
|
}
|
|
176591
176618
|
function hashDeploymentExecutorReceipt(receipt) {
|
|
176592
|
-
return
|
|
176619
|
+
return createHash26("sha256").update(JSON.stringify(receipt)).digest("hex");
|
|
176593
176620
|
}
|
|
176594
176621
|
var DEPLOYMENT_EXECUTOR_STATES, SAFE_CODE, SAFE_DETAIL, SECRET_PATTERN, SERVING_ROUTE_EVENT_ID, MAX_RECEIPT_WARNINGS, SAFE_WARNING_PHASE;
|
|
176595
176622
|
var init_deployment_executor_operation = __esm({
|
|
@@ -176619,7 +176646,7 @@ var init_deployment_executor_operation = __esm({
|
|
|
176619
176646
|
});
|
|
176620
176647
|
|
|
176621
176648
|
// ../platform/src/deployment-executor-worker-store.ts
|
|
176622
|
-
import { createHash as
|
|
176649
|
+
import { createHash as createHash27 } from "node:crypto";
|
|
176623
176650
|
import { and as and6, eq as eq7, inArray as inArray3, isNull as isNull2, ne as ne3, sql as sql61 } from "drizzle-orm";
|
|
176624
176651
|
async function hasReadyDeploymentExecutor(input) {
|
|
176625
176652
|
const now = input.now ?? /* @__PURE__ */ new Date();
|
|
@@ -180359,7 +180386,7 @@ var init_deploy_dependency_compat = __esm({
|
|
|
180359
180386
|
});
|
|
180360
180387
|
|
|
180361
180388
|
// ../platform/src/provisioner-cron-sync.ts
|
|
180362
|
-
import { createHash as
|
|
180389
|
+
import { createHash as createHash28, createHmac as createHmac10 } from "crypto";
|
|
180363
180390
|
import { existsSync as existsSync22, mkdtempSync as mkdtempSync4, readFileSync as readFileSync20, rmSync as rmSync4 } from "fs";
|
|
180364
180391
|
import { tmpdir as tmpdir4 } from "os";
|
|
180365
180392
|
import { resolve as resolve50 } from "path";
|
|
@@ -180478,7 +180505,7 @@ function readCronManifest(dataDir) {
|
|
|
180478
180505
|
if (!raw2.sourceHash.startsWith("sha256:")) {
|
|
180479
180506
|
throw new Error("cron manifest sourceHash must be a sha256 string");
|
|
180480
180507
|
}
|
|
180481
|
-
const sourceHash = `sha256:${
|
|
180508
|
+
const sourceHash = `sha256:${createHash28("sha256").update(readFileSync20(sourceFile)).digest("hex")}`;
|
|
180482
180509
|
if (raw2.sourceHash !== sourceHash) {
|
|
180483
180510
|
throw new Error("cron manifest sourceHash does not match cron source");
|
|
180484
180511
|
}
|
|
@@ -180563,7 +180590,7 @@ function withTimeout(promise2, timeoutMs, message) {
|
|
|
180563
180590
|
function buildCacheBustedImportSpecifier(filePath) {
|
|
180564
180591
|
let hash9 = "";
|
|
180565
180592
|
try {
|
|
180566
|
-
hash9 =
|
|
180593
|
+
hash9 = createHash28("sha256").update(readFileSync20(filePath)).digest("hex").slice(0, 16);
|
|
180567
180594
|
} catch {
|
|
180568
180595
|
hash9 = String(Date.now());
|
|
180569
180596
|
}
|
|
@@ -180919,7 +180946,7 @@ var init_tar_buffer_extract = __esm({
|
|
|
180919
180946
|
});
|
|
180920
180947
|
|
|
180921
180948
|
// ../platform/src/app-deployment-artifact-filesystem.ts
|
|
180922
|
-
import { createHash as
|
|
180949
|
+
import { createHash as createHash29 } from "node:crypto";
|
|
180923
180950
|
import { createReadStream } from "node:fs";
|
|
180924
180951
|
import { chmod, cp, lstat as lstat2, mkdir as mkdir5, open as open2, readdir as readdir4 } from "node:fs/promises";
|
|
180925
180952
|
import { relative as relative10, resolve as resolve51, sep } from "node:path";
|
|
@@ -180934,7 +180961,7 @@ function hashArtifactClosure(files) {
|
|
|
180934
180961
|
const canonical = [...files].sort(
|
|
180935
180962
|
(left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0
|
|
180936
180963
|
);
|
|
180937
|
-
return
|
|
180964
|
+
return createHash29("sha256").update(canonical.map((file2) => `${file2.path}\0${file2.size}\0${file2.sha256}
|
|
180938
180965
|
`).join("")).digest("hex");
|
|
180939
180966
|
}
|
|
180940
180967
|
function validateArtifactFiles(files) {
|
|
@@ -180951,7 +180978,7 @@ function validateArtifactFiles(files) {
|
|
|
180951
180978
|
return validated.sort((left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0);
|
|
180952
180979
|
}
|
|
180953
180980
|
async function hashArtifactFile(path4) {
|
|
180954
|
-
const hash9 =
|
|
180981
|
+
const hash9 = createHash29("sha256");
|
|
180955
180982
|
for await (const chunk2 of createReadStream(path4)) hash9.update(chunk2);
|
|
180956
180983
|
return hash9.digest("hex");
|
|
180957
180984
|
}
|
|
@@ -181093,14 +181120,14 @@ var init_app_deployment_artifact_metadata = __esm({
|
|
|
181093
181120
|
});
|
|
181094
181121
|
|
|
181095
181122
|
// ../platform/src/app-deployment-artifact-store.ts
|
|
181096
|
-
import { createHash as
|
|
181123
|
+
import { createHash as createHash30, randomUUID as randomUUID19 } from "node:crypto";
|
|
181097
181124
|
import { chmod as chmod2, mkdir as mkdir6, mkdtemp as mkdtemp2, readFile as readFile5, rename as rename4, rm as rm2, stat as stat7, writeFile as writeFile3 } from "node:fs/promises";
|
|
181098
181125
|
import { join as join15 } from "node:path";
|
|
181099
181126
|
function fail4(code, cause) {
|
|
181100
181127
|
throw new AppDeploymentArtifactError(code, cause === void 0 ? void 0 : { cause });
|
|
181101
181128
|
}
|
|
181102
181129
|
function sha2565(value) {
|
|
181103
|
-
return
|
|
181130
|
+
return createHash30("sha256").update(value).digest("hex");
|
|
181104
181131
|
}
|
|
181105
181132
|
function appScopeSha256(scope) {
|
|
181106
181133
|
const appId = String(scope.appId);
|
|
@@ -181313,7 +181340,7 @@ var init_app_deployment_artifact_store = __esm({
|
|
|
181313
181340
|
});
|
|
181314
181341
|
|
|
181315
181342
|
// ../platform/src/deploy-contract-admission.ts
|
|
181316
|
-
import { createHash as
|
|
181343
|
+
import { createHash as createHash31 } from "node:crypto";
|
|
181317
181344
|
function exactObject(value, fields, label) {
|
|
181318
181345
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
181319
181346
|
throw new Error(`${label} must be an object`);
|
|
@@ -181446,7 +181473,7 @@ function parseStoredDeployClaimV1(contractJson) {
|
|
|
181446
181473
|
}
|
|
181447
181474
|
}
|
|
181448
181475
|
function hashAdmittedDeployClaimV1(claim) {
|
|
181449
|
-
return
|
|
181476
|
+
return createHash31("sha256").update(JSON.stringify(canonicalize(claim))).digest("hex");
|
|
181450
181477
|
}
|
|
181451
181478
|
var MAX_CLAIM_HEADER_BYTES, SHA256_PATTERN, REQUEST_ID_PATTERN, VERSION_PATTERN, DEPLOY_CLAIM_GENERATORS;
|
|
181452
181479
|
var init_deploy_contract_admission = __esm({
|
|
@@ -181462,7 +181489,7 @@ var init_deploy_contract_admission = __esm({
|
|
|
181462
181489
|
});
|
|
181463
181490
|
|
|
181464
181491
|
// ../platform/src/deploy-archive-admission.ts
|
|
181465
|
-
import { createHash as
|
|
181492
|
+
import { createHash as createHash32 } from "node:crypto";
|
|
181466
181493
|
function fail5(code, details) {
|
|
181467
181494
|
throw new DeployArchiveAdmissionError(code, details);
|
|
181468
181495
|
}
|
|
@@ -181479,7 +181506,7 @@ function normalizeEntryPath(rawPath, directory) {
|
|
|
181479
181506
|
return normalized;
|
|
181480
181507
|
}
|
|
181481
181508
|
function sha2567(value) {
|
|
181482
|
-
return
|
|
181509
|
+
return createHash32("sha256").update(value).digest("hex");
|
|
181483
181510
|
}
|
|
181484
181511
|
function equalContractValue(left, right) {
|
|
181485
181512
|
return JSON.stringify(left) === JSON.stringify(right);
|
|
@@ -181566,7 +181593,7 @@ async function inspectDeployArchive(bundle, overrides = {}) {
|
|
|
181566
181593
|
if (uncompressedBytes / bundle.length > limits.maxCompressionRatio) {
|
|
181567
181594
|
streamError ??= new DeployArchiveAdmissionError("DEPLOY_ARCHIVE_COMPRESSION_LIMIT");
|
|
181568
181595
|
}
|
|
181569
|
-
const hash9 =
|
|
181596
|
+
const hash9 = createHash32("sha256");
|
|
181570
181597
|
const chunks = [];
|
|
181571
181598
|
let actualBytes = 0;
|
|
181572
181599
|
const selectedMetadata = isMetadataFile(path4);
|
|
@@ -181813,7 +181840,7 @@ var init_deployment_attempt_lease_scope = __esm({
|
|
|
181813
181840
|
});
|
|
181814
181841
|
|
|
181815
181842
|
// ../platform/src/deployment-attempt-reconciliation.ts
|
|
181816
|
-
import { createHash as
|
|
181843
|
+
import { createHash as createHash33 } from "node:crypto";
|
|
181817
181844
|
import { and as and8, eq as eq10 } from "drizzle-orm";
|
|
181818
181845
|
async function loadDeploymentAttemptByRequestIdentity(input) {
|
|
181819
181846
|
const rows4 = await input.db.select(attemptRowSelection()).from(deployments).where(
|
|
@@ -181822,7 +181849,7 @@ async function loadDeploymentAttemptByRequestIdentity(input) {
|
|
|
181822
181849
|
eq10(deployments.env, input.env),
|
|
181823
181850
|
eq10(
|
|
181824
181851
|
deployments.idempotencyKeyHash,
|
|
181825
|
-
|
|
181852
|
+
createHash33("sha256").update(`deploy-idempotency-v1\0${input.requestId}`).digest("hex")
|
|
181826
181853
|
)
|
|
181827
181854
|
)
|
|
181828
181855
|
).limit(1);
|
|
@@ -181866,12 +181893,12 @@ var init_deployment_attempt_reconciliation = __esm({
|
|
|
181866
181893
|
protocolVersion: deployments.protocolVersion,
|
|
181867
181894
|
declaredRuntime: deployments.declaredRuntime
|
|
181868
181895
|
});
|
|
181869
|
-
hashDeploymentAttemptId = (appId, env2, requestId) =>
|
|
181896
|
+
hashDeploymentAttemptId = (appId, env2, requestId) => createHash33("sha256").update(`deploy-attempt-v1\0${appId}\0${env2}\0${requestId}`).digest("hex");
|
|
181870
181897
|
}
|
|
181871
181898
|
});
|
|
181872
181899
|
|
|
181873
181900
|
// ../platform/src/deployment-attempt-store.ts
|
|
181874
|
-
import { createHash as
|
|
181901
|
+
import { createHash as createHash34, randomUUID as randomUUID20 } from "node:crypto";
|
|
181875
181902
|
import { and as and9, eq as eq11, inArray as inArray5, isNull as isNull4, ne as ne5, sql as sql64 } from "drizzle-orm";
|
|
181876
181903
|
function assertFailureCode(code) {
|
|
181877
181904
|
if (!FAILURE_CODE_PATTERN.test(code)) {
|
|
@@ -181909,7 +181936,7 @@ function requireAttemptRow(rows4, operation) {
|
|
|
181909
181936
|
return row;
|
|
181910
181937
|
}
|
|
181911
181938
|
function hashSourceDeployBundle(bundle) {
|
|
181912
|
-
return
|
|
181939
|
+
return createHash34("sha256").update(bundle).digest("hex");
|
|
181913
181940
|
}
|
|
181914
181941
|
async function preallocateDeploymentAttempt(input) {
|
|
181915
181942
|
const sourceBundleSha256 = hashSourceDeployBundle(input.bundle);
|
|
@@ -182294,8 +182321,8 @@ var init_deployment_attempt_store = __esm({
|
|
|
182294
182321
|
LEGACY_MESSAGE_MAX = 300;
|
|
182295
182322
|
DEPLOYMENT_ATTEMPT_LEASE_TTL_MS = 5 * 6e4;
|
|
182296
182323
|
DEPLOYMENT_ATTEMPT_HEARTBEAT_MS = 2e4;
|
|
182297
|
-
PROCESS_INVOCATION_ID =
|
|
182298
|
-
hashDeploymentRequestId = (requestId) =>
|
|
182324
|
+
PROCESS_INVOCATION_ID = createHash34("sha256").update(`${process.pid}:${process.ppid}:${Date.now()}:${randomUUID20()}`).digest("hex").slice(0, 32);
|
|
182325
|
+
hashDeploymentRequestId = (requestId) => createHash34("sha256").update(`deploy-idempotency-v1\0${requestId}`).digest("hex");
|
|
182299
182326
|
}
|
|
182300
182327
|
});
|
|
182301
182328
|
|
|
@@ -182814,10 +182841,10 @@ var init_drizzle_migration_store = __esm({
|
|
|
182814
182841
|
});
|
|
182815
182842
|
|
|
182816
182843
|
// ../platform/src/migration-execution-plan.ts
|
|
182817
|
-
import { createHash as
|
|
182844
|
+
import { createHash as createHash35 } from "node:crypto";
|
|
182818
182845
|
import { getMigrationsToRun } from "drizzle-orm/migrator.utils";
|
|
182819
182846
|
function fingerprint2(value) {
|
|
182820
|
-
return
|
|
182847
|
+
return createHash35("sha256").update(JSON.stringify(value)).digest("hex");
|
|
182821
182848
|
}
|
|
182822
182849
|
function localFingerprint(migrations) {
|
|
182823
182850
|
return fingerprint2(
|
|
@@ -184466,14 +184493,14 @@ var init_migration_actionable_diagnostic = __esm({
|
|
|
184466
184493
|
});
|
|
184467
184494
|
|
|
184468
184495
|
// ../platform/src/migration-bundle-manifest.ts
|
|
184469
|
-
import { createHash as
|
|
184496
|
+
import { createHash as createHash36 } from "node:crypto";
|
|
184470
184497
|
import { existsSync as existsSync24, lstatSync as lstatSync2, readFileSync as readFileSync21, readdirSync as readdirSync7 } from "node:fs";
|
|
184471
184498
|
import { relative as relative11, resolve as resolve54 } from "node:path";
|
|
184472
184499
|
function fail7(code) {
|
|
184473
184500
|
throw new MigrationBundleManifestError(code);
|
|
184474
184501
|
}
|
|
184475
184502
|
function sha2568(value) {
|
|
184476
|
-
return
|
|
184503
|
+
return createHash36("sha256").update(value).digest("hex");
|
|
184477
184504
|
}
|
|
184478
184505
|
function hasExactKeys(value, keys2) {
|
|
184479
184506
|
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
@@ -186180,7 +186207,7 @@ var init_serving_route_manifest_schema = __esm({
|
|
|
186180
186207
|
});
|
|
186181
186208
|
|
|
186182
186209
|
// ../server/src/serving-route-manifest-contract.ts
|
|
186183
|
-
import { createHash as
|
|
186210
|
+
import { createHash as createHash37, sign as sign3, verify as verify3 } from "node:crypto";
|
|
186184
186211
|
function canonicalValue(input) {
|
|
186185
186212
|
if (Array.isArray(input)) return input.map(canonicalValue);
|
|
186186
186213
|
if (!input || typeof input !== "object") return input;
|
|
@@ -186200,7 +186227,7 @@ function deepFreeze(input) {
|
|
|
186200
186227
|
return input;
|
|
186201
186228
|
}
|
|
186202
186229
|
function sha2569(input) {
|
|
186203
|
-
return
|
|
186230
|
+
return createHash37("sha256").update(input).digest("hex");
|
|
186204
186231
|
}
|
|
186205
186232
|
function buildServingRouteManifestEntry(input) {
|
|
186206
186233
|
return deepFreeze(normalizeServingRouteManifestEntry(input));
|
|
@@ -186220,7 +186247,7 @@ var init_serving_route_manifest_contract = __esm({
|
|
|
186220
186247
|
});
|
|
186221
186248
|
|
|
186222
186249
|
// ../platform/src/app-serving-route-topology-store.ts
|
|
186223
|
-
import { createHash as
|
|
186250
|
+
import { createHash as createHash38 } from "node:crypto";
|
|
186224
186251
|
import { sql as sql65 } from "drizzle-orm";
|
|
186225
186252
|
function fail10(code) {
|
|
186226
186253
|
throw new Error(code);
|
|
@@ -186230,7 +186257,7 @@ function rowsFromResult29(result2) {
|
|
|
186230
186257
|
return result2?.rows ?? [];
|
|
186231
186258
|
}
|
|
186232
186259
|
function hashCanonical(value) {
|
|
186233
|
-
return
|
|
186260
|
+
return createHash38("sha256").update(JSON.stringify(value)).digest("hex");
|
|
186234
186261
|
}
|
|
186235
186262
|
function normalizeTopology(input) {
|
|
186236
186263
|
if (!ENVIRONMENTS.has(input.environment) || !REFERENCE2.test(input.topologyRevision) || input.targetSets.length < 1 || input.targetSets.length > MAX_TARGET_SETS) {
|
|
@@ -186453,7 +186480,7 @@ var init_app_serving_route_receipt_store = __esm({
|
|
|
186453
186480
|
});
|
|
186454
186481
|
|
|
186455
186482
|
// ../platform/src/app-serving-route-outbox-store.ts
|
|
186456
|
-
import { createHash as
|
|
186483
|
+
import { createHash as createHash39 } from "node:crypto";
|
|
186457
186484
|
import { sql as sql67 } from "drizzle-orm";
|
|
186458
186485
|
function fail12(code) {
|
|
186459
186486
|
throw new Error(code);
|
|
@@ -186517,7 +186544,7 @@ function normalizeInput(input) {
|
|
|
186517
186544
|
return { ...decision, entryHash, entryPayload };
|
|
186518
186545
|
}
|
|
186519
186546
|
function routeEventId(input) {
|
|
186520
|
-
const digest4 =
|
|
186547
|
+
const digest4 = createHash39("sha256").update(
|
|
186521
186548
|
JSON.stringify([
|
|
186522
186549
|
2,
|
|
186523
186550
|
input.environment,
|
|
@@ -186982,7 +187009,7 @@ var init_ws_capacity_policy2 = __esm({
|
|
|
186982
187009
|
});
|
|
186983
187010
|
|
|
186984
187011
|
// ../platform/src/app-serving-route-source-compiler.ts
|
|
186985
|
-
import { createHash as
|
|
187012
|
+
import { createHash as createHash40 } from "node:crypto";
|
|
186986
187013
|
function buildAppServingRouteRealtimeSource(input) {
|
|
186987
187014
|
if (typeof input.ownerAccountId !== "string" || input.ownerAccountId.length < 1 || input.ownerAccountId.length > 512 || !PLAN.test(input.plan)) {
|
|
186988
187015
|
return fail13("APP_SERVING_ROUTE_REALTIME_POLICY_INVALID");
|
|
@@ -186992,7 +187019,7 @@ function buildAppServingRouteRealtimeSource(input) {
|
|
|
186992
187019
|
return fail13("APP_SERVING_ROUTE_REALTIME_POLICY_INVALID");
|
|
186993
187020
|
}
|
|
186994
187021
|
return {
|
|
186995
|
-
accountCapacityKey:
|
|
187022
|
+
accountCapacityKey: createHash40("sha256").update(JSON.stringify([1, input.environment, input.ownerAccountId])).digest("hex"),
|
|
186996
187023
|
plan: input.plan,
|
|
186997
187024
|
...limits
|
|
186998
187025
|
};
|
|
@@ -187147,7 +187174,7 @@ var init_deployment_executor_lifecycle_authority = __esm({
|
|
|
187147
187174
|
});
|
|
187148
187175
|
|
|
187149
187176
|
// ../platform/src/app-release-finalize-store.ts
|
|
187150
|
-
import { createHash as
|
|
187177
|
+
import { createHash as createHash41, randomUUID as randomUUID21 } from "node:crypto";
|
|
187151
187178
|
import { and as and13, desc as desc5, eq as eq16, inArray as inArray7, sql as sql70 } from "drizzle-orm";
|
|
187152
187179
|
var init_app_release_finalize_store = __esm({
|
|
187153
187180
|
"../platform/src/app-release-finalize-store.ts"() {
|
|
@@ -187163,7 +187190,7 @@ var init_app_release_finalize_store = __esm({
|
|
|
187163
187190
|
});
|
|
187164
187191
|
|
|
187165
187192
|
// ../platform/src/app-release-store.ts
|
|
187166
|
-
import { createHash as
|
|
187193
|
+
import { createHash as createHash42, randomUUID as randomUUID22 } from "node:crypto";
|
|
187167
187194
|
import { and as and14, eq as eq17 } from "drizzle-orm";
|
|
187168
187195
|
var init_app_release_store = __esm({
|
|
187169
187196
|
"../platform/src/app-release-store.ts"() {
|
|
@@ -187334,7 +187361,7 @@ var init_deployment_executor_store = __esm({
|
|
|
187334
187361
|
});
|
|
187335
187362
|
|
|
187336
187363
|
// ../platform/src/runtime-route-binding-contract.ts
|
|
187337
|
-
import { createHash as
|
|
187364
|
+
import { createHash as createHash43 } from "node:crypto";
|
|
187338
187365
|
function requiredIdentity(value, code) {
|
|
187339
187366
|
const normalized = value.trim();
|
|
187340
187367
|
if (!normalized) throw new Error(code);
|
|
@@ -187369,7 +187396,7 @@ function canonicalPayload(binding) {
|
|
|
187369
187396
|
];
|
|
187370
187397
|
}
|
|
187371
187398
|
function canonicalTenantRouteBindingHash(binding) {
|
|
187372
|
-
return
|
|
187399
|
+
return createHash43("sha256").update(JSON.stringify(canonicalPayload(binding))).digest("hex");
|
|
187373
187400
|
}
|
|
187374
187401
|
function buildCanonicalTenantRouteBinding(input) {
|
|
187375
187402
|
const binding = {
|
|
@@ -187410,7 +187437,7 @@ __export(runtime_route_binding_reader_exports, {
|
|
|
187410
187437
|
loadCanonicalTenantRouteProjectionProof: () => loadCanonicalTenantRouteProjectionProof,
|
|
187411
187438
|
loadCanonicalTenantRouteRemovalTargets: () => loadCanonicalTenantRouteRemovalTargets
|
|
187412
187439
|
});
|
|
187413
|
-
import { createHash as
|
|
187440
|
+
import { createHash as createHash44 } from "node:crypto";
|
|
187414
187441
|
import { and as and16, eq as eq19 } from "drizzle-orm";
|
|
187415
187442
|
function bindingFromRows(rows4) {
|
|
187416
187443
|
if (rows4.length !== 1) {
|
|
@@ -187647,7 +187674,7 @@ function fleetAuthorityDigest(rows4) {
|
|
|
187647
187674
|
row.port,
|
|
187648
187675
|
row.readyContractHash
|
|
187649
187676
|
]).sort((left, right) => JSON.stringify(left).localeCompare(JSON.stringify(right)));
|
|
187650
|
-
return
|
|
187677
|
+
return createHash44("sha256").update(JSON.stringify(evidence)).digest("hex");
|
|
187651
187678
|
}
|
|
187652
187679
|
async function queryFleetAuthorityRows(db) {
|
|
187653
187680
|
return await db.select(fleetSelection()).from(appRuntimeDesiredState).innerJoin(apps, eq19(apps.id, appRuntimeDesiredState.appId)).leftJoin(
|
|
@@ -188031,7 +188058,7 @@ var init_deployment_executor_http_presentation = __esm({
|
|
|
188031
188058
|
});
|
|
188032
188059
|
|
|
188033
188060
|
// ../platform/src/app-delete-operation-store.ts
|
|
188034
|
-
import { createHash as
|
|
188061
|
+
import { createHash as createHash45 } from "node:crypto";
|
|
188035
188062
|
import { and as and17, asc as asc4, desc as desc6, eq as eq20, inArray as inArray9, lt as lt5, lte as lte5, notExists as notExists2, or as or8, sql as sql72 } from "drizzle-orm";
|
|
188036
188063
|
function isAppDeleteTerminalState(state2) {
|
|
188037
188064
|
return APP_DELETE_TERMINAL_STATES.includes(state2);
|
|
@@ -188044,7 +188071,7 @@ function replayOrThrowTerminal(row) {
|
|
|
188044
188071
|
return operation;
|
|
188045
188072
|
}
|
|
188046
188073
|
function digest(value) {
|
|
188047
|
-
return
|
|
188074
|
+
return createHash45("sha256").update(JSON.stringify(value)).digest("hex");
|
|
188048
188075
|
}
|
|
188049
188076
|
function operationId(identityHash) {
|
|
188050
188077
|
return `app_delete_${identityHash.slice(0, 32)}`;
|
|
@@ -188291,12 +188318,12 @@ var init_app_delete_admission = __esm({
|
|
|
188291
188318
|
});
|
|
188292
188319
|
|
|
188293
188320
|
// ../platform/src/deployment-executor-spool.ts
|
|
188294
|
-
import { createHash as
|
|
188321
|
+
import { createHash as createHash46, randomUUID as randomUUID23 } from "node:crypto";
|
|
188295
188322
|
import { constants as fsConstants } from "node:fs";
|
|
188296
188323
|
import { chmod as chmod3, link, mkdir as mkdir7, open as open3, readdir as readdir5, rm as rm3, stat as stat8 } from "node:fs/promises";
|
|
188297
188324
|
import { resolve as resolve55 } from "node:path";
|
|
188298
188325
|
function hashBundle(bundle) {
|
|
188299
|
-
return
|
|
188326
|
+
return createHash46("sha256").update(bundle).digest("hex");
|
|
188300
188327
|
}
|
|
188301
188328
|
function validateAttemptId(attemptId) {
|
|
188302
188329
|
if (!/^[a-zA-Z0-9_-]{8,160}$/u.test(attemptId)) {
|
|
@@ -188752,7 +188779,7 @@ var init_deployment_executor_admission = __esm({
|
|
|
188752
188779
|
});
|
|
188753
188780
|
|
|
188754
188781
|
// ../platform/src/deployment-failure-receipt-store.ts
|
|
188755
|
-
import { createHash as
|
|
188782
|
+
import { createHash as createHash47 } from "node:crypto";
|
|
188756
188783
|
import { and as and20, desc as desc8, eq as eq23, gt as gt5, inArray as inArray12, isNull as isNull6, lte as lte6 } from "drizzle-orm";
|
|
188757
188784
|
async function getOwnedDeploymentFailureReceipt(db, ownerId, correlationId, now = /* @__PURE__ */ new Date()) {
|
|
188758
188785
|
if (!CORRELATION_PATTERN.test(correlationId)) return null;
|
|
@@ -189252,7 +189279,7 @@ var init_provisioner_capacity = __esm({
|
|
|
189252
189279
|
});
|
|
189253
189280
|
|
|
189254
189281
|
// ../platform/src/deployment-runtime-manifest.ts
|
|
189255
|
-
import { createHash as
|
|
189282
|
+
import { createHash as createHash48 } from "crypto";
|
|
189256
189283
|
import { existsSync as existsSync25, readFileSync as readFileSync23, readdirSync as readdirSync8, realpathSync as realpathSync2 } from "fs";
|
|
189257
189284
|
import { createRequire as createRequire3 } from "module";
|
|
189258
189285
|
import { dirname as dirname13, isAbsolute as isAbsolute10, join as join16, relative as relative12, resolve as resolve57 } from "path";
|
|
@@ -189265,18 +189292,18 @@ function safeRealpath(path4) {
|
|
|
189265
189292
|
}
|
|
189266
189293
|
}
|
|
189267
189294
|
function sha256Text(value) {
|
|
189268
|
-
return `sha256:${
|
|
189295
|
+
return `sha256:${createHash48("sha256").update(value).digest("hex")}`;
|
|
189269
189296
|
}
|
|
189270
189297
|
function sha256File(path4) {
|
|
189271
189298
|
try {
|
|
189272
|
-
return `sha256:${
|
|
189299
|
+
return `sha256:${createHash48("sha256").update(readFileSync23(path4)).digest("hex")}`;
|
|
189273
189300
|
} catch {
|
|
189274
189301
|
return "";
|
|
189275
189302
|
}
|
|
189276
189303
|
}
|
|
189277
189304
|
function sha256RuntimeTree(path4) {
|
|
189278
189305
|
if (!existsSync25(path4)) return "";
|
|
189279
|
-
const hash9 =
|
|
189306
|
+
const hash9 = createHash48("sha256");
|
|
189280
189307
|
const walk2 = (currentPath, relativePath) => {
|
|
189281
189308
|
const entries = readdirSync8(currentPath, { withFileTypes: true }).sort(
|
|
189282
189309
|
(left, right) => left.name.localeCompare(right.name)
|
|
@@ -400805,7 +400832,7 @@ var init_runtime_platform_source_closure = __esm({
|
|
|
400805
400832
|
});
|
|
400806
400833
|
|
|
400807
400834
|
// ../platform/src/runtime-release-fingerprint.ts
|
|
400808
|
-
import { createHash as
|
|
400835
|
+
import { createHash as createHash49 } from "crypto";
|
|
400809
400836
|
import { existsSync as existsSync30, lstatSync as lstatSync4, readFileSync as readFileSync28, readdirSync as readdirSync10, realpathSync as realpathSync3 } from "fs";
|
|
400810
400837
|
import { relative as relative14, resolve as resolve62 } from "path";
|
|
400811
400838
|
function safeRealpath2(path4) {
|
|
@@ -400963,7 +400990,7 @@ function collectRuntimeReleaseInstalledPackagePaths(repoRoot2) {
|
|
|
400963
400990
|
return collected.sort((a, b2) => a.name.localeCompare(b2.name));
|
|
400964
400991
|
}
|
|
400965
400992
|
function fingerprintReleaseOwnedNodeModulesRoots(repoRoot2) {
|
|
400966
|
-
const hash9 =
|
|
400993
|
+
const hash9 = createHash49("sha256");
|
|
400967
400994
|
for (const workspacePackage of collectRuntimeReleaseWorkspacePackages(repoRoot2)) {
|
|
400968
400995
|
hash9.update(`workspace:${workspacePackage.name}
|
|
400969
400996
|
`);
|
|
@@ -400977,7 +401004,7 @@ function fingerprintReleaseOwnedNodeModulesRoots(repoRoot2) {
|
|
|
400977
401004
|
return hash9.digest("hex");
|
|
400978
401005
|
}
|
|
400979
401006
|
function buildRuntimeReleaseId(repoRoot2, layoutVersion) {
|
|
400980
|
-
const hash9 =
|
|
401007
|
+
const hash9 = createHash49("sha256");
|
|
400981
401008
|
hash9.update(`runtime-layout-v${layoutVersion}
|
|
400982
401009
|
`);
|
|
400983
401010
|
for (const workspacePackage of collectRuntimeReleaseWorkspacePackages(repoRoot2)) {
|
|
@@ -401057,7 +401084,7 @@ var init_runtime_support_files = __esm({
|
|
|
401057
401084
|
});
|
|
401058
401085
|
|
|
401059
401086
|
// ../platform/src/runtime-generation-publisher.ts
|
|
401060
|
-
import { createHash as
|
|
401087
|
+
import { createHash as createHash50, randomUUID as randomUUID24 } from "crypto";
|
|
401061
401088
|
import {
|
|
401062
401089
|
chmodSync,
|
|
401063
401090
|
closeSync,
|
|
@@ -401237,7 +401264,7 @@ function sha256RuntimePaths(sourceRoot, seeds) {
|
|
|
401237
401264
|
const context2 = {
|
|
401238
401265
|
sourceRoot: canonicalRoot,
|
|
401239
401266
|
visited: /* @__PURE__ */ new Set(),
|
|
401240
|
-
hash:
|
|
401267
|
+
hash: createHash50("sha256")
|
|
401241
401268
|
};
|
|
401242
401269
|
for (const seed of seeds) hashRelativeRuntimePath(context2, seed);
|
|
401243
401270
|
return `sha256:${context2.hash.digest("hex")}`;
|
|
@@ -401255,7 +401282,7 @@ function sha256RuntimeSnapshot(manifest) {
|
|
|
401255
401282
|
return sha256RuntimePaths(sourceRoot, runtimeSnapshotSeeds(manifest, sourceRoot));
|
|
401256
401283
|
}
|
|
401257
401284
|
function runtimeReleaseId(manifestHash, runtimeClosureSha256) {
|
|
401258
|
-
return `sha256:${
|
|
401285
|
+
return `sha256:${createHash50("sha256").update(`${manifestHash}\0${runtimeClosureSha256}`).digest("hex")}`;
|
|
401259
401286
|
}
|
|
401260
401287
|
function prepareRuntimeGenerationManifest(manifest) {
|
|
401261
401288
|
const runtimeClosureSha256 = sha256RuntimeSnapshot(manifest);
|
|
@@ -401494,7 +401521,7 @@ var init_runtime_generation_publisher = __esm({
|
|
|
401494
401521
|
});
|
|
401495
401522
|
|
|
401496
401523
|
// ../platform/src/runtime-generation-store.ts
|
|
401497
|
-
import { createHash as
|
|
401524
|
+
import { createHash as createHash51 } from "crypto";
|
|
401498
401525
|
import { closeSync as closeSync2, existsSync as existsSync33, fsyncSync as fsyncSync2, openSync as openSync2, readFileSync as readFileSync30, writeFileSync as writeFileSync4 } from "fs";
|
|
401499
401526
|
import { resolve as resolve66 } from "path";
|
|
401500
401527
|
function runtimeGenerationFailureReason(error51) {
|
|
@@ -401585,7 +401612,7 @@ function assertLegacyIdentityFieldsAreAbsent(manifest, releaseId, manifestHash)
|
|
|
401585
401612
|
}
|
|
401586
401613
|
}
|
|
401587
401614
|
function sha256File2(path4) {
|
|
401588
|
-
return `sha256:${
|
|
401615
|
+
return `sha256:${createHash51("sha256").update(readFileSync30(path4)).digest("hex")}`;
|
|
401589
401616
|
}
|
|
401590
401617
|
function assertFileHashMatches(path4, expectedSha256, label, manifestHash) {
|
|
401591
401618
|
if (!existsSync33(path4)) {
|
|
@@ -403653,7 +403680,7 @@ var init_app_runtime_exit = __esm({
|
|
|
403653
403680
|
});
|
|
403654
403681
|
|
|
403655
403682
|
// ../platform/src/cowbox-profile-contract.ts
|
|
403656
|
-
import { createHash as
|
|
403683
|
+
import { createHash as createHash52 } from "crypto";
|
|
403657
403684
|
import { existsSync as existsSync38, lstatSync as lstatSync9, readFileSync as readFileSync34, realpathSync as realpathSync7 } from "fs";
|
|
403658
403685
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
403659
403686
|
import { basename as basename11, dirname as dirname19, isAbsolute as isAbsolute14, relative as relative20, resolve as resolve72 } from "path";
|
|
@@ -403702,7 +403729,7 @@ function realpathIfPresent(path4) {
|
|
|
403702
403729
|
}
|
|
403703
403730
|
function cowboxCallerContractSha256(platformSourceDir = MODULE_DIR2) {
|
|
403704
403731
|
const sourceDir = realpathIfPresent(platformSourceDir);
|
|
403705
|
-
const hash9 =
|
|
403732
|
+
const hash9 = createHash52("sha256");
|
|
403706
403733
|
for (const filename of COWBOX_CALLER_CONTRACT_FILENAMES) {
|
|
403707
403734
|
const path4 = resolve72(sourceDir, filename);
|
|
403708
403735
|
if (!isContainedPath(sourceDir, path4) || !existsSync38(path4) || !lstatSync9(path4).isFile()) {
|
|
@@ -403721,7 +403748,7 @@ function cowboxProfileReleaseId(identity2) {
|
|
|
403721
403748
|
warmPool: identity2.profiles.warmPool,
|
|
403722
403749
|
schemaProof: identity2.profiles.schemaProof
|
|
403723
403750
|
};
|
|
403724
|
-
const releaseHash =
|
|
403751
|
+
const releaseHash = createHash52("sha256").update(JSON.stringify({ callerContractSha256: identity2.callerContractSha256, profiles })).digest("hex");
|
|
403725
403752
|
return `cowbox-sha256-${releaseHash}`;
|
|
403726
403753
|
}
|
|
403727
403754
|
function readProfileGenerationManifest(generationDir, env2) {
|
|
@@ -403839,7 +403866,7 @@ function readCowboxProfile(kind, profilePath) {
|
|
|
403839
403866
|
return source;
|
|
403840
403867
|
}
|
|
403841
403868
|
function cowboxProfileSha256(profileSource) {
|
|
403842
|
-
return `sha256:${
|
|
403869
|
+
return `sha256:${createHash52("sha256").update(profileSource).digest("hex")}`;
|
|
403843
403870
|
}
|
|
403844
403871
|
var COWBOX_PROFILE_FILENAMES, COWBOX_PROFILE_ENV_KEYS, COWBOX_PROFILE_VARIABLE_NAMES, LEGACY_WORKER_PROFILE_VARIABLE_NAMES, COWBOX_CALLER_CONTRACT_FILENAMES, TEMPLATE_VARIABLE_NAME_PATTERN, MODULE_DIR2;
|
|
403845
403872
|
var init_cowbox_profile_contract = __esm({
|
|
@@ -403906,7 +403933,7 @@ var init_cowbox_profile_contract = __esm({
|
|
|
403906
403933
|
});
|
|
403907
403934
|
|
|
403908
403935
|
// ../platform/src/runtime-process-identity.ts
|
|
403909
|
-
import { createHash as
|
|
403936
|
+
import { createHash as createHash53 } from "node:crypto";
|
|
403910
403937
|
import { readFileSync as readFileSync35 } from "node:fs";
|
|
403911
403938
|
function parseLinuxProcStatRecord(source) {
|
|
403912
403939
|
const open4 = source.indexOf("(");
|
|
@@ -403946,7 +403973,7 @@ function readLinuxProcessState(pid, readFile10 = (path4) => readFileSync35(path4
|
|
|
403946
403973
|
function canonicalCgroupRefHash(source) {
|
|
403947
403974
|
const canonical = source.split(/\r?\n/u).map((line) => line.trim()).filter(Boolean).sort().join("\n");
|
|
403948
403975
|
if (!canonical) return null;
|
|
403949
|
-
return
|
|
403976
|
+
return createHash53("sha256").update(canonical).digest("hex");
|
|
403950
403977
|
}
|
|
403951
403978
|
function observeLinuxProcessIdentity(pid, runnerSessionId, readFile10 = (path4) => readFileSync35(path4, "utf8"), platform = process.platform) {
|
|
403952
403979
|
if (platform !== "linux" || !Number.isSafeInteger(pid) || pid <= 1 || !runnerSessionId.trim()) {
|
|
@@ -404761,7 +404788,7 @@ var init_cowbox_control_handoff = __esm({
|
|
|
404761
404788
|
});
|
|
404762
404789
|
|
|
404763
404790
|
// ../platform/src/runner-spawn-lifecycle.ts
|
|
404764
|
-
import { createHash as
|
|
404791
|
+
import { createHash as createHash54 } from "node:crypto";
|
|
404765
404792
|
function spawnWithLifecycleReceipt(input) {
|
|
404766
404793
|
let descriptorsClosed = false;
|
|
404767
404794
|
const closeParentDescriptors = () => {
|
|
@@ -404829,7 +404856,7 @@ var init_runner_spawn_lifecycle = __esm({
|
|
|
404829
404856
|
this.code = code;
|
|
404830
404857
|
this.processSpawned = processSpawned;
|
|
404831
404858
|
this.pid = processSpawned ? Number(pid) : null;
|
|
404832
|
-
this.fingerprint =
|
|
404859
|
+
this.fingerprint = createHash54("sha256").update(`${code}\0${safeCause}\0${this.phase}\0${processSpawned ? "pid" : "no-pid"}`).digest("hex");
|
|
404833
404860
|
Object.defineProperty(this, "cause", { value: cause, configurable: true });
|
|
404834
404861
|
}
|
|
404835
404862
|
};
|
|
@@ -405920,7 +405947,7 @@ __export(bun_runner_exports, {
|
|
|
405920
405947
|
BunRunner: () => BunRunner
|
|
405921
405948
|
});
|
|
405922
405949
|
import { spawn as spawn3 } from "child_process";
|
|
405923
|
-
import { createHash as
|
|
405950
|
+
import { createHash as createHash55 } from "node:crypto";
|
|
405924
405951
|
import { existsSync as existsSync42 } from "fs";
|
|
405925
405952
|
import { resolve as resolve78 } from "path";
|
|
405926
405953
|
import { homedir as homedir3 } from "os";
|
|
@@ -406054,7 +406081,7 @@ var init_bun_runner = __esm({
|
|
|
406054
406081
|
pidStartTicks: localBirth,
|
|
406055
406082
|
processGroupId: proc.pid,
|
|
406056
406083
|
processGroupStartTicks: localBirth,
|
|
406057
|
-
cgroupRefHash:
|
|
406084
|
+
cgroupRefHash: createHash55("sha256").update(`local:${proc.pid}:${session2.sessionId}`).digest("hex"),
|
|
406058
406085
|
runnerSessionId: session2.sessionId
|
|
406059
406086
|
});
|
|
406060
406087
|
}
|
|
@@ -406284,12 +406311,12 @@ var init_app_boot_failure_policy = __esm({
|
|
|
406284
406311
|
});
|
|
406285
406312
|
|
|
406286
406313
|
// ../server/src/app-internal-token.ts
|
|
406287
|
-
import { createHash as
|
|
406314
|
+
import { createHash as createHash56, createHmac as createHmac11 } from "node:crypto";
|
|
406288
406315
|
function deriveAppInternalToken(appId, appName, masterSecret) {
|
|
406289
406316
|
if (!Number.isSafeInteger(appId) || appId < 1 || typeof appName !== "string" || appName.length < 1 || appName.length > 128 || typeof masterSecret !== "string" || masterSecret.length < 1) {
|
|
406290
406317
|
throw new Error("APP_INTERNAL_TOKEN_INPUT_INVALID");
|
|
406291
406318
|
}
|
|
406292
|
-
const tokenKey =
|
|
406319
|
+
const tokenKey = createHash56("sha256").update(`gencow-internal-token:v1:${masterSecret}`).digest();
|
|
406293
406320
|
return createHmac11("sha256", tokenKey).update(`usage:${appId}:${appName}`).digest("hex");
|
|
406294
406321
|
}
|
|
406295
406322
|
var init_app_internal_token = __esm({
|
|
@@ -407090,7 +407117,7 @@ var init_provisioner_blue_green = __esm({
|
|
|
407090
407117
|
});
|
|
407091
407118
|
|
|
407092
407119
|
// ../platform/src/provisioner-deploy-runtime.ts
|
|
407093
|
-
import { createHash as
|
|
407120
|
+
import { createHash as createHash57 } from "crypto";
|
|
407094
407121
|
import { existsSync as existsSync45, readFileSync as readFileSync43 } from "fs";
|
|
407095
407122
|
import { resolve as resolve81 } from "path";
|
|
407096
407123
|
async function assertDeployBundlePreflight(tarGzBuffer) {
|
|
@@ -407230,7 +407257,7 @@ async function deployBundleRuntime(params) {
|
|
|
407230
407257
|
waitForPortFree: params.waitForPortFree,
|
|
407231
407258
|
forceStopAppServingPorts: params.forceStopAppServingPorts
|
|
407232
407259
|
});
|
|
407233
|
-
const hash9 =
|
|
407260
|
+
const hash9 = createHash57("sha256").update(params.tarGzBuffer).digest("hex");
|
|
407234
407261
|
const stagedBundle = await createStagedBundleWorkspace(params.dataDir, params.tarGzBuffer);
|
|
407235
407262
|
try {
|
|
407236
407263
|
await applyLinuxBundlePermissions(params.appName, stagedBundle.path, logger3);
|
|
@@ -407521,7 +407548,7 @@ var init_platform_system_sql = __esm({
|
|
|
407521
407548
|
});
|
|
407522
407549
|
|
|
407523
407550
|
// ../platform/src/provisioner-env-builder.ts
|
|
407524
|
-
import { createHash as
|
|
407551
|
+
import { createHash as createHash58 } from "crypto";
|
|
407525
407552
|
import { existsSync as existsSync46, readFileSync as readFileSync44 } from "fs";
|
|
407526
407553
|
import { resolve as resolve82 } from "path";
|
|
407527
407554
|
function addManagedPublicOrigin(origins, origin) {
|
|
@@ -407694,7 +407721,7 @@ async function buildProvisionerAppEnv(params) {
|
|
|
407694
407721
|
env2.GENCOW_SYSTEM_DATABASE_URL = systemDatabaseUrl;
|
|
407695
407722
|
}
|
|
407696
407723
|
removePlatformOnlyEnvFromAppEnv(env2);
|
|
407697
|
-
env2.BETTER_AUTH_SECRET =
|
|
407724
|
+
env2.BETTER_AUTH_SECRET = createHash58("sha256").update(`gencow-app-auth-${params.appName}-${runtimeEnv.BETTER_AUTH_SECRET || "default"}`).digest("hex");
|
|
407698
407725
|
env2.BETTER_AUTH_URL = `https://${params.appName}.${publicDomain}`;
|
|
407699
407726
|
env2.GENCOW_MANAGED_PUBLIC_ORIGINS = [...managedPublicOrigins].join(",");
|
|
407700
407727
|
if (params.appDbId) {
|
|
@@ -409751,7 +409778,7 @@ var init_rag_corpus_policy2 = __esm({
|
|
|
409751
409778
|
});
|
|
409752
409779
|
|
|
409753
409780
|
// ../server/src/server-document-runtime.ts
|
|
409754
|
-
import { createHash as
|
|
409781
|
+
import { createHash as createHash59 } from "crypto";
|
|
409755
409782
|
var MAX_DOCUMENT_SIZE_BYTES2;
|
|
409756
409783
|
var init_server_document_runtime2 = __esm({
|
|
409757
409784
|
"../server/src/server-document-runtime.ts"() {
|
|
@@ -411367,7 +411394,7 @@ var init_runtime_postgres_client = __esm({
|
|
|
411367
411394
|
});
|
|
411368
411395
|
|
|
411369
411396
|
// ../server/src/platform-database-capability-config.ts
|
|
411370
|
-
import { createHash as
|
|
411397
|
+
import { createHash as createHash60 } from "node:crypto";
|
|
411371
411398
|
var init_platform_database_capability_config = __esm({
|
|
411372
411399
|
"../server/src/platform-database-capability-config.ts"() {
|
|
411373
411400
|
"use strict";
|
|
@@ -411375,7 +411402,7 @@ var init_platform_database_capability_config = __esm({
|
|
|
411375
411402
|
});
|
|
411376
411403
|
|
|
411377
411404
|
// ../server/src/platform-database-capability-readiness.ts
|
|
411378
|
-
import { createHash as
|
|
411405
|
+
import { createHash as createHash61 } from "node:crypto";
|
|
411379
411406
|
var init_platform_database_capability_readiness = __esm({
|
|
411380
411407
|
"../server/src/platform-database-capability-readiness.ts"() {
|
|
411381
411408
|
"use strict";
|
|
@@ -411384,7 +411411,7 @@ var init_platform_database_capability_readiness = __esm({
|
|
|
411384
411411
|
});
|
|
411385
411412
|
|
|
411386
411413
|
// ../server/src/platform-database-capabilities.ts
|
|
411387
|
-
import { createHash as
|
|
411414
|
+
import { createHash as createHash62 } from "node:crypto";
|
|
411388
411415
|
var init_platform_database_capabilities = __esm({
|
|
411389
411416
|
"../server/src/platform-database-capabilities.ts"() {
|
|
411390
411417
|
"use strict";
|
|
@@ -412912,7 +412939,7 @@ var init_drizzle_migration_store_reconciler = __esm({
|
|
|
412912
412939
|
});
|
|
412913
412940
|
|
|
412914
412941
|
// ../platform/src/provisioner-primary-migrations.ts
|
|
412915
|
-
import { createHash as
|
|
412942
|
+
import { createHash as createHash63 } from "node:crypto";
|
|
412916
412943
|
import { readFileSync as readFileSync50, realpathSync as realpathSync8 } from "node:fs";
|
|
412917
412944
|
import { resolve as resolve93, sep as sep4 } from "node:path";
|
|
412918
412945
|
import { readMigrationFiles } from "drizzle-orm/migrator";
|
|
@@ -412990,7 +413017,7 @@ function readVerifiedLocalMigrationSources(migrationsFolder) {
|
|
|
412990
413017
|
if (error51 instanceof MigrationExecutionPlanError) throw error51;
|
|
412991
413018
|
return localPlanChanged(`migration ${JSON.stringify(metadata.name)} could not be read safely`);
|
|
412992
413019
|
}
|
|
412993
|
-
const rawHash =
|
|
413020
|
+
const rawHash = createHash63("sha256").update(sqlContent).digest("hex");
|
|
412994
413021
|
if (rawHash !== metadata.hash) {
|
|
412995
413022
|
return localPlanChanged(
|
|
412996
413023
|
`migration ${JSON.stringify(metadata.name)} changed while its execution plan was being built`
|
|
@@ -413448,7 +413475,7 @@ var init_provisioner_drizzle_tsconfig = __esm({
|
|
|
413448
413475
|
});
|
|
413449
413476
|
|
|
413450
413477
|
// ../platform/src/canonical-schema-proof-runner.ts
|
|
413451
|
-
import { createHash as
|
|
413478
|
+
import { createHash as createHash64 } from "node:crypto";
|
|
413452
413479
|
import { execFileSync } from "node:child_process";
|
|
413453
413480
|
import {
|
|
413454
413481
|
chmodSync as chmodSync5,
|
|
@@ -413481,7 +413508,7 @@ function classifyCanonicalSchemaProofFailure(stage, error51) {
|
|
|
413481
413508
|
return new CanonicalSchemaProofError(stage, "PLATFORM_ACTION_REQUIRED");
|
|
413482
413509
|
}
|
|
413483
413510
|
function sha25610(value) {
|
|
413484
|
-
return
|
|
413511
|
+
return createHash64("sha256").update(value).digest("hex");
|
|
413485
413512
|
}
|
|
413486
413513
|
function buildCanonicalSchemaProofFromSql(sql117) {
|
|
413487
413514
|
const canonicalSql = sql117.trim();
|
|
@@ -413769,7 +413796,7 @@ var init_canonical_schema_proof_runner = __esm({
|
|
|
413769
413796
|
});
|
|
413770
413797
|
|
|
413771
413798
|
// ../platform/src/workspace-schema-sources.ts
|
|
413772
|
-
import { createHash as
|
|
413799
|
+
import { createHash as createHash65 } from "node:crypto";
|
|
413773
413800
|
import { existsSync as existsSync54, lstatSync as lstatSync11, readFileSync as readFileSync53 } from "node:fs";
|
|
413774
413801
|
import { relative as relative22, resolve as resolve96, sep as sep6 } from "node:path";
|
|
413775
413802
|
function declaresUnverifiableSchemaSource(dataDir) {
|
|
@@ -413789,7 +413816,7 @@ function isWithin2(root2, candidate) {
|
|
|
413789
413816
|
return rel === "" || rel !== ".." && !rel.startsWith(`..${sep6}`);
|
|
413790
413817
|
}
|
|
413791
413818
|
function sha25611(bytes) {
|
|
413792
|
-
return
|
|
413819
|
+
return createHash65("sha256").update(bytes).digest("hex");
|
|
413793
413820
|
}
|
|
413794
413821
|
function resolveWorkspaceSchemaSourcePaths(params) {
|
|
413795
413822
|
const backendRoot = resolve96(params.dataDir, "gencow");
|
|
@@ -413837,7 +413864,7 @@ var init_workspace_schema_sources = __esm({
|
|
|
413837
413864
|
|
|
413838
413865
|
// ../platform/src/provisioner-schema.ts
|
|
413839
413866
|
import { existsSync as existsSync55, readFileSync as readFileSync54, readdirSync as readdirSync22 } from "fs";
|
|
413840
|
-
import { createHash as
|
|
413867
|
+
import { createHash as createHash66 } from "node:crypto";
|
|
413841
413868
|
import { basename as basename13, dirname as dirname25, resolve as resolve97 } from "path";
|
|
413842
413869
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
413843
413870
|
function resolveTenantDdlRoleNameFromDatabaseUrl(databaseUrl) {
|
|
@@ -413903,12 +413930,12 @@ function buildV1MigrationIdentity(migrationsDir) {
|
|
|
413903
413930
|
const files = collectMigrationSqlFilePaths(migrationsDir, true);
|
|
413904
413931
|
const rows4 = files.map((filePath) => {
|
|
413905
413932
|
const name = basename13(dirname25(filePath));
|
|
413906
|
-
const sqlSha256 =
|
|
413933
|
+
const sqlSha256 = createHash66("sha256").update(readFileSync54(filePath)).digest("hex");
|
|
413907
413934
|
return { name, sqlSha256 };
|
|
413908
413935
|
});
|
|
413909
413936
|
return {
|
|
413910
413937
|
migrationNames: rows4.map((row) => row.name),
|
|
413911
|
-
bundleSha256:
|
|
413938
|
+
bundleSha256: createHash66("sha256").update(JSON.stringify(rows4)).digest("hex")
|
|
413912
413939
|
};
|
|
413913
413940
|
}
|
|
413914
413941
|
async function resolveWorkspaceSchemaDeploymentDecision(params) {
|
|
@@ -414003,7 +414030,7 @@ async function prepareAppSchemaProofSource(appName, options = {}) {
|
|
|
414003
414030
|
};
|
|
414004
414031
|
}
|
|
414005
414032
|
function buildSchemaNoopInspection(decision) {
|
|
414006
|
-
const fingerprint3 =
|
|
414033
|
+
const fingerprint3 = createHash66("sha256").update(JSON.stringify(decision)).digest("hex").slice(0, 24);
|
|
414007
414034
|
return { planId: `mig_${fingerprint3}`, appliedVerifiedCount: 0, pendingCount: 0 };
|
|
414008
414035
|
}
|
|
414009
414036
|
async function reconcileDrizzleMigrationStoreBeforePrimaryMigrate(params) {
|
|
@@ -414618,11 +414645,11 @@ var init_provisioner_verified_runtime_layout = __esm({
|
|
|
414618
414645
|
});
|
|
414619
414646
|
|
|
414620
414647
|
// ../platform/src/legacy-runtime-dependency-evidence.ts
|
|
414621
|
-
import { createHash as
|
|
414648
|
+
import { createHash as createHash67 } from "node:crypto";
|
|
414622
414649
|
import { existsSync as existsSync58, lstatSync as lstatSync12, readFileSync as readFileSync56, realpathSync as realpathSync11, statSync as statSync13 } from "node:fs";
|
|
414623
414650
|
import { join as join24, resolve as resolve99, sep as sep7 } from "node:path";
|
|
414624
414651
|
function sha25612(value) {
|
|
414625
|
-
return `sha256:${
|
|
414652
|
+
return `sha256:${createHash67("sha256").update(value).digest("hex")}`;
|
|
414626
414653
|
}
|
|
414627
414654
|
function readBoundedRegularFile(path4, maxBytes) {
|
|
414628
414655
|
try {
|
|
@@ -416529,7 +416556,7 @@ var init_runtime_absence_terminalizer = __esm({
|
|
|
416529
416556
|
});
|
|
416530
416557
|
|
|
416531
416558
|
// ../platform/src/app-candidate-generation-store.ts
|
|
416532
|
-
import { createHash as
|
|
416559
|
+
import { createHash as createHash68, randomUUID as randomUUID29 } from "node:crypto";
|
|
416533
416560
|
import {
|
|
416534
416561
|
chmod as chmod4,
|
|
416535
416562
|
chown,
|
|
@@ -416547,7 +416574,7 @@ import {
|
|
|
416547
416574
|
} from "node:fs/promises";
|
|
416548
416575
|
import { basename as basename14, dirname as dirname27, isAbsolute as isAbsolute16, join as join26, relative as relative24, resolve as resolve101, sep as sep8 } from "node:path";
|
|
416549
416576
|
function sha25613(value) {
|
|
416550
|
-
return
|
|
416577
|
+
return createHash68("sha256").update(value).digest("hex");
|
|
416551
416578
|
}
|
|
416552
416579
|
function fail14(code) {
|
|
416553
416580
|
throw new Error(code);
|
|
@@ -416583,7 +416610,7 @@ async function verifyOrSealWorkspace(input) {
|
|
|
416583
416610
|
const durableDataDir = resolve101(input.durableDataDir);
|
|
416584
416611
|
const workspaceRoot = await realpath(workspacePath);
|
|
416585
416612
|
const runtimeGenerationRoot = await realpath(input.runtimeGenerationRoot);
|
|
416586
|
-
const closure =
|
|
416613
|
+
const closure = createHash68("sha256");
|
|
416587
416614
|
const runtimeGenerationDir = dirname27(runtimeGenerationRoot);
|
|
416588
416615
|
const runtimeGenerationPublicNodeModulesDir = join26(runtimeGenerationDir, "public-node_modules");
|
|
416589
416616
|
const runtimeGenerationManifest = join26(runtimeGenerationDir, "runtime-manifest.json");
|
|
@@ -417550,14 +417577,14 @@ var init_candidate_failure_reconciliation = __esm({
|
|
|
417550
417577
|
});
|
|
417551
417578
|
|
|
417552
417579
|
// ../platform/src/legacy-runtime-bootstrap-store.ts
|
|
417553
|
-
import { createHash as
|
|
417580
|
+
import { createHash as createHash69 } from "node:crypto";
|
|
417554
417581
|
import { and as and27, eq as eq31, inArray as inArray15, isNull as isNull8, or as or10, sql as sql85 } from "drizzle-orm";
|
|
417555
417582
|
function sameDesired(left, right) {
|
|
417556
417583
|
if (!left || !right) return left === null && !right;
|
|
417557
417584
|
return left.authorityMode === right.authorityMode && left.desiredRuntimeState === right.desiredRuntimeState && left.desiredActivationId === right.desiredActivationId && left.activationEpoch === right.activationEpoch && left.nodeId === right.nodeId && left.nodeEpoch === right.nodeEpoch;
|
|
417558
417585
|
}
|
|
417559
417586
|
function servingProofHash(input) {
|
|
417560
|
-
return
|
|
417587
|
+
return createHash69("sha256").update(
|
|
417561
417588
|
JSON.stringify([
|
|
417562
417589
|
"legacy-bootstrap-serving-proof-v1",
|
|
417563
417590
|
input.appId,
|
|
@@ -418086,7 +418113,7 @@ var init_route_activation_adapter = __esm({
|
|
|
418086
418113
|
});
|
|
418087
418114
|
|
|
418088
418115
|
// ../server/src/runtime-ready-contract.ts
|
|
418089
|
-
import { createHash as
|
|
418116
|
+
import { createHash as createHash70 } from "node:crypto";
|
|
418090
418117
|
function fail18(code) {
|
|
418091
418118
|
throw new Error(code);
|
|
418092
418119
|
}
|
|
@@ -418118,7 +418145,7 @@ function canonicalRuntimeReadyContract2(contract) {
|
|
|
418118
418145
|
};
|
|
418119
418146
|
}
|
|
418120
418147
|
function buildRuntimeReadyContractHash2(contract) {
|
|
418121
|
-
return
|
|
418148
|
+
return createHash70("sha256").update(JSON.stringify(canonicalRuntimeReadyContract2(contract))).digest("hex");
|
|
418122
418149
|
}
|
|
418123
418150
|
function buildRuntimeReadyAttestationEnvelope2(contract, observedOperation) {
|
|
418124
418151
|
const canonical = canonicalRuntimeReadyContract2(contract);
|
|
@@ -418134,7 +418161,7 @@ function buildRuntimeReadyAttestationEnvelope2(contract, observedOperation) {
|
|
|
418134
418161
|
candidateSessionNonce: canonical.instanceId,
|
|
418135
418162
|
readyContractHash: buildRuntimeReadyContractHash2(canonical),
|
|
418136
418163
|
callableBackend: canonical.callableBackend,
|
|
418137
|
-
capabilityHash:
|
|
418164
|
+
capabilityHash: createHash70("sha256").update(JSON.stringify(canonical.capabilityNames)).digest("hex"),
|
|
418138
418165
|
...canonical.expectedOperationManifestHash ? {
|
|
418139
418166
|
operationManifestHash: observedOperation?.manifestHash ?? canonical.expectedOperationManifestHash,
|
|
418140
418167
|
operationCount: observedOperation?.count ?? canonical.expectedOperationCount
|
|
@@ -418558,10 +418585,10 @@ var init_runtime_candidate_cleanup = __esm({
|
|
|
418558
418585
|
});
|
|
418559
418586
|
|
|
418560
418587
|
// ../platform/src/runtime-candidate-identity.ts
|
|
418561
|
-
import { createHash as
|
|
418588
|
+
import { createHash as createHash71 } from "node:crypto";
|
|
418562
418589
|
import { and as and30, eq as eq34, inArray as inArray18, isNull as isNull10, or as or12, sql as sql88 } from "drizzle-orm";
|
|
418563
418590
|
function sha25614(value) {
|
|
418564
|
-
return
|
|
418591
|
+
return createHash71("sha256").update(value).digest("hex");
|
|
418565
418592
|
}
|
|
418566
418593
|
function fail20(code) {
|
|
418567
418594
|
throw new Error(code);
|
|
@@ -419397,13 +419424,13 @@ var init_deployment_control_plane_orchestrator = __esm({
|
|
|
419397
419424
|
});
|
|
419398
419425
|
|
|
419399
419426
|
// ../platform/src/deployment-schema-revision.ts
|
|
419400
|
-
import { createHash as
|
|
419427
|
+
import { createHash as createHash72 } from "node:crypto";
|
|
419401
419428
|
import { and as and31, eq as eq35, isNull as isNull11, or as or13 } from "drizzle-orm";
|
|
419402
419429
|
function fail21(code) {
|
|
419403
419430
|
throw Object.assign(new Error(code), { code });
|
|
419404
419431
|
}
|
|
419405
419432
|
function sha25615(value) {
|
|
419406
|
-
return
|
|
419433
|
+
return createHash72("sha256").update(value).digest("hex");
|
|
419407
419434
|
}
|
|
419408
419435
|
function revisionSelection() {
|
|
419409
419436
|
return {
|
|
@@ -420538,9 +420565,9 @@ var init_apps_schema_push_safety = __esm({
|
|
|
420538
420565
|
});
|
|
420539
420566
|
|
|
420540
420567
|
// ../platform/src/tenant-database-authority-contract.ts
|
|
420541
|
-
import { createHash as
|
|
420568
|
+
import { createHash as createHash73 } from "node:crypto";
|
|
420542
420569
|
function buildTenantAuthorityBindingFingerprint(input) {
|
|
420543
|
-
return
|
|
420570
|
+
return createHash73("sha256").update(
|
|
420544
420571
|
JSON.stringify({
|
|
420545
420572
|
appId: input.appId,
|
|
420546
420573
|
appInstanceId: input.appInstanceId,
|
|
@@ -420744,10 +420771,10 @@ var init_deployment_schema_constraint = __esm({
|
|
|
420744
420771
|
});
|
|
420745
420772
|
|
|
420746
420773
|
// ../platform/src/deployment-schema-preparation.ts
|
|
420747
|
-
import { createHash as
|
|
420774
|
+
import { createHash as createHash74 } from "node:crypto";
|
|
420748
420775
|
import { resolve as resolve104 } from "node:path";
|
|
420749
420776
|
function sha25616(value) {
|
|
420750
|
-
return
|
|
420777
|
+
return createHash74("sha256").update(value).digest("hex");
|
|
420751
420778
|
}
|
|
420752
420779
|
async function prepareDeploymentSchema(input, hooks = defaultHooks) {
|
|
420753
420780
|
if (input.environment) {
|
|
@@ -422014,10 +422041,10 @@ var init_runtime_stop_dispatch_recovery = __esm({
|
|
|
422014
422041
|
});
|
|
422015
422042
|
|
|
422016
422043
|
// ../platform/src/runtime-stop-intent-store.ts
|
|
422017
|
-
import { createHash as
|
|
422044
|
+
import { createHash as createHash75 } from "node:crypto";
|
|
422018
422045
|
import { and as and37, eq as eq41, exists as exists2, gt as gt7, inArray as inArray20, isNotNull as isNotNull2, isNull as isNull13, lte as lte9, or as or15, sql as sql94 } from "drizzle-orm";
|
|
422019
422046
|
function sha25617(value) {
|
|
422020
|
-
return
|
|
422047
|
+
return createHash75("sha256").update(value).digest("hex");
|
|
422021
422048
|
}
|
|
422022
422049
|
function fail25(code) {
|
|
422023
422050
|
throw new Error(code);
|
|
@@ -422622,7 +422649,7 @@ var init_runtime_exit_store = __esm({
|
|
|
422622
422649
|
});
|
|
422623
422650
|
|
|
422624
422651
|
// ../platform/src/runtime-convergence-command-store.ts
|
|
422625
|
-
import { createHash as
|
|
422652
|
+
import { createHash as createHash76 } from "node:crypto";
|
|
422626
422653
|
import { and as and39, eq as eq43, inArray as inArray22, sql as sql96 } from "drizzle-orm";
|
|
422627
422654
|
async function enqueueRuntimeConvergenceCommand(input) {
|
|
422628
422655
|
return enqueueRuntimeConvergenceCommandWithPolicy(input, {
|
|
@@ -422658,9 +422685,9 @@ async function enqueueRuntimeConvergenceCommandWithPolicy(input, policy) {
|
|
|
422658
422685
|
if (!Number.isSafeInteger(input.appId) || input.appId < 1 || policy.expectedCurrentDeploymentId !== void 0 && (!Number.isSafeInteger(policy.expectedCurrentDeploymentId) || policy.expectedCurrentDeploymentId < 1) || !["running", "stopped", "absent"].includes(input.targetRuntimeState) || input.expectedDesiredRuntimeState !== void 0 && input.expectedDesiredRuntimeState !== expectedDesiredForTarget[input.targetRuntimeState] || !["controller", "owner", "admin", "platform"].includes(input.actorKind) || !CORRELATION_ID.test(input.correlationId)) {
|
|
422659
422686
|
throw new Error("RUNTIME_CONVERGENCE_ENQUEUE_INPUT_INVALID");
|
|
422660
422687
|
}
|
|
422661
|
-
const identityHash =
|
|
422688
|
+
const identityHash = createHash76("sha256").update(JSON.stringify([1, input.appId, input.targetRuntimeState, input.correlationId])).digest("hex");
|
|
422662
422689
|
const operationId2 = `runtime_converge_${identityHash.slice(0, 32)}`;
|
|
422663
|
-
const actorIdHash = input.actorId ?
|
|
422690
|
+
const actorIdHash = input.actorId ? createHash76("sha256").update(input.actorId).digest("hex") : null;
|
|
422664
422691
|
return input.db.transaction(async (tx) => {
|
|
422665
422692
|
const lockedApp = await tx.execute(sql96`
|
|
422666
422693
|
SELECT id,
|
|
@@ -424169,10 +424196,10 @@ var init_runtime_expired_retirement_renewal = __esm({
|
|
|
424169
424196
|
});
|
|
424170
424197
|
|
|
424171
424198
|
// ../platform/src/runtime-absence-proof-store.ts
|
|
424172
|
-
import { createHash as
|
|
424199
|
+
import { createHash as createHash77, randomUUID as randomUUID31 } from "node:crypto";
|
|
424173
424200
|
import { and as and45, eq as eq49, isNull as isNull18, ne as ne12 } from "drizzle-orm";
|
|
424174
424201
|
function hash3(value) {
|
|
424175
|
-
return
|
|
424202
|
+
return createHash77("sha256").update(JSON.stringify(value)).digest("hex");
|
|
424176
424203
|
}
|
|
424177
424204
|
function runtimeAbsenceEvidenceHash(evidence) {
|
|
424178
424205
|
if (!Number.isSafeInteger(evidence.deploymentId) || evidence.deploymentId <= 0 || !evidence.appInstanceId || !evidence.activationId || !evidence.instanceId || !evidence.artifactRef || !evidence.sourceGenerationRef || !evidence.runtimeGenerationRef || !evidence.nodeId || !Number.isSafeInteger(evidence.nodeEpoch) || evidence.nodeEpoch < 0 || !Number.isSafeInteger(evidence.leaseEpoch) || evidence.leaseEpoch < 0) {
|
|
@@ -424349,10 +424376,10 @@ var init_runtime_absence_proof_store = __esm({
|
|
|
424349
424376
|
});
|
|
424350
424377
|
|
|
424351
424378
|
// ../platform/src/runtime-crash-recovery-store.ts
|
|
424352
|
-
import { createHash as
|
|
424379
|
+
import { createHash as createHash78, randomUUID as randomUUID32 } from "node:crypto";
|
|
424353
424380
|
import { and as and46, eq as eq50, isNull as isNull19 } from "drizzle-orm";
|
|
424354
424381
|
function hash4(value) {
|
|
424355
|
-
return
|
|
424382
|
+
return createHash78("sha256").update(JSON.stringify(value)).digest("hex");
|
|
424356
424383
|
}
|
|
424357
424384
|
function runtimeCrashRecoveryEvidenceHash(evidence) {
|
|
424358
424385
|
if (!evidence.artifactRef || !evidence.sourceGenerationRef || !evidence.runtimeGenerationRef || !evidence.nodeId) {
|
|
@@ -425030,7 +425057,7 @@ var init_deployment_executor_spool_compensation = __esm({
|
|
|
425030
425057
|
});
|
|
425031
425058
|
|
|
425032
425059
|
// ../platform/src/app-release-restore-operation.ts
|
|
425033
|
-
import { createHash as
|
|
425060
|
+
import { createHash as createHash79, randomUUID as randomUUID33 } from "node:crypto";
|
|
425034
425061
|
import { and as and50, eq as eq54, gt as gt11, inArray as inArray27, isNull as isNull21, like as like3, lte as lte11, or as or18, sql as sql99 } from "drizzle-orm";
|
|
425035
425062
|
var DEFAULT_LEASE_MS, DEFAULT_HEARTBEAT_MS;
|
|
425036
425063
|
var init_app_release_restore_operation = __esm({
|
|
@@ -425284,9 +425311,9 @@ var init_runtime_absence_rollout = __esm({
|
|
|
425284
425311
|
});
|
|
425285
425312
|
|
|
425286
425313
|
// ../platform/src/runtime-absence-fleet-observer.ts
|
|
425287
|
-
import { createHash as
|
|
425314
|
+
import { createHash as createHash80, createHmac as createHmac12, randomUUID as randomUUID34, timingSafeEqual as timingSafeEqual12 } from "node:crypto";
|
|
425288
425315
|
function hash5(value) {
|
|
425289
|
-
return
|
|
425316
|
+
return createHash80("sha256").update(JSON.stringify(value)).digest("hex");
|
|
425290
425317
|
}
|
|
425291
425318
|
function buildRuntimeAbsenceObservationSignature(input) {
|
|
425292
425319
|
return createHmac12("sha256", input.secret).update(
|
|
@@ -426919,7 +426946,7 @@ var init_runtime_candidate_cgroup_cleanup = __esm({
|
|
|
426919
426946
|
});
|
|
426920
426947
|
|
|
426921
426948
|
// ../platform/src/runtime-exact-stable-crash-recovery.ts
|
|
426922
|
-
import { createHash as
|
|
426949
|
+
import { createHash as createHash81 } from "node:crypto";
|
|
426923
426950
|
import { and as and60, eq as eq65, inArray as inArray34, isNull as isNull25, ne as ne13, sql as sql104 } from "drizzle-orm";
|
|
426924
426951
|
function createExactStableRuntimeCrashRecoveryResolver(adapterInput, currentNodeId, inspectInstance) {
|
|
426925
426952
|
const resolveWithDb = (db, appId) => resolveExactStableRuntimeCrashRecovery({
|
|
@@ -427054,7 +427081,7 @@ async function resolveExactStableRuntimeCrashRecovery(input) {
|
|
|
427054
427081
|
const inspection = await input.inspectInstance(binding.appName, rows4[0]);
|
|
427055
427082
|
if (!(inspection.live && inspection.runnerRefExact && inspection.pidExact && inspection.identityExact && inspection.readyExact))
|
|
427056
427083
|
return null;
|
|
427057
|
-
return
|
|
427084
|
+
return createHash81("sha256").update(
|
|
427058
427085
|
JSON.stringify([
|
|
427059
427086
|
evidence.evidenceHash,
|
|
427060
427087
|
binding.bindingHash,
|
|
@@ -427925,10 +427952,10 @@ var init_runtime_explicit_stop_expired_drain = __esm({
|
|
|
427925
427952
|
});
|
|
427926
427953
|
|
|
427927
427954
|
// ../platform/src/runtime-explicit-stop-store.ts
|
|
427928
|
-
import { createHash as
|
|
427955
|
+
import { createHash as createHash82 } from "node:crypto";
|
|
427929
427956
|
import { and as and63, eq as eq68, inArray as inArray36, isNotNull as isNotNull6, isNull as isNull28, sql as sql106 } from "drizzle-orm";
|
|
427930
427957
|
function digest2(value) {
|
|
427931
|
-
return
|
|
427958
|
+
return createHash82("sha256").update(JSON.stringify(value)).digest("hex");
|
|
427932
427959
|
}
|
|
427933
427960
|
function safeLifecycleFailureCode(value) {
|
|
427934
427961
|
const code = value instanceof Error ? value.message : String(value);
|
|
@@ -428767,10 +428794,10 @@ var init_legacy_runtime_evidence_observer = __esm({
|
|
|
428767
428794
|
});
|
|
428768
428795
|
|
|
428769
428796
|
// ../platform/src/runtime-legacy-preserve-operation-store.ts
|
|
428770
|
-
import { createHash as
|
|
428797
|
+
import { createHash as createHash83 } from "node:crypto";
|
|
428771
428798
|
import { and as and66, eq as eq71, inArray as inArray38, lte as lte13, sql as sql107 } from "drizzle-orm";
|
|
428772
428799
|
function hash6(value) {
|
|
428773
|
-
return
|
|
428800
|
+
return createHash83("sha256").update(JSON.stringify(value)).digest("hex");
|
|
428774
428801
|
}
|
|
428775
428802
|
function fail32(code) {
|
|
428776
428803
|
throw new Error(code);
|
|
@@ -428950,10 +428977,10 @@ var init_runtime_lifecycle_policy = __esm({
|
|
|
428950
428977
|
});
|
|
428951
428978
|
|
|
428952
428979
|
// ../platform/src/runtime-scale-down-store.ts
|
|
428953
|
-
import { createHash as
|
|
428980
|
+
import { createHash as createHash84 } from "node:crypto";
|
|
428954
428981
|
import { and as and67, eq as eq72, inArray as inArray39, isNull as isNull29, sql as sql108 } from "drizzle-orm";
|
|
428955
428982
|
function hash7(value) {
|
|
428956
|
-
return
|
|
428983
|
+
return createHash84("sha256").update(JSON.stringify(value)).digest("hex");
|
|
428957
428984
|
}
|
|
428958
428985
|
async function recordScaleDownRemediation(input) {
|
|
428959
428986
|
const now = input.now ?? /* @__PURE__ */ new Date();
|
|
@@ -429512,10 +429539,10 @@ var init_runtime_malformed_legacy_absence_recovery = __esm({
|
|
|
429512
429539
|
});
|
|
429513
429540
|
|
|
429514
429541
|
// ../platform/src/legacy-runtime-bootstrap-orchestrator.ts
|
|
429515
|
-
import { createHash as
|
|
429542
|
+
import { createHash as createHash85, randomUUID as randomUUID35 } from "node:crypto";
|
|
429516
429543
|
import { and as and70, eq as eq75, gt as gt14, inArray as inArray42, notInArray as notInArray4 } from "drizzle-orm";
|
|
429517
429544
|
function hash8(value) {
|
|
429518
|
-
return
|
|
429545
|
+
return createHash85("sha256").update(JSON.stringify(value)).digest("hex");
|
|
429519
429546
|
}
|
|
429520
429547
|
function diagnosticDecisionReason(decisionReason, evidence) {
|
|
429521
429548
|
const incompleteReason = evidence.incompleteReason;
|
|
@@ -430024,7 +430051,7 @@ var init_runtime_control_plane_reconciler = __esm({
|
|
|
430024
430051
|
});
|
|
430025
430052
|
|
|
430026
430053
|
// ../platform/src/runtime-legacy-effective-route-proof.ts
|
|
430027
|
-
import { createHash as
|
|
430054
|
+
import { createHash as createHash86 } from "node:crypto";
|
|
430028
430055
|
import { eq as eq76 } from "drizzle-orm";
|
|
430029
430056
|
function fail34(code) {
|
|
430030
430057
|
throw new Error(code);
|
|
@@ -430068,7 +430095,7 @@ async function loadLegacyEffectiveRouteGateProof(input) {
|
|
|
430068
430095
|
listener: { identity: null, hash: null },
|
|
430069
430096
|
route: { identity: null, hash: null }
|
|
430070
430097
|
};
|
|
430071
|
-
const proofHash =
|
|
430098
|
+
const proofHash = createHash86("sha256").update(
|
|
430072
430099
|
JSON.stringify({
|
|
430073
430100
|
appId: input.appId,
|
|
430074
430101
|
appName: app2.name,
|
|
@@ -430104,7 +430131,7 @@ async function loadLegacyEffectiveRouteGateProof(input) {
|
|
|
430104
430131
|
slotHashes: durable.slots.slice().sort((left, right) => left.platformSlot.localeCompare(right.platformSlot)).map((slot) => slot.bindingHash)
|
|
430105
430132
|
}
|
|
430106
430133
|
},
|
|
430107
|
-
unverifiedCompositeDigest: legacyProof.process.hash && legacyProof.warmPool.hash && legacyProof.listener.hash ?
|
|
430134
|
+
unverifiedCompositeDigest: legacyProof.process.hash && legacyProof.warmPool.hash && legacyProof.listener.hash ? createHash86("sha256").update(
|
|
430108
430135
|
JSON.stringify({
|
|
430109
430136
|
appId: input.appId,
|
|
430110
430137
|
appName: app2.name,
|
|
@@ -431528,10 +431555,10 @@ var init_runtime_control_plane_lifecycle = __esm({
|
|
|
431528
431555
|
});
|
|
431529
431556
|
|
|
431530
431557
|
// ../platform/src/deployment-control-plane-observer.ts
|
|
431531
|
-
import { createHash as
|
|
431558
|
+
import { createHash as createHash87, randomUUID as randomUUID36 } from "node:crypto";
|
|
431532
431559
|
import { and as and74, eq as eq80, gt as gt17, sql as sql112 } from "drizzle-orm";
|
|
431533
431560
|
function observedActivationId(appId, deploymentId) {
|
|
431534
|
-
const digest4 =
|
|
431561
|
+
const digest4 = createHash87("sha256").update(`legacy-observed\0${appId}\0${deploymentId}`).digest("hex").slice(0, 32);
|
|
431535
431562
|
return `legacy_${digest4}`;
|
|
431536
431563
|
}
|
|
431537
431564
|
function resolveNodeId(nodeId) {
|
|
@@ -431850,7 +431877,7 @@ var init_runtime_stop_operation = __esm({
|
|
|
431850
431877
|
});
|
|
431851
431878
|
|
|
431852
431879
|
// ../platform/src/app-delete-terminal-evidence.ts
|
|
431853
|
-
import { createHash as
|
|
431880
|
+
import { createHash as createHash88 } from "node:crypto";
|
|
431854
431881
|
var init_app_delete_terminal_evidence = __esm({
|
|
431855
431882
|
"../platform/src/app-delete-terminal-evidence.ts"() {
|
|
431856
431883
|
"use strict";
|
|
@@ -432222,10 +432249,10 @@ var init_platform_api_runtime_convergence = __esm({
|
|
|
432222
432249
|
});
|
|
432223
432250
|
|
|
432224
432251
|
// ../platform/src/runtime-manual-crash-recovery-approval-store.ts
|
|
432225
|
-
import { createHash as
|
|
432252
|
+
import { createHash as createHash89 } from "node:crypto";
|
|
432226
432253
|
import { and as and82, eq as eq89, sql as sql116 } from "drizzle-orm";
|
|
432227
432254
|
function digest3(value) {
|
|
432228
|
-
return
|
|
432255
|
+
return createHash89("sha256").update(JSON.stringify(value)).digest("hex");
|
|
432229
432256
|
}
|
|
432230
432257
|
async function approveManualCrashRecovery(input) {
|
|
432231
432258
|
if (!Number.isSafeInteger(input.appId) || input.appId < 1 || !input.actorId || !input.correlationId) {
|
|
@@ -458626,8 +458653,8 @@ function getSecretKey() {
|
|
|
458626
458653
|
return cachedKey;
|
|
458627
458654
|
const internalToken = process.env.GENCOW_INTERNAL_TOKEN;
|
|
458628
458655
|
if (internalToken) {
|
|
458629
|
-
const { createHash:
|
|
458630
|
-
cachedKey =
|
|
458656
|
+
const { createHash: createHash90 } = __require("crypto");
|
|
458657
|
+
cachedKey = createHash90("sha256").update(`gencow-settings-key:${internalToken}`).digest().subarray(0, KEY_LENGTH);
|
|
458631
458658
|
return cachedKey;
|
|
458632
458659
|
}
|
|
458633
458660
|
const keyPath = resolveSecretKeyPath();
|