@prestyj/core 5.0.1 → 5.1.1

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/index.d.cts CHANGED
@@ -98,6 +98,14 @@ declare class AuthStorage {
98
98
  isStaticApiKey(provider: string): Promise<boolean>;
99
99
  load(): Promise<void>;
100
100
  private ensureLoaded;
101
+ /**
102
+ * Force a re-read from disk, discarding the in-memory cache. Needed when
103
+ * another process mutates the auth file out-of-band — e.g. the desktop app
104
+ * writes API keys natively (Rust → ~/.ezcoder/auth.json) without going through
105
+ * this instance, so a long-lived daemon's cache would otherwise stay stale and
106
+ * never see a newly added provider key.
107
+ */
108
+ reload(): Promise<void>;
101
109
  getCredentials(provider: string): Promise<OAuthCredentials | undefined>;
102
110
  setCredentials(provider: string, creds: OAuthCredentials): Promise<void>;
103
111
  clearCredentials(provider: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -98,6 +98,14 @@ declare class AuthStorage {
98
98
  isStaticApiKey(provider: string): Promise<boolean>;
99
99
  load(): Promise<void>;
100
100
  private ensureLoaded;
101
+ /**
102
+ * Force a re-read from disk, discarding the in-memory cache. Needed when
103
+ * another process mutates the auth file out-of-band — e.g. the desktop app
104
+ * writes API keys natively (Rust → ~/.ezcoder/auth.json) without going through
105
+ * this instance, so a long-lived daemon's cache would otherwise stay stale and
106
+ * never see a newly added provider key.
107
+ */
108
+ reload(): Promise<void>;
101
109
  getCredentials(provider: string): Promise<OAuthCredentials | undefined>;
102
110
  setCredentials(provider: string, creds: OAuthCredentials): Promise<void>;
103
111
  clearCredentials(provider: string): Promise<void>;
package/dist/index.js CHANGED
@@ -1267,6 +1267,17 @@ var AuthStorage = class {
1267
1267
  async ensureLoaded() {
1268
1268
  if (!this.loaded) await this.load();
1269
1269
  }
1270
+ /**
1271
+ * Force a re-read from disk, discarding the in-memory cache. Needed when
1272
+ * another process mutates the auth file out-of-band — e.g. the desktop app
1273
+ * writes API keys natively (Rust → ~/.ezcoder/auth.json) without going through
1274
+ * this instance, so a long-lived daemon's cache would otherwise stay stale and
1275
+ * never see a newly added provider key.
1276
+ */
1277
+ async reload() {
1278
+ this.loaded = false;
1279
+ await this.load();
1280
+ }
1270
1281
  async getCredentials(provider) {
1271
1282
  await this.ensureLoaded();
1272
1283
  return this.data[provider];
@@ -1735,7 +1746,7 @@ function performUpdateInBackground(command) {
1735
1746
  }
1736
1747
  function createAutoUpdater(config) {
1737
1748
  const REGISTRY_URL = `https://registry.npmjs.org/${config.packageName}/latest`;
1738
- const periodicMessage = config.periodicMessage ?? (({ currentVersion, latestVersion, updateCommand }) => `Ken just pushed a fresh update \u2014 ${currentVersion} \u2192 ${latestVersion}! I'll grab it on next launch (or run ${updateCommand} if you can't wait).`);
1749
+ const periodicMessage = config.periodicMessage ?? (({ currentVersion, latestVersion, updateCommand }) => `Nolan just pushed a fresh update \u2014 ${currentVersion} \u2192 ${latestVersion}! I'll grab it on next launch (or run ${updateCommand} if you can't wait).`);
1739
1750
  let periodicTimer = null;
1740
1751
  function stateFilePath() {
1741
1752
  return typeof config.stateFilePath === "function" ? config.stateFilePath() : config.stateFilePath;
@@ -1814,7 +1825,7 @@ function createAutoUpdater(config) {
1814
1825
  const info = detectInstallInfo();
1815
1826
  if (info.updateCommand) {
1816
1827
  performUpdateInBackground(info.updateCommand);
1817
- message = `Ken just shipped ${state.latestVersion}! Installing in the background \u2014 takes effect next launch.`;
1828
+ message = `Nolan just shipped ${state.latestVersion}! Installing in the background \u2014 takes effect next launch.`;
1818
1829
  writeState({
1819
1830
  ...state,
1820
1831
  lastCheckedAt: Date.now(),