kagura-memory 0.15.0 → 0.16.0

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
@@ -1299,29 +1299,35 @@ kagura-ai/memory-cloud#1686): of two processes presenting the same one, the
1299
1299
  second gets `invalid_grant`. So every refresh — `KaguraOAuth` in a client or
1300
1300
  in `kagura-memory-mcp`, `refresh()`, and the CLI's `auth refresh` and
1301
1301
  `auth token` — takes the lock on `credentials.json` (a sibling
1302
- `credentials.json.lock`), re-reads the profile, and when another process
1302
+ `credentials.json.lock-v1`), re-reads the profile, and when another process
1303
1303
  already rotated it to a token that has not expired, uses that profile and
1304
1304
  sends nothing; otherwise it refreshes from the refresh token on file and
1305
1305
  saves the result before it releases the lock. (Python 0.44.0 also adopts a
1306
1306
  different token that has expired; this SDK refreshes it instead.) The
1307
1307
  device flow a widening `--scope` falls back to runs after the lock is
1308
- released, since it waits on the user. The Python SDK
1309
- locks the same `credentials.json.lock` with an OS lock, which Node does not
1310
- have, so the two SDKs' locks do not exclude each other: between them only
1311
- the re-read applies. This is client-side and works against every server. As
1308
+ released, since it waits on the user. Python 0.44.0 and older TypeScript
1309
+ clients use incompatible locks: do not run them concurrently against the same
1310
+ credentials file. An existing legacy `.lock` is refused, never deleted by this
1311
+ SDK. Lock-v1 is never broken by age. See the
1312
+ [migration and crash-recovery instructions](docs/compatibility.md#unreleased-credential-concurrency-and-auth-token-112)
1313
+ and [Python counterpart](https://github.com/kagura-ai/kagura-memory-python-sdk/issues/327).
1314
+ Logout records revocation so a queued refresh cannot recreate credentials;
1315
+ `deleteCredentialsFile()` must now be awaited. This is client-side and works
1316
+ against every server. As
1312
1317
  in Python SDK 0.44.0 (kagura-ai/kagura-memory-python-sdk#313):
1313
1318
 
1314
1319
  - `auth refresh` says `✓ Profile 'NAME' was already refreshed by another
1315
1320
  process.` when it found the profile rotated under the lock, and `✓
1316
1321
  Refreshed profile 'NAME'.` after a refresh of its own, each followed by
1317
1322
  the `Scope:` and `Expires:` lines; both exit 0. `auth token` prints the
1318
- token another process refreshed.
1323
+ token another process refreshed. It refreshes within five minutes of expiry
1324
+ and writes an expiry warning to stderr, leaving the token alone on stdout.
1319
1325
  - A `credentials.json` that exists but cannot be read or parsed is refused
1320
1326
  before any refresh request or write, and left as it is: `KaguraAuthError`
1321
1327
  `Cannot update <path>: it is not valid JSON.` (or why else it cannot be
1322
1328
  read), with `Fix the file, or move it aside and run: kagura-memory auth
1323
1329
  login`. This holds for a refresh (checked under the lock), the save at
1324
- the end of `login()`, `updateProfile`, `setDefaultProfile` and
1330
+ the beginning and end of `login()`, `updateProfile`, `setDefaultProfile` and
1325
1331
  `deleteProfile`; `kagura-memory-mcp` refuses it at startup and before any
1326
1332
  login. "Exists" includes a dangling symlink, and a file in a directory
1327
1333
  this process cannot search. A missing file is still "no profile".