create-egregore 0.21.0-runtime-mvp.6 → 0.21.0-runtime-mvp.8

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // egregore-launcher-version: 0.21.0-runtime-mvp.6
2
+ // egregore-launcher-version: 0.21.0-runtime-mvp.8
3
3
  //
4
4
  // egregore — launch and browse Egregore instances from your terminal.
5
5
  // Installed by create-egregore. Reads ~/.egregore/instances.json.
@@ -35,7 +35,7 @@ const crypto = require("node:crypto");
35
35
  const { spawnSync, spawn } = require("node:child_process");
36
36
  const readline = require("node:readline");
37
37
 
38
- const VERSION = "0.21.0-runtime-mvp.6";
38
+ const VERSION = "0.21.0-runtime-mvp.8";
39
39
  const REGISTRY = path.join(os.homedir(), ".egregore", "instances.json");
40
40
  const DEFAULT_FILE = path.join(os.homedir(), ".egregore", "default");
41
41
  const UPDATE_CACHE_FILE = path.join(os.homedir(), ".egregore", "update-check.json");
@@ -3143,6 +3143,7 @@ function renderUpgradePanel({ inst, data, candidate, retrieval, mode, notice, wi
3143
3143
  if (notice) lines.push(boxLine(notice, innerWidth, margin));
3144
3144
  const keys = [];
3145
3145
  if (!status || status === "none" || ["pending", "failed", "interrupted", "cancelled", "rolled-back"].includes(status)) keys.push(`${BOLD}p${RESET}${DIM} prepare${RESET}`);
3146
+ if (status === "active" && candidate && candidate !== (data && data.active_version)) keys.push(`${BOLD}p${RESET}${DIM} prepare update${RESET}`);
3146
3147
  if (status === "ready-to-activate") keys.push(`${BOLD}a${RESET}${DIM} activate${RESET}`);
3147
3148
  if (status === "preparing") keys.push(`${BOLD}c${RESET}${DIM} cancel${RESET}`);
3148
3149
  if (status === "active") keys.push(`${BOLD}r${RESET}${DIM} roll back${RESET}`);
@@ -3169,6 +3170,40 @@ function renderSettingsPanel({ inst, data, cursor, view, domain, items, listCurs
3169
3170
  emptyBoxLine(innerWidth, margin),
3170
3171
  ];
3171
3172
 
3173
+ if (view === "workflow") {
3174
+ const current = (d.workflow === "simple" || d.workflow === "staged") ? d.workflow : "custom";
3175
+ lines.push(boxLine(`${BOLD}Git workflow${RESET}`, innerWidth, margin));
3176
+ lines.push(emptyBoxLine(innerWidth, margin));
3177
+ const options = [
3178
+ { key: "simple", name: "Simple", detail: "pull requests target main — one branch, no release staging" },
3179
+ { key: "staged", name: "Staged", detail: "pull requests target develop; releases promote to main" },
3180
+ ];
3181
+ options.forEach((option, i) => {
3182
+ const sel = i === listCursor;
3183
+ const marker = sel ? `${CYAN}❯${RESET}` : " ";
3184
+ const active = option.key === current ? ` ${GREEN}● current${RESET}` : "";
3185
+ lines.push(boxLine(`${marker} ${sel ? BOLD : ""}${option.name}${RESET}${active}`, innerWidth, margin));
3186
+ lines.push(boxLine(` ${DIM}${option.detail}${RESET}`, innerWidth, margin));
3187
+ });
3188
+ if (current === "custom") {
3189
+ lines.push(emptyBoxLine(innerWidth, margin));
3190
+ lines.push(boxLine(`${YELLOW}● current: CUSTOM${RESET} ${DIM}— pull requests target ${d.base_branch || "?"}${RESET}`, innerWidth, margin));
3191
+ lines.push(boxLine(` ${DIM}selecting an option above replaces this for the whole org${RESET}`, innerWidth, margin));
3192
+ }
3193
+ lines.push(emptyBoxLine(innerWidth, margin));
3194
+ if (mode === "confirm") {
3195
+ const target = listCursor === 0 ? "SIMPLE — pull requests target main" : "STAGED — pull requests target develop";
3196
+ lines.push(boxLine(`${YELLOW}Switch ${BOLD}${title}${RESET}${YELLOW} to ${target}?${RESET}`, innerWidth, margin));
3197
+ lines.push(boxLine(`${DIM}This edits the org's committed egregore.json for everyone.${RESET} ${DIM}y / N${RESET}`, innerWidth, margin));
3198
+ } else {
3199
+ if (notice) lines.push(boxLine(notice, innerWidth, margin));
3200
+ lines.push(boxLine(`${DIM}↑↓ nav · ${RESET}${BOLD}enter${RESET}${DIM} select · ← back · q quit${RESET}`, innerWidth, margin));
3201
+ }
3202
+ lines.push(emptyBoxLine(innerWidth, margin));
3203
+ lines.push(`${margin}${DIM}└${"─".repeat(innerWidth)}┘${RESET}`);
3204
+ return lines;
3205
+ }
3206
+
3172
3207
  if (view === "privacy" || view === "telemetry") {
3173
3208
  lines.push(boxLine(`${BOLD}${view === "privacy" ? "Privacy & access" : "Telemetry"}${RESET}`, innerWidth, margin));
3174
3209
  lines.push(emptyBoxLine(innerWidth, margin));
@@ -3330,7 +3365,7 @@ function renderSettingsPanel({ inst, data, cursor, view, domain, items, listCurs
3330
3365
  });
3331
3366
  lines.push(emptyBoxLine(innerWidth, margin));
3332
3367
  if (notice) lines.push(boxLine(notice, innerWidth, margin));
3333
- lines.push(boxLine(`${DIM}↑↓ nav · ${RESET}${BOLD}enter${RESET}${DIM} ${cursor === 3 || cursor === 4 ? "toggle" : "open"} · ← back · q quit${RESET}`, innerWidth, margin));
3368
+ lines.push(boxLine(`${DIM}↑↓ nav · ${RESET}${BOLD}enter${RESET}${DIM} ${cursor === 3 ? "toggle" : "open"} · ← back · q quit${RESET}`, innerWidth, margin));
3334
3369
  }
3335
3370
 
3336
3371
  lines.push(emptyBoxLine(innerWidth, margin));
@@ -3827,9 +3862,12 @@ async function browser(args = {}) {
3827
3862
  render(); return;
3828
3863
  }
3829
3864
  const status = state.upgradeData && state.upgradeData.status;
3830
- if (chunk === "p" && (!status || ["none", "pending", "failed", "interrupted", "cancelled", "rolled-back"].includes(status))) {
3865
+ const activeUpdatable = status === "active"
3866
+ && state.upgradeCandidate
3867
+ && state.upgradeCandidate !== (state.upgradeData && state.upgradeData.active_version);
3868
+ if (chunk === "p" && (!status || activeUpdatable || ["none", "pending", "failed", "interrupted", "cancelled", "rolled-back"].includes(status))) {
3831
3869
  const staged = state.upgradeData
3832
- && !["none", "cancelled", "rolled-back"].includes(status)
3870
+ && !["none", "cancelled", "rolled-back", "active"].includes(status)
3833
3871
  && state.upgradeData.candidate_version;
3834
3872
  if (!staged) {
3835
3873
  const candidate = state.upgradeCandidate;
@@ -3876,6 +3914,36 @@ async function browser(args = {}) {
3876
3914
  if (key.ctrl && key.name === "c") { cleanup(); process.exit(130); }
3877
3915
  if (key.name === "q") { cleanup(); resolve(); return; }
3878
3916
 
3917
+ if (S.settingsView === "workflow") {
3918
+ if (S.settingsMode === "confirm") {
3919
+ if (chunk === "y" || chunk === "Y") {
3920
+ settingsRunVerb(["workflow", S.settingsListCursor === 0 ? "simple" : "staged"]);
3921
+ S.settingsMode = "browse";
3922
+ S.settingsView = "menu";
3923
+ render(); return;
3924
+ }
3925
+ if (key.name === "escape" || chunk === "n" || chunk === "N" || key.name === "return") {
3926
+ S.settingsMode = "browse"; render(); return;
3927
+ }
3928
+ return;
3929
+ }
3930
+ if (key.name === "escape" || key.name === "left") {
3931
+ S.settingsView = "menu"; S.settingsNotice = ""; render(); return;
3932
+ }
3933
+ if (key.name === "up" || key.name === "k") { S.settingsListCursor = (S.settingsListCursor + 1) % 2; render(); return; }
3934
+ if (key.name === "down" || key.name === "j") { S.settingsListCursor = (S.settingsListCursor + 1) % 2; render(); return; }
3935
+ if (key.name === "return") {
3936
+ const chosen = S.settingsListCursor === 0 ? "simple" : "staged";
3937
+ const current = (S.settingsData && S.settingsData.workflow) || "custom";
3938
+ if (chosen === current) {
3939
+ S.settingsNotice = `${DIM}already on ${chosen.toUpperCase()}${RESET}`;
3940
+ render(); return;
3941
+ }
3942
+ S.settingsMode = "confirm"; render(); return;
3943
+ }
3944
+ return;
3945
+ }
3946
+
3879
3947
  if (S.settingsView === "privacy" || S.settingsView === "telemetry") {
3880
3948
  const backToMenu = () => {
3881
3949
  S.settingsView = "menu"; S.settingsMode = "browse"; S.settingsInput = ""; S.settingsNotice = ""; render();
@@ -4072,8 +4140,9 @@ async function browser(args = {}) {
4072
4140
  settingsRunVerb(["hosting", on ? "off" : "on"]);
4073
4141
  render();
4074
4142
  } else if (S.settingsCursor === 4) {
4075
- const simple = (S.settingsData && S.settingsData.workflow) === "simple";
4076
- settingsRunVerb(["workflow", simple ? "staged" : "simple"]);
4143
+ S.settingsView = "workflow"; S.settingsMode = "browse";
4144
+ S.settingsListCursor = (S.settingsData && S.settingsData.workflow) === "simple" ? 0 : 1;
4145
+ S.settingsNotice = "";
4077
4146
  render();
4078
4147
  } else {
4079
4148
  const domain = S.settingsCursor === 5 ? "repo" : S.settingsCursor === 6 ? "admin" : "people";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-egregore",
3
- "version": "0.21.0-runtime-mvp.6",
3
+ "version": "0.21.0-runtime-mvp.8",
4
4
  "description": "Set up Egregore for your team in one command — installs the egregore launcher and your choice of Claude Code, Codex, or Pi.",
5
5
  "license": "MIT",
6
6
  "bin": {