create-egregore 0.19.32 → 0.19.33

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.19.32
2
+ // egregore-launcher-version: 0.19.33
3
3
  //
4
4
  // egregore — launch and browse Egregore instances from your terminal.
5
5
  // Installed by create-egregore. Reads ~/.egregore/instances.json.
@@ -33,7 +33,7 @@ const crypto = require("node:crypto");
33
33
  const { spawnSync, spawn } = require("node:child_process");
34
34
  const readline = require("node:readline");
35
35
 
36
- const VERSION = "0.19.32";
36
+ const VERSION = "0.19.33";
37
37
  const REGISTRY = path.join(os.homedir(), ".egregore", "instances.json");
38
38
  const DEFAULT_FILE = path.join(os.homedir(), ".egregore", "default");
39
39
  const UPDATE_CACHE_FILE = path.join(os.homedir(), ".egregore", "update-check.json");
package/bin/cli.js CHANGED
@@ -243,6 +243,8 @@ function parseArgs(argv) {
243
243
  args.noWelcome = true;
244
244
  } else if (argv[i] === "--refresh-launcher") {
245
245
  args.refreshLauncher = true;
246
+ } else if (argv[i] === "--refresh-connect") {
247
+ args.refreshConnect = true;
246
248
  } else if (argv[i] === "--codex") {
247
249
  args.runtime = "codex";
248
250
  } else if (argv[i] === "--pi") {
@@ -462,6 +464,33 @@ async function main() {
462
464
  }
463
465
  }
464
466
 
467
+ if (args.refreshConnect) {
468
+ // Session-start maintenance mode: refresh the Connect overlay for an
469
+ // existing instance. Local instances no-op instantly; network failure is
470
+ // reported but soft (session start must never break on this).
471
+ const { installConnectRuntime, connectEligibility } = require("../lib/connect-runtime");
472
+ const targetDir = process.cwd();
473
+ try {
474
+ const eligibility = connectEligibility(targetDir);
475
+ if (!eligibility.eligible) {
476
+ console.log(JSON.stringify({ status: "skipped", reason: eligibility.reason }));
477
+ process.exit(0);
478
+ }
479
+ const summary = await installConnectRuntime(targetDir);
480
+ console.log(JSON.stringify({
481
+ status: "refreshed",
482
+ installed: summary.installed,
483
+ updated: summary.updated,
484
+ skipped: summary.skipped,
485
+ conflicted: summary.conflicted,
486
+ }));
487
+ process.exit(0);
488
+ } catch (err) {
489
+ console.log(JSON.stringify({ status: "error", message: String(err.message || err) }));
490
+ process.exit(1);
491
+ }
492
+ }
493
+
465
494
  if (args.refreshLauncher) {
466
495
  const instances = readLocalInstances();
467
496
  if (instances.length === 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-egregore",
3
- "version": "0.19.32",
4
- "description": "Set up Egregore for your team in one command — installs the egregore launcher and your choice of Claude Code, Codex, or Pi.",
3
+ "version": "0.19.33",
4
+ "description": "Set up Egregore for your team in one command \u2014 installs the egregore launcher and your choice of Claude Code, Codex, or Pi.",
5
5
  "license": "MIT",
6
6
  "bin": {
7
7
  "create-egregore": "./bin/cli.js"
@@ -89,6 +89,11 @@ trap 'rm -rf "${CTX_DIR:-}"' EXIT
89
89
  # (terminal closed). Gated + idle-guarded inside the script; fire-and-forget.
90
90
  ( bash "$SCRIPT_DIR/bin/session-autosave.sh" --sweep >/dev/null 2>&1 & ) 2>/dev/null
91
91
 
92
+ # Connected instances pick up newly released Connect skills without
93
+ # re-running the launcher. Local mode exits instantly inside the script.
94
+ # Pi shares this path (pi-session-start.sh delegates here).
95
+ ( bash "$SCRIPT_DIR/bin/connect-refresh.sh" >/dev/null 2>&1 & ) 2>/dev/null
96
+
92
97
  read_json() {
93
98
  local file="$1"
94
99
  local expr="$2"
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env bash
2
+ # Refresh the Connect runtime overlay (skills served by the org's API) for
3
+ # this instance. Fired fire-and-forget from session start on every runtime;
4
+ # local-mode instances exit immediately and nothing here may block or break
5
+ # a session. New Connect features appear without re-running the launcher.
6
+ set -u
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
10
+ cd "$ROOT" || exit 0
11
+
12
+ # Connected instances only — resolved the same way the runtime does.
13
+ MODE=$(jq -r '.mode // empty' egregore.json 2>/dev/null)
14
+ API_URL=$(jq -r '.api_url // empty' egregore.json 2>/dev/null)
15
+ if [ "$MODE" != "connected" ] && [ -z "$API_URL" ]; then
16
+ exit 0
17
+ fi
18
+
19
+ LOG_DIR="$ROOT/.egregore"
20
+ mkdir -p "$LOG_DIR" 2>/dev/null || true
21
+ LOG="$LOG_DIR/connect-refresh.log"
22
+
23
+ # The refresh logic lives in the installed create-egregore tooling (client
24
+ # instances do not carry packages/ in their tree). --prefer-offline keeps the
25
+ # common case fast; the first run may fetch the package once.
26
+ {
27
+ echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] connect refresh"
28
+ npx --yes --prefer-offline create-egregore --refresh-connect 2>&1
29
+ } >>"$LOG" 2>&1 || true
30
+
31
+ # Keep the log bounded.
32
+ tail -n 200 "$LOG" >"$LOG.tmp" 2>/dev/null && mv "$LOG.tmp" "$LOG" 2>/dev/null || true
33
+ exit 0
@@ -114,6 +114,7 @@
114
114
  "bin/codex-session-start.sh",
115
115
  "bin/codex-skill-render.mjs",
116
116
  "bin/codex-sync-skills.sh",
117
+ "bin/connect-refresh.sh",
117
118
  "bin/dashboard-data.sh",
118
119
  "bin/graph-batch.sh",
119
120
  "bin/graph-op.sh",
@@ -89,6 +89,11 @@ trap 'rm -rf "${CTX_DIR:-}"' EXIT
89
89
  # (terminal closed). Gated + idle-guarded inside the script; fire-and-forget.
90
90
  ( bash "$SCRIPT_DIR/bin/session-autosave.sh" --sweep >/dev/null 2>&1 & ) 2>/dev/null
91
91
 
92
+ # Connected instances pick up newly released Connect skills without
93
+ # re-running the launcher. Local mode exits instantly inside the script.
94
+ # Pi shares this path (pi-session-start.sh delegates here).
95
+ ( bash "$SCRIPT_DIR/bin/connect-refresh.sh" >/dev/null 2>&1 & ) 2>/dev/null
96
+
92
97
  read_json() {
93
98
  local file="$1"
94
99
  local expr="$2"
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env bash
2
+ # Refresh the Connect runtime overlay (skills served by the org's API) for
3
+ # this instance. Fired fire-and-forget from session start on every runtime;
4
+ # local-mode instances exit immediately and nothing here may block or break
5
+ # a session. New Connect features appear without re-running the launcher.
6
+ set -u
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
10
+ cd "$ROOT" || exit 0
11
+
12
+ # Connected instances only — resolved the same way the runtime does.
13
+ MODE=$(jq -r '.mode // empty' egregore.json 2>/dev/null)
14
+ API_URL=$(jq -r '.api_url // empty' egregore.json 2>/dev/null)
15
+ if [ "$MODE" != "connected" ] && [ -z "$API_URL" ]; then
16
+ exit 0
17
+ fi
18
+
19
+ LOG_DIR="$ROOT/.egregore"
20
+ mkdir -p "$LOG_DIR" 2>/dev/null || true
21
+ LOG="$LOG_DIR/connect-refresh.log"
22
+
23
+ # The refresh logic lives in the installed create-egregore tooling (client
24
+ # instances do not carry packages/ in their tree). --prefer-offline keeps the
25
+ # common case fast; the first run may fetch the package once.
26
+ {
27
+ echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] connect refresh"
28
+ npx --yes --prefer-offline create-egregore --refresh-connect 2>&1
29
+ } >>"$LOG" 2>&1 || true
30
+
31
+ # Keep the log bounded.
32
+ tail -n 200 "$LOG" >"$LOG.tmp" 2>/dev/null && mv "$LOG.tmp" "$LOG" 2>/dev/null || true
33
+ exit 0
@@ -117,6 +117,7 @@
117
117
  "bin/codex-session-start.sh",
118
118
  "bin/codex-skill-render.mjs",
119
119
  "bin/codex-sync-skills.sh",
120
+ "bin/connect-refresh.sh",
120
121
  "bin/dashboard-data.sh",
121
122
  "bin/graph-batch.sh",
122
123
  "bin/graph-op.sh",