byollm 0.1.0-alpha.76 → 0.1.0-alpha.77

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  > [!WARNING]
2
- > **Alpha (`0.1.0-alpha.76`) — under active development. Don't use this yet.**
2
+ > **Alpha (`0.1.0-alpha.77`) — under active development. Don't use this yet.**
3
3
  >
4
4
  > Install it deliberately: `npx byollm@alpha`, or `npm install byollm@alpha`.
5
5
  >
package/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "./chunk-MSRBBLRQ.js";
4
+ } from "./chunk-QA5S2SQF.js";
5
5
 
6
6
  // src/bin.ts
7
7
  process.exitCode = await main(process.argv.slice(2));
@@ -59,7 +59,8 @@ var BOLD = "\x1B[1m";
59
59
  var RESET = "\x1B[0m";
60
60
  function emphasisAllowed(context2) {
61
61
  if (context2.env["NO_COLOR"] !== void 0) return false;
62
- if (context2.env["FORCE_COLOR"] !== void 0) return true;
62
+ const forced = context2.env["FORCE_COLOR"];
63
+ if (forced !== void 0) return forced !== "0" && forced !== "";
63
64
  return context2.tty;
64
65
  }
65
66
  function emphasise(value, context2) {
@@ -3665,6 +3666,8 @@ var Runner = class {
3665
3666
  * service was blocked.
3666
3667
  */
3667
3668
  #blockedReport = /* @__PURE__ */ new Map();
3669
+ /** Signed-out services' reports, kept for the same reason blocked ones are. */
3670
+ #withdrawnReport = /* @__PURE__ */ new Map();
3668
3671
  /** What was last handed to the writer, so an unchanged pass writes nothing. */
3669
3672
  #lastWritten;
3670
3673
  /**
@@ -3779,7 +3782,11 @@ var Runner = class {
3779
3782
  const capabilities = [];
3780
3783
  const probed = /* @__PURE__ */ new Map();
3781
3784
  for (const route of this.#options.loaded.routes) {
3782
- if (this.#unauthenticated.has(route.service)) continue;
3785
+ if (this.#unauthenticated.has(route.service)) {
3786
+ const kept = this.#withdrawnReport.get(route.service);
3787
+ if (kept !== void 0) this.serviceStates.set(route.service, kept);
3788
+ continue;
3789
+ }
3783
3790
  const blockedUntil = this.#blocked.get(route.service);
3784
3791
  if (this.#blocked.has(route.service)) {
3785
3792
  if (blockedUntil !== void 0 && this.#now() < blockedUntil) {
@@ -4235,12 +4242,14 @@ var Runner = class {
4235
4242
  });
4236
4243
  if (!result.ok && result.code === "unauthorized") {
4237
4244
  this.#unauthenticated.add(route.service);
4238
- this.#noteServiceState(route.service, {
4245
+ const withdrawn = this.#noteServiceState(route.service, {
4246
+ ...this.serviceStates.get(route.service),
4239
4247
  state: {
4240
4248
  kind: "signed-out",
4241
4249
  detail: result.message
4242
4250
  }
4243
4251
  });
4252
+ this.#withdrawnReport.set(route.service, withdrawn);
4244
4253
  this.#options.onEvent?.({
4245
4254
  type: "service-not-signed-in",
4246
4255
  service: route.service,
@@ -4391,9 +4400,19 @@ var Runner = class {
4391
4400
  #writeServiceStates() {
4392
4401
  const now = JSON.stringify([...this.serviceStates]);
4393
4402
  if (now === this.#lastWritten) return;
4394
- this.#lastWritten = now;
4395
4403
  const noted = this.#options.onServiceStates?.(this.serviceStates);
4396
- if (noted !== void 0) void noted.catch(() => void 0);
4404
+ if (noted === void 0) {
4405
+ this.#lastWritten = now;
4406
+ return;
4407
+ }
4408
+ void noted.then(
4409
+ () => {
4410
+ this.#lastWritten = now;
4411
+ },
4412
+ () => {
4413
+ this.#lastWritten = void 0;
4414
+ }
4415
+ );
4397
4416
  }
4398
4417
  /**
4399
4418
  * Note a refusal that means the relationship is over.
@@ -7029,7 +7048,7 @@ async function exists(path) {
7029
7048
  }
7030
7049
 
7031
7050
  // src/index.ts
7032
- var DAEMON_VERSION = "0.1.0-alpha.76";
7051
+ var DAEMON_VERSION = "0.1.0-alpha.77";
7033
7052
  function daemonVersion() {
7034
7053
  return {
7035
7054
  daemon: DAEMON_VERSION,
@@ -7081,4 +7100,4 @@ export {
7081
7100
  runCli,
7082
7101
  main
7083
7102
  };
7084
- //# sourceMappingURL=chunk-MSRBBLRQ.js.map
7103
+ //# sourceMappingURL=chunk-QA5S2SQF.js.map