dsh-opendesign-corouter 0.1.19 → 0.2.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 +6 -6
- package/lib/adapter.d.ts +5 -0
- package/lib/auth.d.ts +2 -0
- package/lib/catalog.d.ts +8 -16
- package/lib/client.d.ts +4 -4
- package/lib/client.js +60 -13
- package/lib/config.d.ts +4 -4
- package/lib/device-auth.d.ts +1 -1
- package/lib/generated/typert.host.js +23 -5
- package/lib/generated/typert.remote-client.js +23 -5
- package/lib/index.d.ts +13 -13
- package/lib/index.js +1164 -686
- package/lib/index.js.map +4 -4
- package/lib/model-catalog-snapshot.d.ts +2 -0
- package/lib/model-directory.d.ts +59 -0
- package/lib/model-discovery.d.ts +1 -1
- package/lib/model-entitlements.d.ts +44 -0
- package/lib/model-settings.d.ts +3 -0
- package/lib/protocol-options.d.ts +7 -1
- package/lib/protocols/messages.d.ts +1 -1
- package/lib/protocols/responses-replay.d.ts +6 -0
- package/lib/protocols/responses.d.ts +5 -5
- package/lib/protocols/types.d.ts +4 -0
- package/lib/remote.d.ts +8 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
2
2
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
3
|
import type { TurnMonitorStatus } from './turn-monitor-status.js';
|
|
4
4
|
import { fetchModelCatalog } from './model-discovery.js';
|
|
5
|
+
import { type ModelAccount, type EntitlementResult, type ModelScope } from './model-entitlements.js';
|
|
5
6
|
import { fetchPricingSnapshot } from './pricing.js';
|
|
6
7
|
import type { CatalogModel } from './catalog.js';
|
|
7
8
|
import { readConfig, type LiveConfig } from './config.js';
|
|
8
|
-
import { resolveSession } from './auth.js';
|
|
9
|
+
import { resolveSession, readDesktopCredential, type LoginGrant } from './auth.js';
|
|
9
10
|
import { type LoginOptions } from './login.js';
|
|
10
11
|
import { type ActivationLauncherOptions } from './browser-open.js';
|
|
11
12
|
import { readQuota, type QuotaSnapshot } from './quota.js';
|
|
@@ -18,11 +19,17 @@ export declare const name = "llm-opendesign-corouter";
|
|
|
18
19
|
export declare const inject: string[];
|
|
19
20
|
export interface HostDependencies {
|
|
20
21
|
resolveSession: typeof resolveSession;
|
|
22
|
+
readDesktopCredential?: typeof readDesktopCredential;
|
|
21
23
|
readQuota: typeof readQuota;
|
|
22
24
|
readDesktopQuota: typeof readDesktopQuota;
|
|
23
25
|
fetchModels?: typeof fetchModelCatalog;
|
|
26
|
+
modelAccount?: (key: string, baseURL: string, grant: LoginGrant | undefined, useDesktop: boolean) => Promise<ModelAccount | undefined>;
|
|
27
|
+
readModelScope?: (account: ModelAccount, signal?: AbortSignal) => Promise<ModelScope>;
|
|
28
|
+
readEntitlements?: (models: readonly CatalogModel[], options?: import('./model-entitlements.js').EntitlementOptions) => Promise<EntitlementResult>;
|
|
24
29
|
fetchPrices?: typeof fetchPricingSnapshot;
|
|
25
30
|
modelsChanged?: () => void;
|
|
31
|
+
/** Offline fixtures may drive the directory lifetime explicitly. Production defaults on. */
|
|
32
|
+
modelAutoRefresh?: boolean;
|
|
26
33
|
loginOptions?: LoginOptions;
|
|
27
34
|
activationOptions?: ActivationLauncherOptions;
|
|
28
35
|
}
|
|
@@ -43,24 +50,19 @@ export declare class OpenDesignCoRouterService extends TypertRemoteService {
|
|
|
43
50
|
private _quotaController;
|
|
44
51
|
guardedTurns: number;
|
|
45
52
|
turnMonitorStatus: (() => TurnMonitorStatus) | undefined;
|
|
46
|
-
private
|
|
47
|
-
private
|
|
48
|
-
private _modelsError;
|
|
53
|
+
private readonly _directory;
|
|
54
|
+
private readonly _catalogKeys;
|
|
49
55
|
private _modelsFingerprint;
|
|
50
|
-
private _modelsEpoch;
|
|
51
|
-
private _modelsPending;
|
|
52
|
-
private _modelsController;
|
|
53
|
-
private _modelsWriteSerial;
|
|
54
|
-
private _modelsWrite;
|
|
55
56
|
private _prices;
|
|
56
57
|
private _pricesPending;
|
|
57
58
|
modelCatalog(): readonly CatalogModel[];
|
|
59
|
+
modelWorkspace(): string | undefined;
|
|
60
|
+
modelCallIdentity(): import('./model-directory.js').DirectoryCallIdentity | undefined;
|
|
61
|
+
currentModelCatalog(): Promise<readonly CatalogModel[]>;
|
|
58
62
|
constructor(ctx: Context, config: () => ReturnType<typeof readConfig>, dependencies?: HostDependencies);
|
|
59
63
|
private _credentials;
|
|
60
64
|
private _key;
|
|
61
65
|
resolveApiKey(ref: string, baseURL?: string): Promise<string | undefined>;
|
|
62
|
-
/** Restore the persisted gateway catalog when it belongs to the active gateway. */
|
|
63
|
-
private _restoreModels;
|
|
64
66
|
/**
|
|
65
67
|
* Persist the snapshot through the Host form service.
|
|
66
68
|
* `unsupported` means no settings service is composed (nothing to report);
|
|
@@ -71,8 +73,6 @@ export declare class OpenDesignCoRouterService extends TypertRemoteService {
|
|
|
71
73
|
* and trying once more. Every other failure repeats identically and is reported immediately.
|
|
72
74
|
*/
|
|
73
75
|
private _persistModels;
|
|
74
|
-
/** Serialize snapshot writes so the newest successful refresh is the last one persisted. */
|
|
75
|
-
private _queueModelsWrite;
|
|
76
76
|
private _invalidateModels;
|
|
77
77
|
private _state;
|
|
78
78
|
private _conflict;
|