dsh-connect-trae 3.0.0 → 3.3.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/lib/index.d.ts CHANGED
@@ -475,12 +475,35 @@ declare class TraeCredentialStore {
475
475
  selectAccount(accountId: string | undefined): void;
476
476
  candidates(): TraeStorageCandidate[];
477
477
  /**
478
- * Deterministic default when no account is explicitly selected: the first
479
- * discovered account. This is NOT credit-seeking — it never reorders accounts
480
- * to find one with general credits. The plugin bills exactly the account the
481
- * user selected, or the first account when nothing has been selected yet.
478
+ * Deterministic default when no account is explicitly selected: the account
479
+ * the Trae desktop app is signed in to RIGHT NOW, else the first discovered
480
+ * one. This is NOT credit-seeking — it never reorders accounts to find one
481
+ * with general credits. The plugin bills exactly the account the user
482
+ * selected, the app's current sign-in when nothing has been selected, and
483
+ * only then the first account.
484
+ *
485
+ * The app's live sign-in outranks the plugin's own refreshed copies (issue
486
+ * #29): after the user switches accounts in Trae, the desktop storage file
487
+ * holds the NEW login while the plugin's copy of the old one still resolves,
488
+ * so a bare `credentials[0]` kept defaulting to a sign-in the app has
489
+ * abandoned — and `dsh-connect-workbuddy`, whose `preferred()` ranks the live
490
+ * file first, followed the app instead. Ordering only: the VALUE behind an
491
+ * account id is still whichever copy expires later (`readAll`), so a refresh
492
+ * the plugin performed is never discarded by this preference.
482
493
  */
483
494
  private preferred;
495
+ /**
496
+ * The account the Trae app is signed in to right now, when that differs from
497
+ * the account this store is bound to (issue #29).
498
+ *
499
+ * This is a READ, not a rebind: `current()` keeps resolving the bound
500
+ * account verbatim so billing never moves without a decision — the store
501
+ * only reports the mismatch, and the card (hint row) or the host (follow
502
+ * switch) turns it into a settings write the user can see and undo. Absent
503
+ * when nothing is live, when the live account IS the bound one, or when the
504
+ * binding itself already fell through to the live account.
505
+ */
506
+ liveLogin(): Promise<TraeAccountChoice | undefined>;
484
507
  accounts(): Promise<TraeAccountChoice[]>;
485
508
  current(): Promise<TraeCredential | undefined>;
486
509
  /**
@@ -549,6 +572,20 @@ declare function parseTraeAuthValue(value: string): unknown;
549
572
  declare function parseTraeStorageDocument(text: string): unknown;
550
573
  //#endregion
551
574
  //#region src/identity.d.ts
575
+ /**
576
+ * The per-install ECDSA P-256 keypair the official client registers with the
577
+ * device, and signs its token-refresh proof with.
578
+ *
579
+ * It lives in the same `storage.json` as the credential, under
580
+ * `iCubeAuthInfo://icube-dc:<deviceId>`, encrypted with the same codec — so the
581
+ * key that PROVES a device is the key stored beside the login it protects.
582
+ * Without it the new refresh contract cannot be satisfied at all (the server
583
+ * rejects a proof signed by any other key with `20403 Token device not match`).
584
+ */
585
+ interface TraeDeviceKeyPair {
586
+ privateKeyPEM: string;
587
+ publicKeyPEM: string;
588
+ }
552
589
  interface TraeIdentity {
553
590
  edition: TraeEdition;
554
591
  machineId: string;
@@ -558,6 +595,15 @@ interface TraeIdentity {
558
595
  deviceBrand?: string;
559
596
  deviceCpu?: string;
560
597
  osVersion?: string;
598
+ /**
599
+ * Device display name; the official client sends the OS account's full name.
600
+ * Optional because the new refresh contract does not read it.
601
+ */
602
+ deviceName?: string;
603
+ /** Device model, e.g. `MacBookPro18,2`. Optional; not required by the server. */
604
+ deviceModel?: string;
605
+ /** The install's registered device keypair, when `storage.json` carries one. */
606
+ deviceKeyPair?: TraeDeviceKeyPair;
561
607
  platform: NodeJS.Platform;
562
608
  }
563
609
  interface TraeIdentityReadOptions {
@@ -1133,16 +1179,46 @@ declare class TraeGatedUpstreamClient implements TraeUpstreamClient {
1133
1179
  }
1134
1180
  //#endregion
1135
1181
  //#region src/refresh.d.ts
1136
- /** Stable device identity for the DeviceInfo body, sourced from the app's own storage. */
1182
+ /**
1183
+ * Stable device identity for the DeviceInfo body, sourced from the app's own
1184
+ * storage. Every field except `deviceId`/`machineId` is optional: the server
1185
+ * requires `DeviceID`, `PlatformCode` and `DeviceType` (verified: dropping
1186
+ * `DeviceType` yields `20403`, dropping `MachineID` does not), so a machine that
1187
+ * cannot read the cosmetic fields must still be able to refresh.
1188
+ */
1137
1189
  interface TraeRefreshDevice {
1138
1190
  deviceId: string;
1139
1191
  machineId: string;
1192
+ deviceName?: string;
1193
+ deviceModel?: string;
1194
+ deviceBrand?: string;
1195
+ deviceCpu?: string;
1196
+ osVersion?: string;
1197
+ appVersion?: string;
1198
+ /**
1199
+ * The install's registered keypair, read from `storage.json`. Its presence is
1200
+ * exactly what decides whether the CURRENT contract can be attempted: without
1201
+ * it there is no proof to sign, and the server would answer `20405`.
1202
+ */
1203
+ deviceKeyPair?: {
1204
+ privateKeyPEM: string;
1205
+ publicKeyPEM: string;
1206
+ };
1140
1207
  }
1141
1208
  /**
1142
- * Exchange a refresh token for a fresh access token, following the calling
1143
- * edition's verified contract. `device` is only used by editions whose
1144
- * official client sends a DeviceInfo body; when it cannot be resolved the
1145
- * field is omitted rather than sent empty.
1209
+ * Exchange a refresh token for a fresh access token.
1210
+ *
1211
+ * The CURRENT contract is attempted first whenever it is possible at all — it is
1212
+ * what the shipped clients use. It needs the install's device keypair; without
1213
+ * one there is nothing to sign, so the request is skipped rather than sent to be
1214
+ * rejected with `20405`.
1215
+ *
1216
+ * The SUPERSEDED contract is then tried as a fallback, which is what keeps older
1217
+ * installs and CLI-only machines working; it carries no device block but the
1218
+ * SAME per-edition ClientID, because that split belongs to the OAuth client
1219
+ * rather than to the endpoint (see {@link legacyBody}). When both are impossible
1220
+ * or both fail, the error names every attempt so a "sign in again" verdict is
1221
+ * diagnosable rather than mysterious.
1146
1222
  */
1147
1223
  declare function refreshTraeCredential(credential: TraeCredential, signal?: AbortSignal, device?: TraeRefreshDevice): Promise<TraeRefreshOutcome>;
1148
1224
  //#endregion
@@ -1538,9 +1614,20 @@ declare const TRAE_USAGE_PATH = "/plugins/dsh-connect-trae/usage";
1538
1614
  * labels the button as consuming a small amount.
1539
1615
  */
1540
1616
  declare const TRAE_MODELS_TEST_PATH = "/plugins/dsh-connect-trae/models/test";
1617
+ /**
1618
+ * Per-account status (check-in / credits / subscription) for the account table.
1619
+ *
1620
+ * Each row of the account table reads its OWN state through this route — a CN
1621
+ * row carries its check-in state and balance, an ai row its subscription.
1622
+ * POST with the accountId in the body: one upstream read per account, paid
1623
+ * only when the table is actually shown.
1624
+ */
1625
+ declare const TRAE_ACCOUNT_STATUS_PATH = "/plugins/dsh-connect-trae/account-status";
1541
1626
  /**
1542
1627
  * Plugin-owned daily check-in claim endpoint. POST, loopback-only, and the only
1543
- * route in this plugin that changes upstream account state.
1628
+ * route in this plugin that changes upstream account state. The accountId in
1629
+ * the body names WHICH account to claim for, so the button can sit in each
1630
+ * account row.
1544
1631
  */
1545
1632
  declare const TRAE_CHECKIN_PATH = "/plugins/dsh-connect-trae/checkin";
1546
1633
  /** Query parameter naming the region a card request addresses. */
@@ -1563,6 +1650,12 @@ interface TraeWebCreditAccount {
1563
1650
  displayDesc: string;
1564
1651
  remain: number;
1565
1652
  size: number;
1653
+ /**
1654
+ * When this pack lapses, in epoch milliseconds, taken from the upstream's own
1655
+ * `end_time`. Absent when the upstream reported no usable time (0 / missing),
1656
+ * so a consumer can tell "no date" apart from "1970".
1657
+ */
1658
+ expiresAtMs?: number;
1566
1659
  }
1567
1660
  /** Aggregated usage/credit answer rendered by the plugin card. */
1568
1661
  interface TraeWebCredits {
@@ -1689,6 +1782,49 @@ interface TraeWebAccount {
1689
1782
  tokenExpiresAtMs: number;
1690
1783
  selected: boolean;
1691
1784
  }
1785
+ /**
1786
+ * The account the Trae desktop app is signed in to right now, when it differs
1787
+ * from the one this plugin is bound to (issue #29).
1788
+ *
1789
+ * Reported on the usage document so the card can offer one-click follow without
1790
+ * an extra round trip; also written back on a POST to the accounts refresh
1791
+ * route when the client confirms it saw the hint. Absent whenever the two
1792
+ * agree or the app is not readable — a healthy document carries no extra
1793
+ * fields and the plugin never bills from this value directly: the FOLLOW is a
1794
+ * settings write of `accounts.<region>`, made by the card or by the host's
1795
+ * follow switch, never a silent rebind here.
1796
+ */
1797
+ interface TraeWebAppLogin {
1798
+ id: string;
1799
+ accountName: string;
1800
+ edition: 'cn' | 'sg' | 'solo' | 'solo-sg';
1801
+ region: TraeRegion;
1802
+ }
1803
+ /**
1804
+ * The per-account state shown inside an account row of the card's table.
1805
+ *
1806
+ * Every locally detected account in a region is rendered as a row; the
1807
+ * interesting per-account facts differ by region, which is why this is a union
1808
+ * of the three surfaces the card previously showed only for the BOUND account:
1809
+ *
1810
+ * - CN rows carry their own check-in state (Trae keys the daily reward per
1811
+ * ACCOUNT, and the one-per-device tally per DEVICE, see {@link TraeWebCheckin})
1812
+ * and their Work/General balances.
1813
+ * - ai rows carry their own subscription / trial status.
1814
+ *
1815
+ * Each field is optional: a read that fails keeps the row visible (perhaps
1816
+ * without a figure) rather than dropping the account and its switch.
1817
+ */
1818
+ interface TraeWebAccountState {
1819
+ /** The account this state belongs to. */
1820
+ id: string;
1821
+ /** CN: today's check-in state of this account (absent for ai rows). */
1822
+ checkin?: TraeWebCheckin;
1823
+ /** CN: this account's Work/General balances (absent for ai rows). */
1824
+ credits?: TraeWebCredits;
1825
+ /** ai: this account's subscription / trial status (absent for CN rows). */
1826
+ payStatus?: TraeWebPayStatus;
1827
+ }
1692
1828
  interface TraeWebCreditAlternative {
1693
1829
  id: string;
1694
1830
  accountName: string;
@@ -1729,6 +1865,33 @@ declare function unwrapVolatile<T>(value: T): T;
1729
1865
  * value is never touched.
1730
1866
  */
1731
1867
  declare function unwrapVolatileDeep<T>(value: T): T;
1868
+ /**
1869
+ * Read the per-region account selections out of a settings value.
1870
+ *
1871
+ * SHARED because `accounts` now has TWO writers: the card, and the composer
1872
+ * panel's account table (2.14.0). Two writers of one field must use one merge
1873
+ * rule, or they drift — and the rule is not obvious.
1874
+ *
1875
+ * Deep-unwraps first: on DSH 0.1.7 a volatile field arrives as a `{get(): T}`
1876
+ * live reference, which passes the `typeof === 'object'` check and would be
1877
+ * returned as if it were the map. Every lookup on it is then `undefined`, and
1878
+ * the merge (`{ ...configured, [region]: id }`) would spread a reference into
1879
+ * `{get: <function>}` — dropping the other region's selection and leaking a
1880
+ * function into the settings document.
1881
+ */
1882
+ declare function configuredAccountsOf(configured: unknown): Record<string, string>;
1883
+ /**
1884
+ * Whether the host-side "follow the Trae app's sign-in" switch is on (issue
1885
+ * #29). Absent reads as OFF, so an existing configuration keeps the strict
1886
+ * bind it shipped with and the switch is an opt-in — the same opt-out
1887
+ * semantics as {@link regionEnabledOf}, for the same reason: a config written
1888
+ * before this field existed cannot ask for behavior it never declared.
1889
+ *
1890
+ * Reads the whole settings section (or the bare field); deep-unwraps first
1891
+ * because on DSH 0.1.7 a volatile field arrives as a `{get(): T}` live
1892
+ * reference, whose `typeof === 'object'` would otherwise pass a naive check.
1893
+ */
1894
+ declare function followAppLoginEnabled(configured: unknown): boolean;
1732
1895
  /**
1733
1896
  * Build the next `regions` settings value for the card's save. The write
1734
1897
  * targets ONLY the signed-in account's region slot; every other region's slot
@@ -1819,6 +1982,15 @@ type TraeWebUsage = {
1819
1982
  * other case so a healthy account never pays for the extra read.
1820
1983
  */
1821
1984
  alternatives?: readonly TraeWebCreditAlternative[];
1985
+ /**
1986
+ * Present only when the Trae app's CURRENT sign-in differs from the
1987
+ * account this plugin is bound to (issue #29): the card then offers a
1988
+ * one-click follow instead of making the user hunt the account dropdown
1989
+ * after every app-side sign-out. Absent in every other case — a healthy
1990
+ * document costs no extra read beyond the accounts scan the document
1991
+ * already runs.
1992
+ */
1993
+ appLogin?: TraeWebAppLogin;
1822
1994
  /**
1823
1995
  * Daily check-in state (CN only). Absent on the international region,
1824
1996
  * whose check-in surface does not exist — probed 2026-09-24: the
@@ -1853,6 +2025,30 @@ interface TraeUsageRouteOptions {
1853
2025
  * exhausted-account hint is simply not offered.
1854
2026
  */
1855
2027
  creditsOfAccount?(region: TraeRegion, accountId: string): Promise<TraeWebCredits | undefined>;
2028
+ /**
2029
+ * Per-account status for one row of the card's account table: CN → check-in
2030
+ * + balances, ai → subscription. Read without changing which account is
2031
+ * bound. Optional: when absent the account rows show no check-in/credits/
2032
+ * subscription figures (the table still lists each account and its switch).
2033
+ */
2034
+ accountStateOf?(region: TraeRegion, accountId: string): Promise<TraeWebAccountState | undefined>;
2035
+ /**
2036
+ * Claim today's check-in reward for ONE named account, without moving the
2037
+ * binding. Optional: absent means the per-row claim button is disabled (the
2038
+ * check-in surface simply is not offered).
2039
+ */
2040
+ claimCheckinOf?(region: TraeRegion, accountId: string): Promise<{
2041
+ claim: TraeCheckinClaim;
2042
+ checkin: TraeCheckinStatus;
2043
+ } | undefined>;
2044
+ /**
2045
+ * The account the Trae app is signed in to right now, when it differs from
2046
+ * the bound one (issue #29). Optional: absent means the card's follow hint
2047
+ * simply is not offered (a test harness or a host without the store's scan).
2048
+ * Read-only — the HOST never rebinds from this value; the follow is a
2049
+ * settings write, made by the card or by the host's follow switch.
2050
+ */
2051
+ liveLogin?(region: TraeRegion): Promise<TraeWebAppLogin | undefined>;
1856
2052
  /** The requested region's last-refreshed raw directory (one entry per upstream model). */
1857
2053
  displayModels(region: TraeRegion): readonly TraeModelInfo[];
1858
2054
  /** The user's model selection in the requested region, stored as model id (= Trae name). */
@@ -2030,6 +2226,26 @@ interface Config {
2030
2226
  * settings form can both read and write it.
2031
2227
  */
2032
2228
  showPointsInMainUi?: boolean;
2229
+ /**
2230
+ * Follow the Trae desktop app's CURRENT sign-in instead of staying bound to
2231
+ * the account the user (or the default) picked earlier (issue #29).
2232
+ *
2233
+ * When the app switches accounts, the old binding kept billing the previous
2234
+ * account forever while `dsh-connect-workbuddy` followed the app
2235
+ * automatically — every Trae sign-out then needed a manual switch here. With
2236
+ * this switch ON, each settings re-apply rebinds `accounts.<region>` to
2237
+ * whatever the app is signed in to right now (the live login outranks the
2238
+ * plugin's own refreshed copies, see `TraeCredentialStore.preferred`).
2239
+ *
2240
+ * OFF by default: an existing configuration keeps the strict bind it
2241
+ * shipped with, because silently switching billing accounts is exactly what
2242
+ * `current()`'s no-fallback rule exists to prevent — the user opts in. When
2243
+ * OFF, the card still shows a one-click hint (its own settings write), so
2244
+ * the report in #29 is solved on both paths without any behavior change
2245
+ * nobody asked for. Declared volatile so the card's switch can read and
2246
+ * write it on the 0.1.7 settings form.
2247
+ */
2248
+ followAppLogin?: boolean;
2033
2249
  /**
2034
2250
  * Per-region model state, keyed `cn` | `ai`. The CN and international apps
2035
2251
  * expose different rosters, so each keeps its own directory and selection
@@ -2088,4 +2304,4 @@ declare function asVolatile<S>(schema: S): S;
2088
2304
  declare const Config: z<Config>;
2089
2305
  declare function apply(ctx: Context, config: Config): void;
2090
2306
  //#endregion
2091
- export { Config, FALLBACK_TRAE_MODELS, FALLBACK_TRAE_MODELS_AI, REGION_GATEWAYS, type RawChatDelta, type RawChatMessage, type RawChatTool, SseDecoder, type SseEvent, TRAE_AI_PROVIDER, TRAE_CHECKIN_PATH, TRAE_CN_AGENT_TASK_PATH, TRAE_CN_TITLE_PATH, TRAE_MODELS_TEST_PATH, TRAE_MODEL_DETAIL_FUNCTIONS, TRAE_MODEL_DETAIL_PATH, TRAE_PAY_BASE, TRAE_PROBE_TIMEOUT_MS, TRAE_PROVIDER, TRAE_PROVIDERS, TRAE_PROVIDER_DISPLAY_NAMES, TRAE_RAW_CHAT_V1_PATH, TRAE_RAW_CHAT_V2_PATH, TRAE_REASONING_EFFORTS, TRAE_REGIONS, TRAE_REGION_PARAM, TRAE_SETTINGS_NS, TRAE_SOLO_CHAT_PATH, TRAE_SOLO_FUNCTION, TRAE_SOLO_MODELS_PATH, TRAE_SOLO_REMOTE_BASE, TRAE_STATE_DB_FILENAME, TRAE_STREAM_IDLE_TIMEOUT_MS, TRAE_USAGE_PATH, TRAE_VERSION_CODE_FALLBACK, type TraeActivityRule, type TraeAdapter, type TraeCachedModelConfig, TraeCatalog, type TraeChatResult, type TraeCheckinClaim, type TraeCheckinStatus, type TraeContextBudget, type TraeCredential, TraeCredentialStore, TraeDelegatingUpstreamClient, type TraeDiscoveredModel, type TraeDiscoveredReasoning, type TraeEdition, TraeFallbackUpstreamClient, type TraeFallbackUpstreamOptions, type TraeFusionRawChatEnvelope, TraeGatedUpstreamClient, type TraeGatedUpstreamOptions, type TraeIdentity, type TraeInputModality, type TraeModelDetailRequest, type TraeModelInfo, type TraeModelProbeVerdict, type TraeModelsTestResponse, type TraeObservedModelConfig, type TraeProbeResult, type TraeProbeVerdict, TraeRawCapabilityController, type TraeRawCapabilityControllerOptions, type TraeRawCapabilitySnapshot, TraeRawCapabilityState, type TraeRawChatBehaviorConfig, type TraeRawChatCapability, type TraeRawChatClientOptions, type TraeRawChatConfig, type TraeRawChatFailureReason, type TraeRawChatRuntimeConfig, TraeRawChatUpstreamClient, type TraeRawDiagnostic, type TraeRawDiagnosticState, type TraeRawGateway, type TraeRawGatewayOptions, type TraeRawResolverResult, type TraeReasoningCapability, type TraeReasoningEffort, type TraeRefreshDevice, type TraeRegion, type TraeRegionGateways, TraeRegionState, type TraeShim, TraeSoloBridge, type TraeSoloClientOptions, TraeSoloRemoteCatalogClient, type TraeSoloRemoteCatalogOptions, TraeSoloUpstreamClient, type TraeStorageCandidate, type TraeStreamEvent, type TraeUpstreamClient, TraeUsageClient, type TraeUsageOptions, type TraeUsagePack, type TraeUsageRouteOptions, type TraeUsageSnapshot, type TraeUsageSummary, type TraeUsageView, type TraeWebActivity, type TraeWebCheckin, type TraeWebCheckinClaim, type TraeWebCredits, type TraeWebUsage, type TraeWireModel, UnconfiguredTraeUpstreamClient, apply, applyContextBudgets, applyImageSelection, applyReasoningEffort, asVolatile, bridgeTraeSoloStream, buildTraeAgentTaskBody, buildTraeCnHeaders, buildTraeFusionRawChatEnvelope, buildTraeModelDetailRequest, buildTraeRawChatDraft, buildTraeRawChatRuntimeConfig, classifyProbeError, classifyProbeResult, classifyTraeRawChatFailure, createTraeAdapter, createTraeRawGateway, createTraeShim, decodeRawChatChunk, decodeTraeEvent, decryptTraeStorageValue, deriveCatalog, describeIdShape, describeNameShape, discoveredCatalog, fallbackModelsFor, hashTraeRawChatArg, identityHeaders, inject, legacyTraeOwnAuthPath, maskUserPath, mergeTraeModelSources, name, nextRegionEnabled, nextRegionSlots, normalizeTraeCredential, normalizeTraeVersionCode, parseObservedModelConfig, parseReasoningCapability, parseTraeAuthValue, parseTraeCachedModel, parseTraeModelExtraConfigLogLine, parseTraeRawChatBehaviorConfig, parseTraeRemoteModel, parseTraeStorageDocument, pickTraeStorageIdentity, prepareSoloBody, probeBody, probeModelsSequentially, probeOneModel, probeTraeRawChatCapability, rawCapabilityDiagnostic, rawCapabilityFingerprint, readTraeCachedModel, readTraeCliIdentity, readTraeIdentity, refreshTraeCredential, regionEnabled, regionEnabledOf, regionOfCredential, regionOfEdition, regionOfHost, regionOfTraeProvider, regionOfTraeStatusUrl, regionOfUserRegion, regionStateOf, registerTraeUsageRoute, resolveTraeIdentity, resolveTraeRawRuntime, sanitizeCatalog, settingsNamespaceOf, traeEndpoint, traeInputModalities, traeModelDisplayName, traeOwnAuthPath, traeRawChatExtraInfo, traeStateDatabaseCandidates, traeStorageCandidates, traeWebUsage, traeWindowsAppNames, unwrapVolatile, unwrapVolatileDeep, withTraeRegion };
2307
+ export { Config, FALLBACK_TRAE_MODELS, FALLBACK_TRAE_MODELS_AI, REGION_GATEWAYS, type RawChatDelta, type RawChatMessage, type RawChatTool, SseDecoder, type SseEvent, TRAE_ACCOUNT_STATUS_PATH, TRAE_AI_PROVIDER, TRAE_CHECKIN_PATH, TRAE_CN_AGENT_TASK_PATH, TRAE_CN_TITLE_PATH, TRAE_MODELS_TEST_PATH, TRAE_MODEL_DETAIL_FUNCTIONS, TRAE_MODEL_DETAIL_PATH, TRAE_PAY_BASE, TRAE_PROBE_TIMEOUT_MS, TRAE_PROVIDER, TRAE_PROVIDERS, TRAE_PROVIDER_DISPLAY_NAMES, TRAE_RAW_CHAT_V1_PATH, TRAE_RAW_CHAT_V2_PATH, TRAE_REASONING_EFFORTS, TRAE_REGIONS, TRAE_REGION_PARAM, TRAE_SETTINGS_NS, TRAE_SOLO_CHAT_PATH, TRAE_SOLO_FUNCTION, TRAE_SOLO_MODELS_PATH, TRAE_SOLO_REMOTE_BASE, TRAE_STATE_DB_FILENAME, TRAE_STREAM_IDLE_TIMEOUT_MS, TRAE_USAGE_PATH, TRAE_VERSION_CODE_FALLBACK, type TraeActivityRule, type TraeAdapter, type TraeCachedModelConfig, TraeCatalog, type TraeChatResult, type TraeCheckinClaim, type TraeCheckinStatus, type TraeContextBudget, type TraeCredential, TraeCredentialStore, TraeDelegatingUpstreamClient, type TraeDiscoveredModel, type TraeDiscoveredReasoning, type TraeEdition, TraeFallbackUpstreamClient, type TraeFallbackUpstreamOptions, type TraeFusionRawChatEnvelope, TraeGatedUpstreamClient, type TraeGatedUpstreamOptions, type TraeIdentity, type TraeInputModality, type TraeModelDetailRequest, type TraeModelInfo, type TraeModelProbeVerdict, type TraeModelsTestResponse, type TraeObservedModelConfig, type TraeProbeResult, type TraeProbeVerdict, TraeRawCapabilityController, type TraeRawCapabilityControllerOptions, type TraeRawCapabilitySnapshot, TraeRawCapabilityState, type TraeRawChatBehaviorConfig, type TraeRawChatCapability, type TraeRawChatClientOptions, type TraeRawChatConfig, type TraeRawChatFailureReason, type TraeRawChatRuntimeConfig, TraeRawChatUpstreamClient, type TraeRawDiagnostic, type TraeRawDiagnosticState, type TraeRawGateway, type TraeRawGatewayOptions, type TraeRawResolverResult, type TraeReasoningCapability, type TraeReasoningEffort, type TraeRefreshDevice, type TraeRegion, type TraeRegionGateways, TraeRegionState, type TraeShim, TraeSoloBridge, type TraeSoloClientOptions, TraeSoloRemoteCatalogClient, type TraeSoloRemoteCatalogOptions, TraeSoloUpstreamClient, type TraeStorageCandidate, type TraeStreamEvent, type TraeUpstreamClient, TraeUsageClient, type TraeUsageOptions, type TraeUsagePack, type TraeUsageRouteOptions, type TraeUsageSnapshot, type TraeUsageSummary, type TraeUsageView, type TraeWebAccountState, type TraeWebActivity, type TraeWebAppLogin, type TraeWebCheckin, type TraeWebCheckinClaim, type TraeWebCredits, type TraeWebUsage, type TraeWireModel, UnconfiguredTraeUpstreamClient, apply, applyContextBudgets, applyImageSelection, applyReasoningEffort, asVolatile, bridgeTraeSoloStream, buildTraeAgentTaskBody, buildTraeCnHeaders, buildTraeFusionRawChatEnvelope, buildTraeModelDetailRequest, buildTraeRawChatDraft, buildTraeRawChatRuntimeConfig, classifyProbeError, classifyProbeResult, classifyTraeRawChatFailure, configuredAccountsOf, createTraeAdapter, createTraeRawGateway, createTraeShim, decodeRawChatChunk, decodeTraeEvent, decryptTraeStorageValue, deriveCatalog, describeIdShape, describeNameShape, discoveredCatalog, fallbackModelsFor, followAppLoginEnabled, hashTraeRawChatArg, identityHeaders, inject, legacyTraeOwnAuthPath, maskUserPath, mergeTraeModelSources, name, nextRegionEnabled, nextRegionSlots, normalizeTraeCredential, normalizeTraeVersionCode, parseObservedModelConfig, parseReasoningCapability, parseTraeAuthValue, parseTraeCachedModel, parseTraeModelExtraConfigLogLine, parseTraeRawChatBehaviorConfig, parseTraeRemoteModel, parseTraeStorageDocument, pickTraeStorageIdentity, prepareSoloBody, probeBody, probeModelsSequentially, probeOneModel, probeTraeRawChatCapability, rawCapabilityDiagnostic, rawCapabilityFingerprint, readTraeCachedModel, readTraeCliIdentity, readTraeIdentity, refreshTraeCredential, regionEnabled, regionEnabledOf, regionOfCredential, regionOfEdition, regionOfHost, regionOfTraeProvider, regionOfTraeStatusUrl, regionOfUserRegion, regionStateOf, registerTraeUsageRoute, resolveTraeIdentity, resolveTraeRawRuntime, sanitizeCatalog, settingsNamespaceOf, traeEndpoint, traeInputModalities, traeModelDisplayName, traeOwnAuthPath, traeRawChatExtraInfo, traeStateDatabaseCandidates, traeStorageCandidates, traeWebUsage, traeWindowsAppNames, unwrapVolatile, unwrapVolatileDeep, withTraeRegion };