@agentxm/registry-auth 0.29.1 → 0.29.4

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.
@@ -94,19 +94,16 @@ export declare const CredentialStoreLive: Layer.Layer<CredentialStore, never, Fi
94
94
  * a failing origin retried serially. Sharing is safe here because each auth
95
95
  * path issues a single load and none of them depends on serial retry.
96
96
  *
97
- * `Effect.onInterrupt` is load-path scaffolding, not decoration. `Cache.get`
98
- * runs its lookup on a detached daemon fiber and leaves the pending entry in
99
- * the map when the only caller is interrupted, so without this guard the next
100
- * read of that origin would await an abandoned lookup forever. Invalidating on
101
- * interrupt restores the pre-cache behavior, where an interrupted read left
102
- * nothing behind and the next read simply ran again.
97
+ * Caller interruption invalidates the affected origin so later reads can
98
+ * retry. Cache owns the lookup fiber's cancellation when its last waiter
99
+ * leaves.
103
100
  *
104
- * Known limitation, unchanged by this layer's move to `Cache` and not fixed by
105
- * it: a `save` or `clear` whose invalidation lands while a read of the same
106
- * origin is still in flight can be overwritten when that read populates the
107
- * memo, leaving the pre-write value cached for the rest of the session. The
108
- * previous value-map-and-semaphore memo lost the same invalidation through its
109
- * own write-after-invalidate window.
101
+ * Effect Cache starts a lookup before inserting its pending entry. Yielding
102
+ * before invoking the backing store lets that insertion finish before a read
103
+ * can synchronously resume a writer. Successful save/clear invalidation then
104
+ * removes the pending entry; its eventual result cannot restore stale state.
105
+ * An overlapping reader can still receive its earlier snapshot, while reads
106
+ * started after the write completes observe the updated store.
110
107
  */
111
108
  export declare const CredentialStoreSessionLive: Layer.Layer<CredentialStore, never, CredentialStore>;
112
109
  export declare const CredentialStoreTest: (tier?: StorageTier, initialData?: CredentialFile, allowsPersistedCredentials?: boolean) => Layer.Layer<CredentialStore, never, never>;
@@ -367,23 +367,20 @@ export const CredentialStoreLive = Layer.effect(CredentialStore, Effect.gen(func
367
367
  * a failing origin retried serially. Sharing is safe here because each auth
368
368
  * path issues a single load and none of them depends on serial retry.
369
369
  *
370
- * `Effect.onInterrupt` is load-path scaffolding, not decoration. `Cache.get`
371
- * runs its lookup on a detached daemon fiber and leaves the pending entry in
372
- * the map when the only caller is interrupted, so without this guard the next
373
- * read of that origin would await an abandoned lookup forever. Invalidating on
374
- * interrupt restores the pre-cache behavior, where an interrupted read left
375
- * nothing behind and the next read simply ran again.
370
+ * Caller interruption invalidates the affected origin so later reads can
371
+ * retry. Cache owns the lookup fiber's cancellation when its last waiter
372
+ * leaves.
376
373
  *
377
- * Known limitation, unchanged by this layer's move to `Cache` and not fixed by
378
- * it: a `save` or `clear` whose invalidation lands while a read of the same
379
- * origin is still in flight can be overwritten when that read populates the
380
- * memo, leaving the pre-write value cached for the rest of the session. The
381
- * previous value-map-and-semaphore memo lost the same invalidation through its
382
- * own write-after-invalidate window.
374
+ * Effect Cache starts a lookup before inserting its pending entry. Yielding
375
+ * before invoking the backing store lets that insertion finish before a read
376
+ * can synchronously resume a writer. Successful save/clear invalidation then
377
+ * removes the pending entry; its eventual result cannot restore stale state.
378
+ * An overlapping reader can still receive its earlier snapshot, while reads
379
+ * started after the write completes observe the updated store.
383
380
  */
384
381
  export const CredentialStoreSessionLive = Layer.effect(CredentialStore, Effect.gen(function* () {
385
382
  const store = yield* CredentialStore;
386
- const cache = yield* Cache.makeWith((registryUrl) => store.load(registryUrl), {
383
+ const cache = yield* Cache.makeWith((registryUrl) => Effect.andThen(Effect.yieldNow, () => store.load(registryUrl)), {
387
384
  capacity: Number.POSITIVE_INFINITY,
388
385
  timeToLive: (exit) => Exit.isSuccess(exit) ? Duration.infinity : Duration.zero,
389
386
  });
package/package.json CHANGED
@@ -4,23 +4,23 @@
4
4
  "url": "https://github.com/agentxm/axm/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@agentxm/extension-model": "^0.29.1",
8
- "@agentxm/registry-client": "^0.29.1",
9
- "@agentxm/registry-protocol": "^0.29.1",
7
+ "@agentxm/extension-model": "^0.29.4",
8
+ "@agentxm/registry-client": "^0.29.4",
9
+ "@agentxm/registry-protocol": "^0.29.4",
10
10
  "@napi-rs/keyring": "^1.3.0",
11
- "effect": "4.0.0-rc.112",
11
+ "effect": "4.0.0-rc.115",
12
12
  "proper-lockfile": "^4.1.2"
13
13
  },
14
14
  "description": "AXM registry-auth feature: login, logout, token, identity inspection, device and loopback flows, and credential lifecycle for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
15
15
  "devDependencies": {
16
- "@agentxm/specification-metadata": "^0.29.1",
17
- "@effect/platform-node": "4.0.0-rc.112",
18
- "@effect/vitest": "4.0.0-rc.112",
16
+ "@agentxm/specification-metadata": "^0.29.4",
17
+ "@effect/platform-node": "4.0.0-rc.115",
18
+ "@effect/vitest": "4.0.0-rc.115",
19
19
  "@types/bun": "^1.3.14",
20
20
  "@types/proper-lockfile": "^4.1.4",
21
21
  "@typescript/native": "npm:typescript@^7.0.2",
22
22
  "typescript": "npm:@typescript/typescript6@^6.0.2",
23
- "vitest": "^4.1.10"
23
+ "vitest": "^5.0.0"
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=22.19.0"
@@ -62,5 +62,5 @@
62
62
  },
63
63
  "sideEffects": false,
64
64
  "type": "module",
65
- "version": "0.29.1"
65
+ "version": "0.29.4"
66
66
  }