@pipod/cli 0.1.15 → 0.1.17

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/dist/cli.js CHANGED
@@ -5185,6 +5185,11 @@ async function runSeed(opts) {
5185
5185
  info("reusing this pod's warm workspace \u2014 nothing copied");
5186
5186
  return { kind: "skipped", reason: "reused pod" };
5187
5187
  }
5188
+ const settled = opts.pod.resolvedConfig.workspaceSeed;
5189
+ if (settled?.status === "skipped") {
5190
+ info("workspace already populated (an init script filled it) \u2014 nothing sent");
5191
+ return { kind: "skipped", reason: "workspace not empty" };
5192
+ }
5188
5193
  switch (plan.kind) {
5189
5194
  case "copy":
5190
5195
  return copyWorkspaceIntoPod(opts, plan.root);
@@ -14889,14 +14894,31 @@ import * as path22 from "path";
14889
14894
  var PAGE_LIMIT = 200;
14890
14895
  async function listAllPods(client, query) {
14891
14896
  const pods = [];
14897
+ const seenIds = /* @__PURE__ */ new Set();
14898
+ const seenCursors = /* @__PURE__ */ new Set();
14899
+ let cursor;
14892
14900
  let before;
14893
14901
  for (; ; ) {
14894
- const page = await client.listPods({ mine: true, limit: PAGE_LIMIT, before, ...query });
14895
- pods.push(...page.pods);
14896
- if (page.pods.length < PAGE_LIMIT) return { pods };
14897
- const cursor = activityStamp(page.pods.at(-1));
14898
- if (cursor === before) return { pods };
14899
- before = cursor;
14902
+ const page = await client.listPods({ mine: true, limit: PAGE_LIMIT, cursor, before, ...query });
14903
+ for (const pod of page.pods) {
14904
+ if (!seenIds.has(pod.id)) pods.push(pod);
14905
+ seenIds.add(pod.id);
14906
+ }
14907
+ const next = page.nextCursor !== void 0 ? page.nextCursor : page.pods.length < PAGE_LIMIT ? null : activityStamp(page.pods.at(-1));
14908
+ if (next === null) return { pods };
14909
+ if (seenCursors.has(next)) {
14910
+ throw new PiPodError("the server repeated a pod-list cursor", {
14911
+ hint: "the listing is incomplete; upgrade the server and try again"
14912
+ });
14913
+ }
14914
+ seenCursors.add(next);
14915
+ if (page.nextCursor !== void 0) {
14916
+ cursor = next;
14917
+ before = void 0;
14918
+ } else {
14919
+ before = next;
14920
+ cursor = void 0;
14921
+ }
14900
14922
  }
14901
14923
  }
14902
14924
  async function podsInScope(client, flags, cwd) {