@kenkaiiii/gg-boss 4.3.145 → 4.3.147

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
@@ -43,7 +43,7 @@ import {
43
43
  use_app_default,
44
44
  use_input_default,
45
45
  use_stdout_default
46
- } from "./chunk-3EWLK53W.js";
46
+ } from "./chunk-ZQ7U73JW.js";
47
47
  import "./chunk-QT366Y52.js";
48
48
  import {
49
49
  source_default
@@ -164,7 +164,7 @@ init_esm_shims();
164
164
  // package.json
165
165
  var package_default = {
166
166
  name: "@kenkaiiii/gg-boss",
167
- version: "4.3.145",
167
+ version: "4.3.147",
168
168
  type: "module",
169
169
  description: "Orchestrator agent that drives multiple ggcoder sessions across projects from a single chat",
170
170
  license: "MIT",
@@ -2026,15 +2026,13 @@ function StreamingToolRow({ tool }) {
2026
2026
  function renderBossApp(opts) {
2027
2027
  const ref = { instance: null };
2028
2028
  const resetUI = () => {
2029
- const inst = ref.instance;
2030
- if (!inst) return;
2031
- const internals = inst;
2029
+ const old = ref.instance;
2030
+ if (!old) return;
2032
2031
  process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
2033
- internals.log?.reset?.();
2034
- internals.lastOutput = "";
2035
- internals.lastOutputToRender = "";
2036
- internals.lastOutputHeight = 0;
2037
- internals.fullStaticOutput = "";
2032
+ old.unmount();
2033
+ ref.instance = render_default(/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BossApp, { boss: opts.boss, resetUI }), {
2034
+ exitOnCtrlC: false
2035
+ });
2038
2036
  };
2039
2037
  const instance = render_default(/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BossApp, { boss: opts.boss, resetUI }), {
2040
2038
  // Disable Ink's built-in exit-on-Ctrl+C — we need our own double-press
@@ -2045,10 +2043,23 @@ function renderBossApp(opts) {
2045
2043
  });
2046
2044
  ref.instance = instance;
2047
2045
  return {
2046
+ // Follow ref.instance through restarts: when /clear nukes the current
2047
+ // instance and creates a new one, this promise re-binds to whichever
2048
+ // Ink instance is alive now. Without the loop, we'd wait on the OLD
2049
+ // instance's waitUntilExit (which already resolved on unmount) and
2050
+ // exit the CLI immediately after every /clear.
2048
2051
  waitUntilExit: async () => {
2049
- await instance.waitUntilExit();
2052
+ while (true) {
2053
+ const current = ref.instance;
2054
+ if (!current) return;
2055
+ await current.waitUntilExit();
2056
+ if (ref.instance === current) {
2057
+ ref.instance = null;
2058
+ return;
2059
+ }
2060
+ }
2050
2061
  },
2051
- unmount: () => instance.unmount()
2062
+ unmount: () => ref.instance?.unmount()
2052
2063
  };
2053
2064
  }
2054
2065
 
@@ -2278,6 +2289,16 @@ async function main() {
2278
2289
  if (isContinue) args.continueRecent = true;
2279
2290
  await runOrchestrator(args);
2280
2291
  }
2292
+ process.on("uncaughtException", (err) => {
2293
+ const message = err instanceof Error ? err.message : String(err);
2294
+ const stack = err instanceof Error ? err.stack : void 0;
2295
+ log("ERROR", "uncaught_exception", message, { stack });
2296
+ });
2297
+ process.on("unhandledRejection", (reason) => {
2298
+ const message = reason instanceof Error ? reason.message : String(reason);
2299
+ const stack = reason instanceof Error ? reason.stack : void 0;
2300
+ log("ERROR", "unhandled_rejection", message, { stack });
2301
+ });
2281
2302
  main().catch((err) => {
2282
2303
  const message = err instanceof Error ? err.message : String(err);
2283
2304
  process.stderr.write(source_default.hex(COLORS.error)(`