pantheon-cli 0.2.77 → 0.2.79

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/dist/pantheon.mjs +25 -12
  2. package/package.json +3 -3
package/dist/pantheon.mjs CHANGED
@@ -43932,6 +43932,7 @@ async function responseError(response) {
43932
43932
  }
43933
43933
  async function publishOutbox(config2, credentials, outbox, fetcher) {
43934
43934
  const requestBudget = DRIVE_MAX_REQUEST_BYTES - 128 * 1024;
43935
+ const maxChangesPerBatch = 5;
43935
43936
  const groups = [];
43936
43937
  const skipped = [];
43937
43938
  let group = [];
@@ -43945,7 +43946,7 @@ async function publishOutbox(config2, credentials, outbox, fetcher) {
43945
43946
  });
43946
43947
  continue;
43947
43948
  }
43948
- if (group.length && groupBytes + bytes > requestBudget) {
43949
+ if (group.length && (group.length >= maxChangesPerBatch || groupBytes + bytes > requestBudget)) {
43949
43950
  groups.push(group);
43950
43951
  group = [];
43951
43952
  groupBytes = 0;
@@ -43971,17 +43972,29 @@ async function publishOutbox(config2, credentials, outbox, fetcher) {
43971
43972
  if (Buffer.byteLength(body) > DRIVE_MAX_REQUEST_BYTES) {
43972
43973
  throw new Error("Drive sync batch exceeds the request limit.");
43973
43974
  }
43974
- const response = await fetcher(`${config2.apiUrl}/api/cli/workspace/sync`, {
43975
- method: "POST",
43976
- headers: {
43977
- ...auth(config2, credentials),
43978
- "content-type": "application/json"
43979
- },
43980
- body,
43981
- signal: AbortSignal.timeout(3e4)
43982
- });
43983
- if (!response.ok) throw await responseError(response);
43984
- published = await response.json();
43975
+ for (let attempt = 1; attempt <= 4; attempt += 1) {
43976
+ const response = await fetcher(`${config2.apiUrl}/api/cli/workspace/sync`, {
43977
+ method: "POST",
43978
+ headers: {
43979
+ ...auth(config2, credentials),
43980
+ "content-type": "application/json"
43981
+ },
43982
+ body,
43983
+ signal: AbortSignal.timeout(6e4)
43984
+ });
43985
+ if (response.ok) {
43986
+ published = await response.json();
43987
+ break;
43988
+ }
43989
+ const error2 = await responseError(response);
43990
+ if (error2.status !== 503 || !/already uploading/i.test(error2.message) || attempt === 4) {
43991
+ throw error2;
43992
+ }
43993
+ await new Promise((resolveDelay) => setTimeout(resolveDelay, 2e3));
43994
+ }
43995
+ if (!published) {
43996
+ throw new Error("Drive sync batch did not return a published revision.");
43997
+ }
43985
43998
  baseRevision = published.revision;
43986
43999
  merged ||= Boolean(published.merged);
43987
44000
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-cli",
3
- "version": "0.2.77",
3
+ "version": "0.2.79",
4
4
  "description": "Carry agent conscience between AI coding agents. Hand off a conversation in one agent, resume it in another.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,8 +30,8 @@
30
30
  "tsx": "^4.20.3",
31
31
  "typescript": "^5",
32
32
  "zod": "^3.25.67",
33
- "@pantheon/core": "0.1.0",
34
- "@pantheon/mcp": "0.1.0"
33
+ "@pantheon/mcp": "0.1.0",
34
+ "@pantheon/core": "0.1.0"
35
35
  },
36
36
  "scripts": {
37
37
  "start": "tsx src/index.ts",