gencow 0.1.219 → 0.1.221
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/lib/app-command.mjs +23 -0
- package/lib/app-delete-operation.mjs +2 -3
- package/lib/deploy-runtime.mjs +2 -2
- package/lib/release-client.mjs +18 -11
- package/package.json +3 -3
- package/runtime/server.mjs +4882 -3736
package/lib/app-command.mjs
CHANGED
|
@@ -80,6 +80,27 @@ export function formatMemoryExceededDetails(appRow) {
|
|
|
80
80
|
return lines.join("\n");
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
export function formatRecoveryDispositionDetails(appRow) {
|
|
84
|
+
// A delete receipt owns the user-visible lifecycle. Runtime recovery
|
|
85
|
+
// diagnostics are internal while the platform is fencing and removing the
|
|
86
|
+
// app; showing them would incorrectly ask the customer to contact support.
|
|
87
|
+
if (appRow?.status === "deleting") return "";
|
|
88
|
+
const disposition = appRow?.recoveryDisposition;
|
|
89
|
+
if (disposition?.kind === "deploy_required") {
|
|
90
|
+
return " Recovery: no deployment is available. Run `gencow deploy` from this project.\n Retryable: no";
|
|
91
|
+
}
|
|
92
|
+
if (disposition?.kind === "owner_memory_action_required") {
|
|
93
|
+
return " Recovery: inspect logs and memory usage, then deploy a fix or explicitly Resume.\n Retryable: no automatic retry";
|
|
94
|
+
}
|
|
95
|
+
if (disposition?.kind === "terminal_failed") {
|
|
96
|
+
return ` Recovery: inspect diagnostics before retrying or redeploying.\n Reason: ${disposition.reasonCode}`;
|
|
97
|
+
}
|
|
98
|
+
if (disposition?.kind === "platform_recovery_available") {
|
|
99
|
+
return ` Recovery: ${disposition.state} until ${disposition.deadlineAt}\n Operation: ${disposition.operationId}`;
|
|
100
|
+
}
|
|
101
|
+
return "";
|
|
102
|
+
}
|
|
103
|
+
|
|
83
104
|
export function addDeployAppToConfigSource(src, appName) {
|
|
84
105
|
if (src.includes("deploy:")) return src;
|
|
85
106
|
|
|
@@ -391,6 +412,8 @@ ${dashboardLine}
|
|
|
391
412
|
logImpl(` Status: ${status.colored}`);
|
|
392
413
|
const memoryExceededDetails = formatMemoryExceededDetails(data);
|
|
393
414
|
if (memoryExceededDetails) logImpl(memoryExceededDetails);
|
|
415
|
+
const recoveryDetails = formatRecoveryDispositionDetails(data);
|
|
416
|
+
if (recoveryDetails) logImpl(recoveryDetails);
|
|
394
417
|
logImpl(` Port: ${data.port ?? `${DIM}not deployed${RESET}`}`);
|
|
395
418
|
if (isAppFailureStatus(data)) {
|
|
396
419
|
let diagnosticLines = selectAppDiagnosticLogLines(data);
|
|
@@ -13,13 +13,12 @@ const APP_DELETE_ACTIVE_STATES = new Set([
|
|
|
13
13
|
"blocked_ownership_ambiguous",
|
|
14
14
|
"blocked_active_work",
|
|
15
15
|
"blocked_runtime_outcome_unknown",
|
|
16
|
+
"blocked_catalog_outcome_unknown",
|
|
16
17
|
"failed_tenant_db_cleanup",
|
|
17
18
|
"failed_catalog_cleanup",
|
|
18
|
-
]);
|
|
19
|
-
const APP_DELETE_TERMINAL_FAILURE_STATES = new Set([
|
|
20
|
-
"blocked_catalog_outcome_unknown",
|
|
21
19
|
"failed_delete_recovery_required",
|
|
22
20
|
]);
|
|
21
|
+
const APP_DELETE_TERMINAL_FAILURE_STATES = new Set();
|
|
23
22
|
const APP_DELETE_RESPONSE_STATES = new Set([
|
|
24
23
|
...APP_DELETE_ACTIVE_STATES,
|
|
25
24
|
...APP_DELETE_TERMINAL_FAILURE_STATES,
|
package/lib/deploy-runtime.mjs
CHANGED
|
@@ -640,9 +640,9 @@ export function createDeployCommand({
|
|
|
640
640
|
unlinkSyncImpl,
|
|
641
641
|
writeFileSyncImpl,
|
|
642
642
|
prepareReleaseAttempt: prepareReleaseAttemptImpl
|
|
643
|
-
? ({ appId: activeAppId }) =>
|
|
643
|
+
? ({ appId: activeAppId, sourceRoot }) =>
|
|
644
644
|
prepareReleaseAttemptImpl({
|
|
645
|
-
root:
|
|
645
|
+
root: sourceRoot || backendProjectRoot,
|
|
646
646
|
sourceRootKind: "fullstack",
|
|
647
647
|
components: ["backend", "static"],
|
|
648
648
|
cliVersion,
|
package/lib/release-client.mjs
CHANGED
|
@@ -144,12 +144,15 @@ export async function prepareReleaseAttempt({
|
|
|
144
144
|
}
|
|
145
145
|
if (!capability) return null;
|
|
146
146
|
const requestId = releaseRequestId(explicitRequestId);
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
const shouldStoreSource = components.includes("backend");
|
|
148
|
+
const sourcePackage = shouldStoreSource
|
|
149
|
+
? await createReleaseSourcePackageImpl({
|
|
150
|
+
root,
|
|
151
|
+
sourceRootKind,
|
|
152
|
+
components,
|
|
153
|
+
cliVersion,
|
|
154
|
+
})
|
|
155
|
+
: null;
|
|
153
156
|
try {
|
|
154
157
|
const response = await platformFetchImpl(creds, `/platform/apps/${appId}/release-attempts`, {
|
|
155
158
|
method: "POST",
|
|
@@ -158,21 +161,25 @@ export async function prepareReleaseAttempt({
|
|
|
158
161
|
"X-Gencow-Release-Request-Id": requestId,
|
|
159
162
|
"X-Gencow-Release-Environment": environment,
|
|
160
163
|
"X-Gencow-Release-Components": [...components].sort().join(","),
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
...(sourcePackage
|
|
165
|
+
? {
|
|
166
|
+
"X-Gencow-Release-Source-SHA256": sourcePackage.archiveSha256,
|
|
167
|
+
"X-Gencow-Release-Source-Closure-SHA256": sourcePackage.manifest.sourceClosureSha256,
|
|
168
|
+
}
|
|
169
|
+
: { "X-Gencow-Release-Source-Mode": "none" }),
|
|
163
170
|
},
|
|
164
|
-
body: sourcePackage.bundleBuffer,
|
|
171
|
+
...(sourcePackage ? { body: sourcePackage.bundleBuffer } : {}),
|
|
165
172
|
});
|
|
166
173
|
if (!response.ok) {
|
|
167
174
|
await responseError(response, "APP_RELEASE_SOURCE_UPLOAD_FAILED", creds);
|
|
168
175
|
}
|
|
169
176
|
const data = await response.json();
|
|
170
|
-
if (!data.attemptId || data.state !== "source_stored") {
|
|
177
|
+
if (!data.attemptId || (data.state !== "source_stored" && data.state !== "received")) {
|
|
171
178
|
throw new Error("APP_RELEASE_SOURCE_RESPONSE_INVALID");
|
|
172
179
|
}
|
|
173
180
|
return { attemptId: data.attemptId, requestId };
|
|
174
181
|
} finally {
|
|
175
|
-
await unlinkImpl(sourcePackage.bundlePath).catch(() => {});
|
|
182
|
+
if (sourcePackage) await unlinkImpl(sourcePackage.bundlePath).catch(() => {});
|
|
176
183
|
}
|
|
177
184
|
}
|
|
178
185
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gencow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.221",
|
|
4
4
|
"description": "Gencow — AI Backend Engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dashboard/"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@gencow/migration-contract": "0.1.
|
|
23
|
+
"@gencow/migration-contract": "0.1.13",
|
|
24
24
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
25
25
|
"drizzle-kit": "1.0.0-rc.4",
|
|
26
26
|
"drizzle-orm": "1.0.0-rc.4",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^25.9.5",
|
|
35
35
|
"better-auth": "^1.6.23",
|
|
36
|
-
"@gencow/client": "0.2.7",
|
|
37
36
|
"@gencow/core": "0.1.43",
|
|
37
|
+
"@gencow/client": "0.2.7",
|
|
38
38
|
"@gencow/react": "0.2.7"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|