@aidenhq/sdk 0.5.15 → 0.5.16

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.
@@ -111,7 +111,7 @@ export interface TokenStore {
111
111
  /** Resolves once the token is persisted: nothing is kept in memory or used before that. */
112
112
  write(t: StoredToken): void | Promise<void>;
113
113
  }
114
- /** token.json (0600), written atomically; a file removed from outside reads as signed out. */
114
+ /** token.json (0600), written atomically; a file removed from outside reads as signed out. A token this process saved stays read until the file shows (a hosted mount projects a save a moment after the kernel answers) and is dropped only once the file has been there and is gone. */
115
115
  export declare function fileStore(path: string): TokenStore;
116
116
  /** token.json: the pair plus the client it belongs to. Extra fields a vendor answered (Slack's user_id) are kept. */
117
117
  export interface StoredToken {
@@ -27,13 +27,18 @@ async function persist(path, text) {
27
27
  chmodSync(tmp, 0o600);
28
28
  renameSync(tmp, path);
29
29
  }
30
- /** token.json (0600), written atomically; a file removed from outside reads as signed out. */
30
+ /** token.json (0600), written atomically; a file removed from outside reads as signed out. A token this process saved stays read until the file shows (a hosted mount projects a save a moment after the kernel answers) and is dropped only once the file has been there and is gone. */
31
31
  export function fileStore(path) {
32
32
  let token;
33
+ let seen = false;
33
34
  return {
34
35
  read() {
35
- if (!existsSync(path))
36
- return (token = undefined);
36
+ if (!existsSync(path)) {
37
+ if (seen)
38
+ (token = undefined), (seen = false);
39
+ return token;
40
+ }
41
+ seen = true;
37
42
  return (token ??= JSON.parse(readFileSync(path, "utf8")));
38
43
  },
39
44
  async write(t) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidenhq/sdk",
3
- "version": "0.5.15",
3
+ "version": "0.5.16",
4
4
  "description": "The shared code of AidenHQ modules: contract types, engine IO, the caller check and fence, write executors, the reviewer side, the judges' models and call, the source writer and the vendor MCP pass-through.",
5
5
  "license": "MIT",
6
6
  "repository": {