gencow 0.1.206 → 0.1.208

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.
@@ -181,7 +181,7 @@ export function createAppCommand({
181
181
  const res = await rpcQueryImpl(creds, "apps.list");
182
182
  const body = await res.json().catch(() => null);
183
183
  if (!res.ok) {
184
- errorImpl(appResponseError(body, invalidAppResponse("app list", res, "error")));
184
+ errorImpl(appResponseError(body, invalidAppResponse("app list", res, "error"), res));
185
185
  return 1;
186
186
  }
187
187
  const apps = parseAppListResponse(body);
@@ -219,7 +219,7 @@ export function createAppCommand({
219
219
  infoImpl(`Creating app "${name}"...`);
220
220
  const { response: res, data } = await requestAppCreate(creds, name);
221
221
  if (!res.ok) {
222
- errorImpl(appResponseError(data, invalidAppResponse("app create", res, "error")));
222
+ errorImpl(appResponseError(data, invalidAppResponse("app create", res, "error"), res));
223
223
  return 1;
224
224
  }
225
225
  if (!data) {
@@ -340,6 +340,7 @@ ${dashboardLine}
340
340
  appResponseError(
341
341
  delData,
342
342
  invalidAppResponse("app delete", delRes, delRes.ok ? "success" : "error"),
343
+ delRes,
343
344
  ),
344
345
  );
345
346
  return 1;
@@ -367,7 +368,7 @@ ${dashboardLine}
367
368
  errorImpl(
368
369
  res.status === 404
369
370
  ? appNotFoundDiagnostic()
370
- : appResponseError(body, invalidAppResponse("app status", res, "error")),
371
+ : appResponseError(body, invalidAppResponse("app status", res, "error"), res),
371
372
  );
372
373
  return 1;
373
374
  }
@@ -56,10 +56,13 @@ export function parseAppDeleteOperationEnvelope(value, expectedAppId) {
56
56
  return value;
57
57
  }
58
58
 
59
- function invalidPollResponse(accepted) {
59
+ function invalidPollResponse(accepted, response = null) {
60
60
  return {
61
- error: "CLI_APP_RESPONSE_INVALID: app delete status returned an invalid response",
62
- code: "CLI_APP_RESPONSE_INVALID",
61
+ error:
62
+ response?.status === 503
63
+ ? "App deletion status is temporarily unavailable. Retry the command with the same app."
64
+ : "CLI_APP_RESPONSE_INVALID: app delete status returned an invalid response",
65
+ code: response?.status === 503 ? "APP_DELETE_STATUS_POLL_UNAVAILABLE" : "CLI_APP_RESPONSE_INVALID",
63
66
  operationId: accepted.operationId,
64
67
  correlationId: accepted.correlationId,
65
68
  state: accepted.state,
@@ -111,7 +114,7 @@ export async function pollAppDeleteOperation({
111
114
  operationId: accepted.operationId,
112
115
  });
113
116
  const statusData = await readJsonObjectResponse(statusRes);
114
- if (!statusRes?.ok || !statusData) return invalidPollResponse(accepted);
117
+ if (!statusRes?.ok || !statusData) return invalidPollResponse(accepted, statusRes);
115
118
  successfulPollResponses += 1;
116
119
  if (isMatchingTerminalResponse(statusData, accepted, name)) return statusData;
117
120
  if (isMatchingTerminalFailureResponse(statusData, accepted, name)) {
@@ -14,13 +14,31 @@ const USER_ACTIONS = new Set([
14
14
  "WAIT",
15
15
  ]);
16
16
 
17
- export function appResponseError(body, fallback) {
18
- if (!body || typeof body !== "object" || Array.isArray(body)) return fallback;
19
- const message = typeof body.error === "string" && body.error.trim() ? body.error.trim() : fallback;
17
+ export function appResponseError(body, fallback, response = null) {
18
+ if (!body || typeof body !== "object" || Array.isArray(body)) {
19
+ if (response?.status === 503) {
20
+ return `${fallback}\nCode: CLI_PLATFORM_UNAVAILABLE\nRetryable: yes`;
21
+ }
22
+ return fallback;
23
+ }
24
+ const hasPublicCode = /^[A-Za-z][A-Za-z0-9_]{2,127}$/u.test(body.code ?? "");
25
+ // A syntactically valid code does not authenticate the accompanying message.
26
+ // 503 bodies can be partial upstream envelopes, so never cross that public
27
+ // boundary with server-provided text unless a separately trusted contract
28
+ // has already converted it into the fallback-safe diagnostic.
29
+ const message =
30
+ response?.status === 503
31
+ ? fallback
32
+ : typeof body.error === "string" && body.error.trim()
33
+ ? body.error.trim()
34
+ : fallback;
20
35
  const lines = [message];
21
- if (/^[A-Za-z][A-Za-z0-9_]{2,127}$/u.test(body.code ?? "")) {
36
+ if (hasPublicCode) {
22
37
  lines.push(`Code: ${body.code}`);
38
+ } else if (response?.status === 503) {
39
+ lines.push("Code: CLI_PLATFORM_UNAVAILABLE");
23
40
  }
41
+ if (response?.status === 503) lines.push(`Retryable: ${body.retryable === false ? "no" : "yes"}`);
24
42
  if (/^[A-Za-z][A-Za-z0-9_]{2,127}$/u.test(body.operationCode ?? "")) {
25
43
  lines.push(`Operation code: ${body.operationCode}`);
26
44
  }
@@ -737,7 +737,7 @@ export function createDeployPackageRuntime({
737
737
 
738
738
  const deployData = await readJsonObjectResponse(deployRes);
739
739
  if (!deployData) {
740
- errorImpl("Deploy failed: server returned an invalid JSON response; retry the same deploy request");
740
+ errorImpl(`Deploy failed: no terminal deployment receipt was returned after packaging.\nCode: CLI_DEPLOY_TERMINAL_RECEIPT_MISSING\nStage: controller\nHTTP status: ${deployRes?.status ?? "unknown"}\nNext action: RETRY`);
741
741
  exitImpl(1);
742
742
  return null;
743
743
  }
@@ -643,6 +643,8 @@ export function createDeployCommand({
643
643
  environment: parsed.envTarget,
644
644
  requestId: parsed.requestId,
645
645
  platformFetchImpl,
646
+ capabilityTimeoutMs: 15_000,
647
+ allowCapabilityTimeoutFallback: true,
646
648
  })
647
649
  : undefined,
648
650
  failReleaseAttempt: failReleaseAttemptImpl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gencow",
3
- "version": "0.1.206",
3
+ "version": "0.1.208",
4
4
  "description": "Gencow — AI Backend Engine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,8 +34,8 @@
34
34
  "@types/node": "^25.9.5",
35
35
  "better-auth": "^1.6.23",
36
36
  "@gencow/client": "0.2.6",
37
- "@gencow/react": "0.2.6",
38
- "@gencow/core": "0.1.43"
37
+ "@gencow/core": "0.1.43",
38
+ "@gencow/react": "0.2.6"
39
39
  },
40
40
  "scripts": {
41
41
  "prebuild": "pnpm --filter @gencow/migration-contract run build && pnpm --filter @gencow/server run build",
@@ -110044,6 +110044,32 @@ var require_output = __commonJS({
110044
110044
  }
110045
110045
  });
110046
110046
 
110047
+ // ../../node_modules/.pnpm/@img+sharp-wasm32@0.34.5/node_modules/@img/sharp-wasm32/versions.json
110048
+ var require_versions = __commonJS({
110049
+ "../../node_modules/.pnpm/@img+sharp-wasm32@0.34.5/node_modules/@img/sharp-wasm32/versions.json"(exports2, module2) {
110050
+ module2.exports = {
110051
+ aom: "3.13.1",
110052
+ cgif: "0.5.0",
110053
+ emscripten: "4.0.18",
110054
+ exif: "0.6.25",
110055
+ expat: "2.7.3",
110056
+ ffi: "3.5.2",
110057
+ glib: "2.86.1",
110058
+ heif: "1.20.2",
110059
+ highway: "1.3.0",
110060
+ imagequant: "2.4.1",
110061
+ lcms: "2.17",
110062
+ mozjpeg: "0826579",
110063
+ resvg: "0.45.1",
110064
+ spng: "0.7.4",
110065
+ tiff: "4.7.1",
110066
+ vips: "8.17.3",
110067
+ webp: "1.6.0",
110068
+ "zlib-ng": "2.2.5"
110069
+ };
110070
+ }
110071
+ });
110072
+
110047
110073
  // ../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/utility.js
110048
110074
  var require_utility = __commonJS({
110049
110075
  "../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/utility.js"(exports2, module2) {
@@ -110088,7 +110114,7 @@ var require_utility = __commonJS({
110088
110114
  }
110089
110115
  } else {
110090
110116
  try {
110091
- versions = __require("@img/sharp-wasm32/versions");
110117
+ versions = require_versions();
110092
110118
  } catch (_4) {
110093
110119
  }
110094
110120
  }
@@ -184437,6 +184463,7 @@ import { and as and10, eq as eq12, inArray as inArray5, isNull as isNull5, ne as
184437
184463
  async function hasReadyDeploymentExecutor(input) {
184438
184464
  const now = input.now ?? /* @__PURE__ */ new Date();
184439
184465
  const staleAfterMs = input.staleAfterMs ?? 45e3;
184466
+ const reconcilerStaleAfterMs = Math.max(staleAfterMs, RECONCILER_SCAN_STALE_AFTER_MS);
184440
184467
  const recoverySloMs = input.recoverySloMs ?? 5 * 6e4;
184441
184468
  const rows4 = await input.db.select({ ownerId: deploymentExecutorWorkers.ownerId }).from(deploymentExecutorWorkers).where(
184442
184469
  and10(
@@ -184449,7 +184476,7 @@ async function hasReadyDeploymentExecutor(input) {
184449
184476
  )}`,
184450
184477
  sql61`${deploymentExecutorWorkers.reconcilerProgressSeq} > 0`,
184451
184478
  sql61`${deploymentExecutorWorkers.reconcilerLastScanAt} >= ${toPostgresTimestamp2(
184452
- new Date(now.getTime() - staleAfterMs)
184479
+ new Date(now.getTime() - reconcilerStaleAfterMs)
184453
184480
  )}`,
184454
184481
  isNull5(deploymentExecutorWorkers.reconcilerLastErrorCode),
184455
184482
  or7(
@@ -184481,6 +184508,7 @@ async function hasStalledDeploymentExecutor(input) {
184481
184508
  async function loadReadyDeploymentExecutorGeneration(input) {
184482
184509
  const now = input.now ?? /* @__PURE__ */ new Date();
184483
184510
  const staleAfterMs = input.staleAfterMs ?? 45e3;
184511
+ const reconcilerStaleAfterMs = Math.max(staleAfterMs, RECONCILER_SCAN_STALE_AFTER_MS);
184484
184512
  const recoverySloMs = input.recoverySloMs ?? 5 * 6e4;
184485
184513
  const result2 = await input.db.execute(sql61`
184486
184514
  SELECT owner_id AS "ownerId",
@@ -184498,7 +184526,7 @@ async function loadReadyDeploymentExecutorGeneration(input) {
184498
184526
  AND generation_digest ~ '^[a-f0-9]{64}$'
184499
184527
  AND heartbeat_at >= ${toPostgresTimestamp2(new Date(now.getTime() - staleAfterMs))}
184500
184528
  AND reconciler_progress_seq > 0
184501
- AND reconciler_last_scan_at >= ${toPostgresTimestamp2(new Date(now.getTime() - staleAfterMs))}
184529
+ AND reconciler_last_scan_at >= ${toPostgresTimestamp2(new Date(now.getTime() - reconcilerStaleAfterMs))}
184502
184530
  AND reconciler_last_error_code IS NULL
184503
184531
  AND (
184504
184532
  reconciler_oldest_candidate_at IS NULL
@@ -184512,12 +184540,14 @@ async function loadReadyDeploymentExecutorGeneration(input) {
184512
184540
  const rows4 = Array.isArray(result2) ? result2 : result2?.rows ?? [];
184513
184541
  return rows4[0] ?? null;
184514
184542
  }
184543
+ var RECONCILER_SCAN_STALE_AFTER_MS;
184515
184544
  var init_deployment_executor_worker_store = __esm({
184516
184545
  "../platform/src/deployment-executor-worker-store.ts"() {
184517
184546
  "use strict";
184518
184547
  init_schema();
184519
184548
  init_postgres_temporal2();
184520
184549
  init_deployment_executor_operation();
184550
+ RECONCILER_SCAN_STALE_AFTER_MS = 5 * 6e4;
184521
184551
  }
184522
184552
  });
184523
184553
 
@@ -408938,6 +408968,10 @@ function buildAppDatabaseUrl(appName, role = "app") {
408938
408968
  async function dropAppDatabase(appName) {
408939
408969
  const dbName = buildAppDatabaseName(appName);
408940
408970
  if (databaseAdminLifecycleCapability) {
408971
+ if (CACHED_DATABASE_URL && await inspectTenantDatabaseCatalog({ dbName, runtimeDatabaseUrl: CACHED_DATABASE_URL }) === "absent") {
408972
+ return;
408973
+ }
408974
+ if (!await databaseAdminLifecycleCapability.databaseExists(dbName)) return;
408941
408975
  await databaseAdminLifecycleCapability.dropDatabase(dbName);
408942
408976
  return;
408943
408977
  }
@@ -451834,7 +451868,7 @@ function createBackgroundDeepHealthProbe(input) {
451834
451868
 
451835
451869
  // ../server/dist/server-core-admission.js
451836
451870
  function isPlatformCoreSlotIdentityReady(env2) {
451837
- if (env2.GENCOW_PLATFORM_SLOT_CANDIDATE === "true")
451871
+ if (env2.GENCOW_PLATFORM_SLOT_CANDIDATE === "true" && env2.GENCOW_CUSTOMER_CLI_INVESTIGATION_MODE !== "1" && env2.CUSTOMER_CLI_INVESTIGATION_CORE_ADMISSION !== "1")
451838
451872
  return false;
451839
451873
  if (env2.GENCOW_PLATFORM_SLOT_PROMOTION_PROTOCOL !== "v2")
451840
451874
  return false;