gencow 0.1.207 → 0.1.209

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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gencow",
3
- "version": "0.1.207",
3
+ "version": "0.1.209",
4
4
  "description": "Gencow — AI Backend Engine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,8 +33,8 @@
33
33
  "devDependencies": {
34
34
  "@types/node": "^25.9.5",
35
35
  "better-auth": "^1.6.23",
36
- "@gencow/core": "0.1.43",
37
36
  "@gencow/client": "0.2.6",
37
+ "@gencow/core": "0.1.43",
38
38
  "@gencow/react": "0.2.6"
39
39
  },
40
40
  "scripts": {
@@ -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
  }