@starlein/paperclip-plugin-company-wizard 0.3.15 → 0.3.18

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/worker.js CHANGED
@@ -9373,6 +9373,17 @@ async function readJson(p) {
9373
9373
  function toPascalCase(name) {
9374
9374
  return name.replace(/[^a-zA-Z0-9\s\-_]/g, "").split(/[\s\-_]+/).filter(Boolean).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
9375
9375
  }
9376
+ function normalizeExecutionBaseRef(ref, fallbackRef) {
9377
+ const candidates = [ref, fallbackRef].filter(
9378
+ (value) => typeof value === "string" && value.trim()
9379
+ );
9380
+ const selected = candidates.length > 0 ? String(candidates[0]).trim() : "";
9381
+ if (!selected) return "origin/main";
9382
+ if (selected.startsWith("origin/") || selected.startsWith("refs/")) {
9383
+ return selected;
9384
+ }
9385
+ return `origin/${selected}`;
9386
+ }
9376
9387
  async function assembleCompany({
9377
9388
  companyName,
9378
9389
  companyDescription = "",
@@ -10024,6 +10035,18 @@ Read: \`docs/${doc}\`
10024
10035
  if (!policy || typeof policy !== "object") return null;
10025
10036
  if (policy.defaultMode === "isolated_workspace") {
10026
10037
  if (!enableIsolatedWorktrees || isFreshLocalRepo(workspace)) return null;
10038
+ const strategy = policy.workspaceStrategy;
10039
+ if (!strategy || typeof strategy !== "object") return policy;
10040
+ if (strategy.type !== "git_worktree") return policy;
10041
+ const workspaceStrategy = { ...strategy };
10042
+ const normalizedBaseRef = normalizeExecutionBaseRef(
10043
+ workspaceStrategy.baseRef,
10044
+ workspace?.repoRef || workspace?.defaultRef
10045
+ );
10046
+ if (normalizedBaseRef) {
10047
+ workspaceStrategy.baseRef = normalizedBaseRef;
10048
+ }
10049
+ return { ...policy, workspaceStrategy };
10027
10050
  }
10028
10051
  return policy;
10029
10052
  };