gencow 0.1.218 → 0.1.220
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 +19 -0
- package/lib/deploy-runtime.mjs +2 -2
- package/lib/release-client.mjs +18 -11
- package/package.json +2 -2
- package/runtime/server.mjs +2534 -1959
package/lib/app-command.mjs
CHANGED
|
@@ -80,6 +80,23 @@ export function formatMemoryExceededDetails(appRow) {
|
|
|
80
80
|
return lines.join("\n");
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
export function formatRecoveryDispositionDetails(appRow) {
|
|
84
|
+
const disposition = appRow?.recoveryDisposition;
|
|
85
|
+
if (disposition?.kind === "deploy_required") {
|
|
86
|
+
return " Recovery: no deployment is available. Run `gencow deploy` from this project.\n Retryable: no";
|
|
87
|
+
}
|
|
88
|
+
if (disposition?.kind === "owner_memory_action_required") {
|
|
89
|
+
return " Recovery: inspect logs and memory usage, then deploy a fix or explicitly Resume.\n Retryable: no automatic retry";
|
|
90
|
+
}
|
|
91
|
+
if (disposition?.kind === "terminal_failed") {
|
|
92
|
+
return ` Recovery: inspect diagnostics before retrying or redeploying.\n Reason: ${disposition.reasonCode}`;
|
|
93
|
+
}
|
|
94
|
+
if (disposition?.kind === "platform_recovery_available") {
|
|
95
|
+
return ` Recovery: ${disposition.state} until ${disposition.deadlineAt}\n Operation: ${disposition.operationId}`;
|
|
96
|
+
}
|
|
97
|
+
return "";
|
|
98
|
+
}
|
|
99
|
+
|
|
83
100
|
export function addDeployAppToConfigSource(src, appName) {
|
|
84
101
|
if (src.includes("deploy:")) return src;
|
|
85
102
|
|
|
@@ -391,6 +408,8 @@ ${dashboardLine}
|
|
|
391
408
|
logImpl(` Status: ${status.colored}`);
|
|
392
409
|
const memoryExceededDetails = formatMemoryExceededDetails(data);
|
|
393
410
|
if (memoryExceededDetails) logImpl(memoryExceededDetails);
|
|
411
|
+
const recoveryDetails = formatRecoveryDispositionDetails(data);
|
|
412
|
+
if (recoveryDetails) logImpl(recoveryDetails);
|
|
394
413
|
logImpl(` Port: ${data.port ?? `${DIM}not deployed${RESET}`}`);
|
|
395
414
|
if (isAppFailureStatus(data)) {
|
|
396
415
|
let diagnosticLines = selectAppDiagnosticLogLines(data);
|
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.220",
|
|
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",
|