@almadar/workspace 0.5.0 → 0.6.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/dist/__tests__/account-auth-token.test.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +23 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -326,6 +326,18 @@ export interface AccountConfig {
|
|
|
326
326
|
export interface ProviderCredential {
|
|
327
327
|
apiKey: string;
|
|
328
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Hosted-builder auth token, persisted to `~/.almadar/auth.json` (chmod 600).
|
|
331
|
+
* The Firebase ID token the local server / sync sends to the hosted builder for
|
|
332
|
+
* the signed-in ("studio") account. Distinct from {@link ProviderCredential}
|
|
333
|
+
* (BYO LLM key) and {@link AccountIdentity} (non-secret uid/email overlay).
|
|
334
|
+
*/
|
|
335
|
+
export interface AuthToken {
|
|
336
|
+
token: string;
|
|
337
|
+
refreshToken?: string;
|
|
338
|
+
/** ISO expiry of the ID token (~1h from issue). */
|
|
339
|
+
expiresAt?: string;
|
|
340
|
+
}
|
|
329
341
|
/** Studio-synced identity overlay, persisted to `~/.almadar/account.json`. Empty until login. */
|
|
330
342
|
export interface AccountIdentity {
|
|
331
343
|
uid: string;
|
|
@@ -355,13 +367,23 @@ export interface AccountService {
|
|
|
355
367
|
listCredentialedProviders(): Promise<string[]>;
|
|
356
368
|
readAccount(): Promise<AccountIdentity | null>;
|
|
357
369
|
writeAccount(identity: AccountIdentity): Promise<void>;
|
|
370
|
+
/** Read the stored hosted-builder auth token, or null when signed out. */
|
|
371
|
+
getAuthToken(): Promise<AuthToken | null>;
|
|
372
|
+
/** Persist the hosted-builder auth token (chmod 600). */
|
|
373
|
+
setAuthToken(token: AuthToken): Promise<void>;
|
|
374
|
+
/** Remove the stored auth token (sign out). Idempotent. */
|
|
375
|
+
clearAuthToken(): Promise<void>;
|
|
358
376
|
/**
|
|
359
377
|
* Resolve the explicit {@link ProviderConfig} for `provider` (stored apiKey +
|
|
360
378
|
* config baseUrl/model overrides), ready to pass into `@almadar/llm` / rabit.
|
|
361
379
|
* Returns null when no credential is stored for `provider`.
|
|
362
380
|
*/
|
|
363
381
|
resolveProviderConfig(provider: string): Promise<ProviderConfig | null>;
|
|
364
|
-
/**
|
|
382
|
+
/**
|
|
383
|
+
* True once setup completed AND the account can actually run AI — either a
|
|
384
|
+
* stored provider credential (BYO-key) or a hosted-builder auth token
|
|
385
|
+
* (signed-in studio account).
|
|
386
|
+
*/
|
|
365
387
|
isConfigured(): Promise<boolean>;
|
|
366
388
|
dispose(): Promise<void>;
|
|
367
389
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Storage-agnostic workspace primitives shared by Almadar consumers. One service, six exports, hidden paths, single observer. See docs/Almadar_Workspace.md.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|