gencow 0.1.11 → 0.1.13

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.
Files changed (2) hide show
  1. package/bin/gencow.mjs +18 -33
  2. package/package.json +1 -1
package/bin/gencow.mjs CHANGED
@@ -1461,17 +1461,13 @@ ${BOLD}Examples:${RESET}
1461
1461
  info("배포 중...");
1462
1462
  const bundleBuffer = readFileSync(tmpBundle);
1463
1463
 
1464
- const deployRes = await fetch(
1465
- `${creds.platformUrl}/platform/apps/${appName}/deploy?env=${envTarget}`,
1466
- {
1467
- method: "POST",
1468
- headers: {
1469
- "Authorization": `Bearer ${creds.apiKey}`,
1470
- "Content-Type": "application/octet-stream",
1471
- },
1472
- body: bundleBuffer,
1473
- }
1474
- );
1464
+ const deployRes = await platformFetch(creds, `/platform/apps/${appName}/deploy?env=${envTarget}`, {
1465
+ method: "POST",
1466
+ headers: {
1467
+ "Content-Type": "application/octet-stream",
1468
+ },
1469
+ body: bundleBuffer,
1470
+ });
1475
1471
 
1476
1472
  // 임시 파일 정리
1477
1473
  try { unlinkSync(tmpBundle); } catch { }
@@ -1483,14 +1479,7 @@ ${BOLD}Examples:${RESET}
1483
1479
  if (deployRes.status === 404) {
1484
1480
  warn(`앱 "${appName}"이 아직 없습니다. 생성합니다...`);
1485
1481
 
1486
- const createRes = await fetch(`${creds.platformUrl}/api/mutation`, {
1487
- method: "POST",
1488
- headers: {
1489
- "Content-Type": "application/json",
1490
- "Authorization": `Bearer ${creds.apiKey}`,
1491
- },
1492
- body: JSON.stringify({ name: "apps.create", args: { name: appName } }),
1493
- });
1482
+ const createRes = await rpcMutation(creds, "apps.create", { name: appName });
1494
1483
 
1495
1484
  if (!createRes.ok) {
1496
1485
  const createErr = await createRes.json().catch(() => ({}));
@@ -1506,17 +1495,13 @@ ${BOLD}Examples:${RESET}
1506
1495
  // tar.gz를 다시 만들어야 함 (위에서 삭제했으므로)
1507
1496
  exec(`tar -czf "${tmpBundle}" ${filesToPack.join(" ")}`, { cwd: process.cwd() });
1508
1497
  const retryBuffer = readFileSync(tmpBundle);
1509
- const retryRes = await fetch(
1510
- `${creds.platformUrl}/platform/apps/${appName}/deploy?env=${envTarget}`,
1511
- {
1512
- method: "POST",
1513
- headers: {
1514
- "Authorization": `Bearer ${creds.apiKey}`,
1515
- "Content-Type": "application/octet-stream",
1516
- },
1517
- body: retryBuffer,
1518
- }
1519
- );
1498
+ const retryRes = await platformFetch(creds, `/platform/apps/${appName}/deploy?env=${envTarget}`, {
1499
+ method: "POST",
1500
+ headers: {
1501
+ "Content-Type": "application/octet-stream",
1502
+ },
1503
+ body: retryBuffer,
1504
+ });
1520
1505
  try { unlinkSync(tmpBundle); } catch { }
1521
1506
 
1522
1507
  if (!retryRes.ok) {
@@ -1967,7 +1952,7 @@ ${BOLD}Examples:${RESET}
1967
1952
  info(`Uploading to ${creds.platformUrl}...`);
1968
1953
  const form = new FormData();
1969
1954
  form.append("bundle", new Blob([bundle], { type: "application/gzip" }), "bundle.tar.gz");
1970
- const res = await platformFetch(creds, `/api/apps/${appName}/deploy`, {
1955
+ const res = await platformFetch(creds, `/platform/apps/${appName}/deploy`, {
1971
1956
  method: "POST",
1972
1957
  body: form,
1973
1958
  });
@@ -2121,7 +2106,7 @@ ${BOLD}Examples:${RESET}
2121
2106
  const form = new FormData();
2122
2107
  form.append("bundle", new Blob([bundle], { type: "application/gzip" }), "bundle.tar.gz");
2123
2108
 
2124
- const res = await platformFetch(creds, `/api/apps/${appName}/deploy`, {
2109
+ const res = await platformFetch(creds, `/platform/apps/${appName}/deploy`, {
2125
2110
  method: "POST", body: form,
2126
2111
  });
2127
2112
  const data = await res.json();
@@ -2164,7 +2149,7 @@ ${BOLD}${CYAN}Gencow Dev Remote${RESET}
2164
2149
  // ── 주기적 상태 확인 (30s) ───────────────────────
2165
2150
  setInterval(async () => {
2166
2151
  try {
2167
- const res = await platformFetch(creds, `/api/apps/${appName}`);
2152
+ const res = await platformFetch(creds, `/platform/apps/${appName}`);
2168
2153
  const data = await res.json();
2169
2154
  const ts = new Date().toLocaleTimeString();
2170
2155
  const status = data.running ? `${GREEN}running${RESET}` : `${YELLOW}${data.status}${RESET}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gencow",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Gencow — Backend OS for AI Agents",
5
5
  "type": "module",
6
6
  "bin": {