gipity 1.1.24 → 1.1.25

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.
@@ -3,7 +3,7 @@ import { get, post } from '../api.js';
3
3
  import { requireConfig, resolveApiBase, getEnvOption } from '../config.js';
4
4
  import { formatSize } from '../utils.js';
5
5
  import { success, error as clrError, warning, muted, bold, brand } from '../colors.js';
6
- import { run, syncBeforeAction } from '../helpers/index.js';
6
+ import { run, syncBeforeAction, syncAfterAction } from '../helpers/index.js';
7
7
  import { withSpinner } from '../progress.js';
8
8
  import { inspectPage } from './page-inspect.js';
9
9
  // ── Status icons ───────────────────────────────────────────────────────
@@ -119,6 +119,7 @@ export const deployCommand = new Command('deploy')
119
119
  }
120
120
  };
121
121
  if (opts.json) {
122
+ await syncAfterAction(opts);
122
123
  console.log(JSON.stringify(d));
123
124
  const failedJson = d.phases?.some(p => p.status === 'failed');
124
125
  // The exit code carries the outcome too, so a script reading --json
@@ -150,6 +151,7 @@ export const deployCommand = new Command('deploy')
150
151
  if (d.warning) {
151
152
  console.log(`${warning(d.warning)}`);
152
153
  }
154
+ await syncAfterAction(opts);
153
155
  // Show example curl commands for public endpoints
154
156
  if (d.examples && d.examples.length > 0) {
155
157
  console.log('');
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export { run } from './command.js';
5
5
  export { printOutput, printList, printResult, pluckField, emitField } from './output.js';
6
- export { syncBeforeAction } from './sync.js';
6
+ export { syncBeforeAction, syncAfterAction } from './sync.js';
7
7
  export { resolveJsonBody, resolveBody, resolveFormBody } from './body.js';
8
8
  export { parseDuration } from './duration.js';
9
9
  //# sourceMappingURL=index.js.map
@@ -41,4 +41,22 @@ export async function syncBeforeAction(opts) {
41
41
  console.error(clrError(`[sync] ${e}`));
42
42
  }
43
43
  }
44
+ /**
45
+ * Pull down files the action itself wrote on the server. A deploy can rewrite
46
+ * source (auto-declared functions in gipity.yaml, a share card re-synced to the
47
+ * page title); the editor hooks only pull before the next user turn, so an agent
48
+ * editing right after the deploy would read the stale local copy.
49
+ */
50
+ export async function syncAfterAction(opts) {
51
+ if (opts.sync === false)
52
+ return;
53
+ const result = await sync({ interactive: false });
54
+ if (result.applied > 0 && !opts.json) {
55
+ console.log(muted(`Pulled ${result.applied} file${result.applied > 1 ? 's' : ''} the deploy updated`));
56
+ }
57
+ if (result.errors.length > 0 && !opts.json) {
58
+ for (const e of result.errors)
59
+ console.error(clrError(`[sync] ${e}`));
60
+ }
61
+ }
44
62
  //# sourceMappingURL=sync.js.map
package/dist/index.js CHANGED
@@ -34468,7 +34468,7 @@ function describeFetchError(err, input, proxyActive, env = process.env) {
34468
34468
  let protocol;
34469
34469
  try {
34470
34470
  const url = new URL(input instanceof Request ? input.url : String(input));
34471
- origin = url.origin;
34471
+ origin = /(^|\.)amazonaws\.com$/i.test(url.hostname) ? "Gipity Storage" : url.origin;
34472
34472
  protocol = url.protocol;
34473
34473
  } catch {
34474
34474
  }
@@ -34826,7 +34826,7 @@ async function withRetry(label2, fn, attempts = 3) {
34826
34826
  if (i === attempts - 1) break;
34827
34827
  const delay2 = 500 * Math.pow(2, i);
34828
34828
  await new Promise((r) => setTimeout(r, delay2));
34829
- console.error(`[upload] ${label2} attempt ${i + 1} failed, retrying in ${delay2}ms: ${err.message}`);
34829
+ if (i > 0) console.error(`[upload] ${label2} attempt ${i + 1} failed, retrying in ${delay2}ms: ${err.message}`);
34830
34830
  }
34831
34831
  }
34832
34832
  throw lastErr;
@@ -36224,6 +36224,16 @@ async function syncBeforeAction(opts) {
36224
36224
  for (const e of result.errors) console.error(error(`[sync] ${e}`));
36225
36225
  }
36226
36226
  }
36227
+ async function syncAfterAction(opts) {
36228
+ if (opts.sync === false) return;
36229
+ const result = await sync({ interactive: false });
36230
+ if (result.applied > 0 && !opts.json) {
36231
+ console.log(muted(`Pulled ${result.applied} file${result.applied > 1 ? "s" : ""} the deploy updated`));
36232
+ }
36233
+ if (result.errors.length > 0 && !opts.json) {
36234
+ for (const e of result.errors) console.error(error(`[sync] ${e}`));
36235
+ }
36236
+ }
36227
36237
 
36228
36238
  // src/helpers/body.ts
36229
36239
  import { readFileSync as readFileSync9 } from "node:fs";
@@ -39191,6 +39201,7 @@ var deployCommand = new Command("deploy").description("Deploy the app to prod, o
39191
39201
  }
39192
39202
  };
39193
39203
  if (opts.json) {
39204
+ await syncAfterAction(opts);
39194
39205
  console.log(JSON.stringify(d));
39195
39206
  const failedJson = d.phases?.some((p) => p.status === "failed");
39196
39207
  if (failedJson) process.exit(1);
@@ -39215,6 +39226,7 @@ var deployCommand = new Command("deploy").description("Deploy the app to prod, o
39215
39226
  if (d.warning) {
39216
39227
  console.log(`${warning(d.warning)}`);
39217
39228
  }
39229
+ await syncAfterAction(opts);
39218
39230
  if (d.examples && d.examples.length > 0) {
39219
39231
  console.log("");
39220
39232
  console.log(bold("Test your endpoints:"));
package/dist/net.js CHANGED
@@ -56,7 +56,8 @@ export function describeFetchError(err, input, proxyActive, env = process.env) {
56
56
  let protocol;
57
57
  try {
58
58
  const url = new URL(input instanceof Request ? input.url : String(input));
59
- origin = url.origin;
59
+ // Uploads go straight to the storage provider; users see it as Gipity Storage.
60
+ origin = /(^|\.)amazonaws\.com$/i.test(url.hostname) ? 'Gipity Storage' : url.origin;
60
61
  protocol = url.protocol;
61
62
  }
62
63
  catch { /* keep the generic name */ }
package/dist/upload.js CHANGED
@@ -90,7 +90,12 @@ async function withRetry(label, fn, attempts = 3) {
90
90
  break;
91
91
  const delay = 500 * Math.pow(2, i);
92
92
  await new Promise(r => setTimeout(r, delay));
93
- console.error(`[upload] ${label} attempt ${i + 1} failed, retrying in ${delay}ms: ${err.message}`);
93
+ // The first failure is usually a pooled connection the storage host had
94
+ // already closed (ECONNRESET on the first PUT after a pause), and the retry
95
+ // succeeds. Printing it made agents and reviewers treat a healthy upload as
96
+ // a network fault, so only a second failure is reported.
97
+ if (i > 0)
98
+ console.error(`[upload] ${label} attempt ${i + 1} failed, retrying in ${delay}ms: ${err.message}`);
94
99
  }
95
100
  }
96
101
  throw lastErr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gipity",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
5
5
  "bin": {
6
6
  "gipity": "dist/updater/shim.js",