@open-mercato/cezar 0.20.0-pr2175.5218 → 0.20.0-pr2178.5222

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 (23) hide show
  1. package/dist/server/forge/github.js +8 -52
  2. package/dist/server/forge/github.js.map +1 -1
  3. package/package.json +3 -3
  4. package/web/dist/assets/{agent-task-pickers-nXEO3bTe.js → agent-task-pickers-BlWVDJAk.js} +1 -1
  5. package/web/dist/assets/{assets-view-Dx-L6lAG.js → assets-view-B4A0T8Ok.js} +1 -1
  6. package/web/dist/assets/{automations-route-DIHCMnRE.js → automations-route-ClcNbJDY.js} +1 -1
  7. package/web/dist/assets/{compare-variants-CpQQ2HsI.js → compare-variants-BNsxKH-X.js} +1 -1
  8. package/web/dist/assets/{dashboard-BAOTK4nI.js → dashboard-DA7xriGH.js} +1 -1
  9. package/web/dist/assets/{github-D_c5gqhq.js → github-BuwQIYfD.js} +1 -1
  10. package/web/dist/assets/{index-CIGRJwZ5.js → index-BYz_gF5O.js} +3 -3
  11. package/web/dist/assets/index-CFfuvPs_.css +2 -0
  12. package/web/dist/assets/manager-chat-Cbpk6Zea.js +3 -0
  13. package/web/dist/assets/{manager-index-ChLlk2yi.js → manager-index-BifICfb2.js} +1 -1
  14. package/web/dist/assets/{manager-settings-B7H3DaRM.js → manager-settings-CB0sjg21.js} +1 -1
  15. package/web/dist/assets/{repo-git-CEFH3VqP.js → repo-git-Cauuc1IS.js} +1 -1
  16. package/web/dist/assets/{skills-CBmhfvy9.js → skills-BnIC-at6.js} +1 -1
  17. package/web/dist/assets/{task-graph-DpiYpQCa.js → task-graph-SnwsrGzv.js} +1 -1
  18. package/web/dist/assets/{task-workspace-3K33PQkf.js → task-workspace-7-wFK2l_.js} +2 -2
  19. package/web/dist/assets/{tracker-DiXKepDZ.js → tracker-CpnC_NYX.js} +1 -1
  20. package/web/dist/assets/{workflow-graph-CS4Z3cx9.js → workflow-graph-DcYSgKIQ.js} +1 -1
  21. package/web/dist/index.html +2 -2
  22. package/web/dist/assets/index-CqNq4SFM.css +0 -2
  23. package/web/dist/assets/manager-chat-S9QFfRSe.js +0 -3
@@ -2998,71 +2998,38 @@ function protectionAbsent(err) {
2998
2998
  .join('\n');
2999
2999
  return /HTTP 404/.test(text) && PROTECTION_ABSENT.test(text);
3000
3000
  }
3001
- /** GitHub's 403 when the repository's plan has no branch protection at all — a private repo on
3002
- * GitHub Free (#2173). Matched on the body's exact message; any other 403 stays unreadable. */
3003
- const PLAN_GATED_MESSAGE = 'Upgrade to GitHub Pro or make this repository public to enable this feature.';
3004
- const PLAN_GATED = Symbol('plan-gated');
3005
- const NOT_CONFIGURED = Symbol('not-configured');
3006
- function planGated(err) {
3007
- const stdout = err?.stdout;
3008
- if (typeof stdout !== 'string')
3009
- return false;
3010
- try {
3011
- const body = z.object({ message: z.string(), status: z.union([z.string(), z.number()]).nullish() }).parse(JSON.parse(stdout));
3012
- // Older GitHub Enterprise bodies carry no `status`; `gh` still names the code on stderr.
3013
- const forbidden = body.status != null ? String(body.status) === '403' : /\(HTTP 403\)/.test(ghStderr(err) ?? '');
3014
- return forbidden && body.message === PLAN_GATED_MESSAGE;
3015
- }
3016
- catch {
3017
- return false;
3018
- }
3019
- }
3020
3001
  const rulesetRulesSchema = z.array(z.object({ type: z.string(), parameters: z.record(z.string(), z.unknown()).nullish() }).passthrough());
3021
3002
  /**
3022
3003
  * The base branch's required checks and reviews, merged from classic branch protection and
3023
3004
  * repository rulesets — classic protection alone misses every ruleset-based requirement. Any read
3024
- * that fails for a reason other than "not configured" leaves the whole answer unreadable — except
3025
- * a plan-gated 403 on a branch GitHub itself reports unprotected (#2173).
3005
+ * that fails for a reason other than "not configured" leaves the whole answer unreadable.
3026
3006
  */
3027
3007
  async function fetchMergeRequirements(repoRoot, repoRef, base) {
3028
3008
  const repo = `repos/${repoRef.owner}/${repoRef.repo}`;
3029
3009
  const branch = encodeURIComponent(base);
3030
- const classic = (path, parse) => gh(repoRoot, ['api', `${repo}/branches/${branch}/protection/${path}`])
3010
+ const classic = (path, parse, absent) => gh(repoRoot, ['api', `${repo}/branches/${branch}/protection/${path}`])
3031
3011
  .then(parse)
3032
- .catch((err) => (protectionAbsent(err) ? NOT_CONFIGURED : planGated(err) ? PLAN_GATED : null));
3033
- const [checksRead, reviewsRead, rulesRead] = await Promise.all([
3012
+ .catch((err) => (protectionAbsent(err) ? absent : null));
3013
+ const [classicChecks, classicReviews, rules] = await Promise.all([
3034
3014
  classic('required_status_checks', (output) => {
3035
3015
  const body = z
3036
3016
  .object({ contexts: z.array(z.string()).nullish(), checks: z.array(z.object({ context: z.string() })).nullish() })
3037
3017
  .parse(JSON.parse(output));
3038
3018
  return [...(body.contexts ?? []), ...(body.checks ?? []).map((check) => check.context)];
3039
- }),
3019
+ }, []),
3040
3020
  classic('required_pull_request_reviews', (output) => {
3041
3021
  const body = z
3042
3022
  .object({ required_approving_review_count: z.number().nullish(), require_code_owner_reviews: z.boolean().nullish() })
3043
3023
  .parse(JSON.parse(output));
3044
3024
  return (body.required_approving_review_count ?? 0) > 0 || body.require_code_owner_reviews === true;
3045
- }),
3025
+ }, false),
3046
3026
  gh(repoRoot, ['api', `${repo}/rules/branches/${branch}?per_page=100`])
3047
3027
  .then((output) => rulesetRulesSchema.parse(JSON.parse(output)))
3048
- .catch((err) => (planGated(err) ? PLAN_GATED : null)),
3028
+ .catch(() => null),
3049
3029
  ]);
3050
- if (checksRead === null || reviewsRead === null || rulesRead === null) {
3030
+ if (classicChecks === null || classicReviews === null || rules === null) {
3051
3031
  return { readable: false, requiredChecks: [] };
3052
3032
  }
3053
- if (checksRead === PLAN_GATED || reviewsRead === PLAN_GATED || rulesRead === PLAN_GATED) {
3054
- // The plan hides the rules, so only the branch's own `protected` flag (which covers classic
3055
- // protection and rulesets) can say there are none — and nothing we did read may disagree.
3056
- const quiet = (checksRead === PLAN_GATED || checksRead === NOT_CONFIGURED) &&
3057
- (reviewsRead === PLAN_GATED || reviewsRead === NOT_CONFIGURED) &&
3058
- (rulesRead === PLAN_GATED || rulesRead.length === 0);
3059
- if (!quiet || !(await branchUnprotected(repoRoot, repo, base)))
3060
- return { readable: false, requiredChecks: [] };
3061
- return { readable: true, requiredChecks: [], reviewsRequired: false };
3062
- }
3063
- const classicChecks = checksRead === NOT_CONFIGURED ? [] : checksRead;
3064
- const classicReviews = reviewsRead === NOT_CONFIGURED ? false : reviewsRead;
3065
- const rules = rulesRead;
3066
3033
  const requiredChecks = new Set(classicChecks);
3067
3034
  let reviewsRequired = classicReviews;
3068
3035
  for (const rule of rules) {
@@ -3085,17 +3052,6 @@ async function fetchMergeRequirements(repoRoot, repoRef, base) {
3085
3052
  }
3086
3053
  return { readable: true, requiredChecks: [...requiredChecks].sort(), reviewsRequired };
3087
3054
  }
3088
- /** True only when GitHub's answer for exactly `base` parses and says `protected: false`. */
3089
- async function branchUnprotected(repoRoot, repo, base) {
3090
- try {
3091
- const output = await gh(repoRoot, ['api', `${repo}/branches/${encodeURIComponent(base)}`]);
3092
- const body = z.object({ name: z.string(), protected: z.boolean() }).parse(JSON.parse(output));
3093
- return body.name === base && body.protected === false;
3094
- }
3095
- catch {
3096
- return false;
3097
- }
3098
- }
3099
3055
  /** Test hook — the merge-state cache would otherwise leak state across cases in one process. */
3100
3056
  export function __clearMergeStateCacheForTests() {
3101
3057
  mergeStateCache.clear();