dsh-connect-trae 4.4.3 → 4.4.5
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/CHANGELOG.md +141 -4
- package/lib/client.js +576 -78
- package/lib/index.d.ts +341 -2
- package/lib/index.js +500 -65
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -451,6 +451,33 @@ declare function isPromotableWireModel(model: TraeWireModel): boolean;
|
|
|
451
451
|
* promotion every snapshot the IDE offers is unreachable from the plugin.
|
|
452
452
|
*/
|
|
453
453
|
declare function mergeTraeModelSources(remote: readonly TraeDiscoveredModel[], wire: readonly TraeWireModel[]): TraeModelInfo[];
|
|
454
|
+
/**
|
|
455
|
+
* Demote a NON-chat `wireFunction` to "no function", keeping the row.
|
|
456
|
+
*
|
|
457
|
+
* A row pinned to an IDE/Remote-agent roster — `solo_agent`, `builder_v3` — is
|
|
458
|
+
* not callable through `llm_utils_chat` by THAT function: asking answers
|
|
459
|
+
* 4011/4001 (measured 2026-10-01, issue #19). Dropping the row is not the fix,
|
|
460
|
+
* though, and was a regression: a model can carry a non-chat function for a
|
|
461
|
+
* reason that says nothing about its chat availability. The directory lists
|
|
462
|
+
* `gpt-5.5`, `gpt-5.6-*`, `gpt-6-astra`, `glm-5.2`, `kimi-k2.7-code`,
|
|
463
|
+
* `Dola-Seed-2.0-Code` and `deepseek-v4-flash-0731` under `solo_agent` ALONE
|
|
464
|
+
* (docs/ISSUE19_DIAGNOSIS.md), yet the same models answer normally under
|
|
465
|
+
* `solo_work_remote` / `solo_work_lite` / `solo_agent_remote` — they are
|
|
466
|
+
* exactly the models issue #19's fix was opened to expose. Dropping them
|
|
467
|
+
* re-hid the whole set on the restricted networks this fallback targets, where
|
|
468
|
+
* the wire roster is empty and the directory group is the only attribution.
|
|
469
|
+
*
|
|
470
|
+
* Keeping the row with the function CLEARED preserves both facts: the model
|
|
471
|
+
* stays visible (issue #19), and the bridge sends the region's DEFAULT chat
|
|
472
|
+
* function instead of one that is guaranteed to refuse. That is the pre-change
|
|
473
|
+
* behaviour for these rows — a genuinely unreachable model still fails with a
|
|
474
|
+
* readable upstream message rather than a silent absence.
|
|
475
|
+
*
|
|
476
|
+
* `chatFunctions` must be the region's own `TRAE_DIRECTORY_FUNCTIONS` list —
|
|
477
|
+
* the functions `llm_utils_chat` accepts. Callers should log the demoted rows:
|
|
478
|
+
* "which function did it lose, and why" deserves an answer.
|
|
479
|
+
*/
|
|
480
|
+
declare function withChatCallableFunctions(rows: readonly TraeModelInfo[], chatFunctions: readonly string[]): TraeModelInfo[];
|
|
454
481
|
/** Local DSH context budget per model; a value may only select an advertised window. */
|
|
455
482
|
type TraeContextBudget = number;
|
|
456
483
|
/**
|
|
@@ -873,6 +900,19 @@ interface TraeWebModel {
|
|
|
873
900
|
defaultEffort?: string;
|
|
874
901
|
};
|
|
875
902
|
maxContextWindow?: number;
|
|
903
|
+
/**
|
|
904
|
+
* The directory function this row is called through, and the `config_name`
|
|
905
|
+
* that function accepts (issue #52).
|
|
906
|
+
*
|
|
907
|
+
* Carried on the wire document because it is the ONLY thing that explains the
|
|
908
|
+
* catalog's shape to the person looking at it: the plugin serves the union of
|
|
909
|
+
* a dozen Trae channels, so 34 rows are 34 rows only until they are grouped by
|
|
910
|
+
* the channel each one will actually run on. Absent on rows the merge could
|
|
911
|
+
* not attribute (those fall back to the default chat function) and on catalogs
|
|
912
|
+
* saved before these fields existed.
|
|
913
|
+
*/
|
|
914
|
+
wireFunction?: string;
|
|
915
|
+
wireConfigName?: string;
|
|
876
916
|
/**
|
|
877
917
|
* Trae's own image-capability flag, as the runtime catalog carries it. The
|
|
878
918
|
* card renders these rows with their image checkbox already ticked so the
|
|
@@ -2350,6 +2390,306 @@ interface TraeModelDetailRequest {
|
|
|
2350
2390
|
/** Build the exact request shape observed in successful current Trae CN logs. */
|
|
2351
2391
|
declare function buildTraeModelDetailRequest(configName?: string, custom?: boolean): TraeModelDetailRequest;
|
|
2352
2392
|
//#endregion
|
|
2393
|
+
//#region src/official-roster.d.ts
|
|
2394
|
+
/**
|
|
2395
|
+
* The IDE's own roster: what the Trae picker is WILLING TO SHOW, per function.
|
|
2396
|
+
*
|
|
2397
|
+
* Issue #52. The plugin lists the UNION of every directory function (46 rows on
|
|
2398
|
+
* a live CN credential, 2026-10-23) while the Trae client renders ONE function's
|
|
2399
|
+
* list at a time (14–24 rows). Two different questions were being answered by
|
|
2400
|
+
* one list, and the user saw the difference as "why are there so many models".
|
|
2401
|
+
*
|
|
2402
|
+
* This module answers the second question with the third upstream signal the
|
|
2403
|
+
* catalog was missing. `isPromotableWireModel` (src/catalog.ts) asks "can this
|
|
2404
|
+
* config be called"; this one asks "does the vendor's own picker offer it", read
|
|
2405
|
+
* from `is_invisible_to_user` on the SAME `batch_get_detail_param` document the
|
|
2406
|
+
* IDE renders. Both are upstream facts; neither is invented.
|
|
2407
|
+
*
|
|
2408
|
+
* The flag is PER (config, function), not per config — measured 2026-10-23:
|
|
2409
|
+
* `glm-4.7` is visible under `code_review_summary` and hidden under `solo_coder`
|
|
2410
|
+
* and `solo_work_remote`. A row's visibility therefore only means something
|
|
2411
|
+
* together with the function the chat call will replay, which is why the
|
|
2412
|
+
* decision below takes BOTH and why the answer cannot be merged as a bare field
|
|
2413
|
+
* the way `contextWindow` is.
|
|
2414
|
+
*/
|
|
2415
|
+
/** One (config, function) pair exactly as the IDE roster published it. */
|
|
2416
|
+
interface TraeOfficialChannel {
|
|
2417
|
+
/** The `function_configs[].function` this row was listed under. */
|
|
2418
|
+
function: string;
|
|
2419
|
+
/**
|
|
2420
|
+
* Upstream's `usage` for the config under this function: `chat_completion`
|
|
2421
|
+
* for a real model, one value per built-in tool config (`summary`,
|
|
2422
|
+
* `fast_apply`, …), `custom_model` for the account's own model. Empty when
|
|
2423
|
+
* upstream did not say.
|
|
2424
|
+
*/
|
|
2425
|
+
usage: string;
|
|
2426
|
+
/** `config_switch`: false means upstream marked the config OFF on this function. */
|
|
2427
|
+
enabled: boolean;
|
|
2428
|
+
/** `is_invisible_to_user`: true means the vendor's picker does not list it here. */
|
|
2429
|
+
invisible: boolean;
|
|
2430
|
+
}
|
|
2431
|
+
/** What the IDE roster knows about one `config_name`. */
|
|
2432
|
+
interface TraeOfficialRoster {
|
|
2433
|
+
/** Lower-cased `config_name` → every (function, visibility) pair published. */
|
|
2434
|
+
channels: ReadonlyMap<string, readonly TraeOfficialChannel[]>;
|
|
2435
|
+
/** Number of distinct configs and pairs, for diagnostics only. */
|
|
2436
|
+
size: {
|
|
2437
|
+
configs: number;
|
|
2438
|
+
pairs: number;
|
|
2439
|
+
};
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Parse a `batch_get_detail_param` answer into a per-(config, function) index.
|
|
2443
|
+
*
|
|
2444
|
+
* Tolerant on purpose: this document is 1.8 MB of upstream-owned shape
|
|
2445
|
+
* (`function_configs[] → config_info_list[] → model_detail_list[]`), and the
|
|
2446
|
+
* plugin must not lose the whole refresh because one nested field changed
|
|
2447
|
+
* spelling. Rows that cannot be read are skipped; a document with no
|
|
2448
|
+
* `function_configs` at all yields an empty roster, which the filter reads as
|
|
2449
|
+
* "nothing to say" rather than "hide everything".
|
|
2450
|
+
*
|
|
2451
|
+
* Duplicate pairs are collapsed first-wins, matching the rest of the catalog's
|
|
2452
|
+
* convention (`mergeTraeModelSources`). Two functions can both list a config,
|
|
2453
|
+
* and those are DIFFERENT pairs, so both are kept.
|
|
2454
|
+
*/
|
|
2455
|
+
declare function parseTraeOfficialRoster(payload: unknown): TraeOfficialRoster;
|
|
2456
|
+
/**
|
|
2457
|
+
* What the roster says to do with one catalog row.
|
|
2458
|
+
*
|
|
2459
|
+
* `is_invisible_to_user` is a per-(config, function) MODE roster, not a
|
|
2460
|
+
* lifecycle flag. Measured 2026-10-23 on a live CN account: `DeepSeek-V4-Pro` is
|
|
2461
|
+
* hidden under `solo_work_remote` (where that mode's picker shows
|
|
2462
|
+
* `DeepSeek-V4-Pro-Official`) while `solo_coder`, `chat_v3` and `chat` all list
|
|
2463
|
+
* it as visible; `glm-5` is hidden under `solo_work_remote` and
|
|
2464
|
+
* `solo_agent_remote` and visible under `solo_work_lite` and `solo_coder`.
|
|
2465
|
+
*
|
|
2466
|
+
* Reading the flag as "this model is retired" would have deleted six models that
|
|
2467
|
+
* are in current use. Reading it as "this config is not the one THIS mode
|
|
2468
|
+
* offers" yields the two verdicts below: a config no chat function offers any
|
|
2469
|
+
* more is retired (hide), and a config offered somewhere else is mis-pinned
|
|
2470
|
+
* (re-pin to the function the vendor itself uses). Both replace a guess — the
|
|
2471
|
+
* union of twelve directories — with an upstream answer.
|
|
2472
|
+
*/
|
|
2473
|
+
type TraeOfficialVerdict =
|
|
2474
|
+
/** Visible on the function it would be called through, or the roster says nothing. */
|
|
2475
|
+
{
|
|
2476
|
+
kind: 'keep';
|
|
2477
|
+
} |
|
|
2478
|
+
/** Invisible on EVERY chat function that lists it: the vendor retired it as a chat model. */
|
|
2479
|
+
{
|
|
2480
|
+
kind: 'hide';
|
|
2481
|
+
function: string | undefined;
|
|
2482
|
+
listedBy: string[];
|
|
2483
|
+
} |
|
|
2484
|
+
/** Invisible on its own function while another chat function offers it. */
|
|
2485
|
+
{
|
|
2486
|
+
kind: 'repin';
|
|
2487
|
+
from: string | undefined;
|
|
2488
|
+
to: string;
|
|
2489
|
+
listedBy: string[];
|
|
2490
|
+
};
|
|
2491
|
+
/**
|
|
2492
|
+
* Decide one row from the roster.
|
|
2493
|
+
*
|
|
2494
|
+
* `chatFunctions` is the region's own `TRAE_DIRECTORY_FUNCTIONS` list, in
|
|
2495
|
+
* priority order: only those functions can carry a VERDICT, because only those
|
|
2496
|
+
* are functions `llm_utils_chat` accepts. A config the vendor shows under
|
|
2497
|
+
* `code_review_summary` alone is not offered as a chat model at all — that is
|
|
2498
|
+
* exactly the `glm-4.7` case, and it is a "hide", not a "re-pin".
|
|
2499
|
+
*
|
|
2500
|
+
* The verdict is `keep` when the roster cannot speak: no entry for the config
|
|
2501
|
+
* (measured 2026-10-23: `kimi-k2.8-preview` and `qwen3.8-flash` exist only in
|
|
2502
|
+
* the Remote directory's `chat_v3` group), only tool rows (`usage: 'summary'`,
|
|
2503
|
+
* `fast_apply`, …), or no chat function at all. Silence is never a verdict.
|
|
2504
|
+
*/
|
|
2505
|
+
declare function officialVerdictOf(model: {
|
|
2506
|
+
id: string;
|
|
2507
|
+
wireConfigName?: string;
|
|
2508
|
+
wireFunction?: string;
|
|
2509
|
+
}, roster: TraeOfficialRoster, chatFunctions: readonly string[]): TraeOfficialVerdict;
|
|
2510
|
+
interface TraeOfficialFilterResult<T> {
|
|
2511
|
+
/** Rows the catalog should keep, in their original order. */
|
|
2512
|
+
rows: T[];
|
|
2513
|
+
/** Rows removed, with the function that hid them, for the log and the tests. */
|
|
2514
|
+
hidden: Array<{
|
|
2515
|
+
id: string;
|
|
2516
|
+
function: string | undefined;
|
|
2517
|
+
}>;
|
|
2518
|
+
/** Rows kept but moved to the chat function the vendor offers them on. */
|
|
2519
|
+
repinned: Array<{
|
|
2520
|
+
id: string;
|
|
2521
|
+
from: string | undefined;
|
|
2522
|
+
to: string;
|
|
2523
|
+
}>;
|
|
2524
|
+
}
|
|
2525
|
+
/**
|
|
2526
|
+
* Apply the roster: retire what no chat function offers any more, and re-pin
|
|
2527
|
+
* what the vendor offers under a different channel.
|
|
2528
|
+
*
|
|
2529
|
+
* FAIL-OPEN BY CONSTRUCTION, which is the whole safety argument for applying
|
|
2530
|
+
* this by default:
|
|
2531
|
+
*
|
|
2532
|
+
* - `undefined` roster (transport failure, restricted network, a credential
|
|
2533
|
+
* that cannot read the IDE document) keeps EVERY row. A refresh must never
|
|
2534
|
+
* lose models because a second, optional endpoint was unreachable.
|
|
2535
|
+
* - `keep` covers every ambiguity — no entry, tool-only entries, a channel the
|
|
2536
|
+
* roster does not name. Only an explicit "the vendor shows this nowhere we
|
|
2537
|
+
* can call it" removes a row.
|
|
2538
|
+
* - `config_switch === false` alone does NOT remove a row: the flag is
|
|
2539
|
+
* recorded on {@link TraeOfficialChannel} but not used as a verdict, because
|
|
2540
|
+
* its semantics are unmeasured and "disabled" there may describe a function
|
|
2541
|
+
* override rather than the model itself.
|
|
2542
|
+
*
|
|
2543
|
+
* This is deliberately NOT "match the Trae client": the client renders one
|
|
2544
|
+
* function, the plugin serves the union, and issue #46's reporter wants the
|
|
2545
|
+
* dated snapshots the union carries. What changes here is only the class where
|
|
2546
|
+
* the union is provably wrong — twelve retired configs that made up the reported
|
|
2547
|
+
* "tail of old models", plus rows pinned to a channel their own vendor hides
|
|
2548
|
+
* them on (the "code model on a solo channel" risk of issue #52).
|
|
2549
|
+
*/
|
|
2550
|
+
declare function applyOfficialRoster<T extends {
|
|
2551
|
+
id: string;
|
|
2552
|
+
wireConfigName?: string;
|
|
2553
|
+
wireFunction?: string;
|
|
2554
|
+
}>(rows: readonly T[], roster: TraeOfficialRoster | undefined, chatFunctions: readonly string[]): TraeOfficialFilterResult<T>;
|
|
2555
|
+
interface TraeOfficialRosterOptions {
|
|
2556
|
+
credential(): Promise<TraeCredential>;
|
|
2557
|
+
identity(): Promise<TraeIdentity>;
|
|
2558
|
+
fetchImpl?: typeof fetch;
|
|
2559
|
+
/** Pins the host (tests, diagnostics). Defaults to the credential region's chat gateway. */
|
|
2560
|
+
baseUrl?: string;
|
|
2561
|
+
/** Pin the tenant pool's gateway, exactly like `TraeSoloUpstreamClient`. */
|
|
2562
|
+
route?: 'solo' | 'enterprise';
|
|
2563
|
+
log?: (message: string, detail?: unknown) => void;
|
|
2564
|
+
now?: () => number;
|
|
2565
|
+
}
|
|
2566
|
+
/**
|
|
2567
|
+
* Reads the IDE's roster once per cache window and never throws.
|
|
2568
|
+
*
|
|
2569
|
+
* `undefined` is a first-class answer: it is what a caller sees when the
|
|
2570
|
+
* document could not be read, and {@link applyOfficialRoster} treats it as "no
|
|
2571
|
+
* opinion". Silence on failure is intentional — this is a refinement of a
|
|
2572
|
+
* refresh that already succeeded, so a strict error would turn a usable catalog
|
|
2573
|
+
* into a failed refresh.
|
|
2574
|
+
*/
|
|
2575
|
+
declare class TraeOfficialRosterClient {
|
|
2576
|
+
private readonly options;
|
|
2577
|
+
private readonly fetchImpl;
|
|
2578
|
+
private readonly now;
|
|
2579
|
+
private cached;
|
|
2580
|
+
/** The last failure, so a repeatedly-broken endpoint is not re-probed on every refresh. */
|
|
2581
|
+
private failedAt;
|
|
2582
|
+
constructor(options: TraeOfficialRosterOptions);
|
|
2583
|
+
/** Cached roster, without any network I/O. */
|
|
2584
|
+
cachedRoster(): TraeOfficialRoster | undefined;
|
|
2585
|
+
fetch(signal?: AbortSignal): Promise<TraeOfficialRoster | undefined>;
|
|
2586
|
+
}
|
|
2587
|
+
/** Where the client asks for the roster; re-exported so diagnostics do not hard-code it. */
|
|
2588
|
+
declare const TRAE_OFFICIAL_ROSTER_PATH = "/api/ide/v1/batch_get_detail_param";
|
|
2589
|
+
//#endregion
|
|
2590
|
+
//#region src/model-order.d.ts
|
|
2591
|
+
/**
|
|
2592
|
+
* Wire name of the default SOLO chat function.
|
|
2593
|
+
*
|
|
2594
|
+
* Lives here rather than in `solo.ts` so this module stays importable from the
|
|
2595
|
+
* client; `solo.ts` re-exports it, so there is still exactly one definition.
|
|
2596
|
+
*/
|
|
2597
|
+
declare const TRAE_SOLO_FUNCTION = "solo_work_lite";
|
|
2598
|
+
/**
|
|
2599
|
+
* The chat functions of one region, in PRIORITY order.
|
|
2600
|
+
*
|
|
2601
|
+
* Two consumers read it, and both mean "priority", which is why they can share
|
|
2602
|
+
* one array: the wire asks these functions in order and the first to list a
|
|
2603
|
+
* config owns it (`solo.ts`), and the card draws the groups in the same order so
|
|
2604
|
+
* the row a user sees first is the one the resolver prefers.
|
|
2605
|
+
*/
|
|
2606
|
+
declare const TRAE_CHANNEL_PRIORITY: Readonly<Record<TraeRegion, readonly string[]>>;
|
|
2607
|
+
/** The subset of a catalog row this module needs. */
|
|
2608
|
+
interface TraeOrderableModel {
|
|
2609
|
+
id: string;
|
|
2610
|
+
name: string;
|
|
2611
|
+
/** The directory function the row will be called through; absent = default. */
|
|
2612
|
+
wireFunction?: string;
|
|
2613
|
+
/** The `config_name` to actually send; absent means `id` is the wire id. */
|
|
2614
|
+
wireConfigName?: string;
|
|
2615
|
+
}
|
|
2616
|
+
/**
|
|
2617
|
+
* The catalog in display order: channel priority first, then name.
|
|
2618
|
+
*
|
|
2619
|
+
* Total and stable — ties fall through to `id`, so two rows with the same name
|
|
2620
|
+
* in the same channel still get one fixed order rather than the order they
|
|
2621
|
+
* arrived in.
|
|
2622
|
+
*/
|
|
2623
|
+
declare function orderTraeModels<T extends TraeOrderableModel>(rows: readonly T[], region?: TraeRegion): T[];
|
|
2624
|
+
/** One rendered group: the channel and the rows attributed to it. */
|
|
2625
|
+
interface TraeModelGroup<T> {
|
|
2626
|
+
/** `undefined` for rows whose call function is unknown (they use the default). */
|
|
2627
|
+
channel: string | undefined;
|
|
2628
|
+
rows: T[];
|
|
2629
|
+
}
|
|
2630
|
+
/**
|
|
2631
|
+
* Split rows into channel groups, in display order.
|
|
2632
|
+
*
|
|
2633
|
+
* Ordering is re-applied here rather than trusted from the caller: a group list
|
|
2634
|
+
* built from an unsorted input would put the groups in arrival order, which is
|
|
2635
|
+
* the exact instability this module exists to remove.
|
|
2636
|
+
*/
|
|
2637
|
+
declare function groupTraeModels<T extends TraeOrderableModel>(rows: readonly T[], region?: TraeRegion): TraeModelGroup<T>[];
|
|
2638
|
+
/**
|
|
2639
|
+
* Does one row match a search query?
|
|
2640
|
+
*
|
|
2641
|
+
* Matches the display name, the display id and the WIRE config name — the last
|
|
2642
|
+
* one because a user debugging a `4001 config_name rejected` arrives with the
|
|
2643
|
+
* upstream name in hand, and the two differ exactly on the rows that carry a
|
|
2644
|
+
* suffix (`DeepSeek-V4-Flash` vs `DeepSeek-V4-Flash-Official`).
|
|
2645
|
+
*/
|
|
2646
|
+
declare function traeModelMatchesQuery(model: TraeOrderableModel, query: string): boolean;
|
|
2647
|
+
/** Filter by {@link traeModelMatchesQuery}, preserving order. */
|
|
2648
|
+
declare function filterTraeModels<T extends TraeOrderableModel>(rows: readonly T[], query: string): T[];
|
|
2649
|
+
/**
|
|
2650
|
+
* The channels a NORMAL Trae chat session actually runs on: the `solo_work_*`
|
|
2651
|
+
* family, i.e. the panel's own chat modes.
|
|
2652
|
+
*
|
|
2653
|
+
* Deliberately not "every channel we can call". After issue #52 P1 the catalog
|
|
2654
|
+
* is 34 rows and 10 of them are reachable only through a SPECIALIST channel:
|
|
2655
|
+
* `solo_coder` (7: `Doubao-Seed-2.0-Code`, `glm-5.1`, `glm-5v-turbo`,
|
|
2656
|
+
* `kimi-k2.5`, `minimax-m2.7`, `qwen-3.5`, `qwen-3.6-plus`), `chat_v3` (2:
|
|
2657
|
+
* `kimi-k2.8-preview`, `qwen3.8-flash`) and `solo_agent_remote` (1:
|
|
2658
|
+
* `Doubao-Seed-Code`). Measured 2026-10-23 on a live CN account. Those rows work
|
|
2659
|
+
* — that is why P1 kept them — but they are not what Trae's main chat offers,
|
|
2660
|
+
* and mixing them into the default view is exactly the "a code model answering a
|
|
2661
|
+
* solo request" shape issue #52 asked about.
|
|
2662
|
+
*/
|
|
2663
|
+
declare const TRAE_COMMON_FUNCTIONS: Readonly<Record<TraeRegion, readonly string[]>>;
|
|
2664
|
+
/**
|
|
2665
|
+
* The function a request for this row will NAME.
|
|
2666
|
+
*
|
|
2667
|
+
* A row with no `wireFunction` is not "unknown to the wire": the bridge sends
|
|
2668
|
+
* the region default (`TRAE_SOLO_FUNCTION`), so for every question about where
|
|
2669
|
+
* the turn goes, the default is the answer. The distinction still matters for
|
|
2670
|
+
* DISPLAY (`groupTraeModels` keeps these in their own group, because their
|
|
2671
|
+
* provenance — which directory group advertised them — really is unknown), but
|
|
2672
|
+
* not for scope: a `solo_work_lite` turn is a normal chat turn either way.
|
|
2673
|
+
*/
|
|
2674
|
+
declare function traeModelCallChannel(model: TraeOrderableModel): string;
|
|
2675
|
+
/** Which slice of the catalog a view asks for. */
|
|
2676
|
+
type TraeModelView =
|
|
2677
|
+
/** Rows a normal chat turn can reach: {@link TRAE_COMMON_FUNCTIONS}. */
|
|
2678
|
+
'common' |
|
|
2679
|
+
/** Every callable row, specialist channels included. */
|
|
2680
|
+
'all';
|
|
2681
|
+
/**
|
|
2682
|
+
* Does this row belong to the view?
|
|
2683
|
+
*
|
|
2684
|
+
* Judged on {@link traeModelCallChannel}, never on `wireFunction` directly:
|
|
2685
|
+
* otherwise the one row without a function (`doubao_1_8`, measured 2026-10-23)
|
|
2686
|
+
* would fall OUT of the common view while being called through exactly the
|
|
2687
|
+
* common channel it belongs to.
|
|
2688
|
+
*/
|
|
2689
|
+
declare function traeModelInView(model: TraeOrderableModel, view: TraeModelView, region?: TraeRegion): boolean;
|
|
2690
|
+
/** Keep the rows a view asks for, preserving order. */
|
|
2691
|
+
declare function scopeTraeModels<T extends TraeOrderableModel>(rows: readonly T[], view: TraeModelView, region?: TraeRegion): T[];
|
|
2692
|
+
//#endregion
|
|
2353
2693
|
//#region src/redact.d.ts
|
|
2354
2694
|
/**
|
|
2355
2695
|
* Redaction helpers for diagnostics that a user may paste into a public issue.
|
|
@@ -2882,7 +3222,6 @@ type TraeStreamEvent = {
|
|
|
2882
3222
|
declare function decodeTraeEvent(event: SseEvent): TraeStreamEvent;
|
|
2883
3223
|
//#endregion
|
|
2884
3224
|
//#region src/solo.d.ts
|
|
2885
|
-
declare const TRAE_SOLO_FUNCTION = "solo_work_lite";
|
|
2886
3225
|
declare const TRAE_SOLO_CHAT_PATH = "/api/agent/v3/llm_utils_chat";
|
|
2887
3226
|
declare const TRAE_SOLO_MODELS_PATH = "/api/ide/v1/get_detail_param";
|
|
2888
3227
|
declare function prepareSoloBody(source: string, defaultModel?: string, functionName?: string): string;
|
|
@@ -4028,4 +4367,4 @@ declare function asVolatile<S>(schema: S): S;
|
|
|
4028
4367
|
declare const Config: z<Config>;
|
|
4029
4368
|
declare function apply(ctx: Context$1, config: Config): void;
|
|
4030
4369
|
//#endregion
|
|
4031
|
-
export { Config, FALLBACK_TRAE_MODELS, FALLBACK_TRAE_MODELS_AI, MAX_PROBE_INPUT_TOKENS, type PiAiGeneration, type PiAiRuntimeInfo, 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_ENTERPRISE_PROVIDER, TRAE_MODELS_TEST_PATH, TRAE_MODEL_DETAIL_FUNCTIONS, TRAE_MODEL_DETAIL_PATH, TRAE_PANELS, TRAE_PAY_BASE, TRAE_PROBE_TIMEOUT_MS, TRAE_PROVIDER, TRAE_PROVIDERS, TRAE_PROVIDER_DISPLAY_NAMES, TRAE_PROVIDER_IDS, TRAE_PROVIDER_ID_DISPLAY_NAMES, TRAE_PROVIDER_ROUTES, 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, type TraeFailure, TraeFallbackUpstreamClient, type TraeFallbackUpstreamOptions, type TraeFusionRawChatEnvelope, TraeGatedUpstreamClient, type TraeGatedUpstreamOptions, type TraeIdentity, type TraeInputModality, type TraeModelDetailRequest, type TraeModelInfo, type TraeModelProbeVerdict, type TraeModelsTestResponse, type TraeObservedModelConfig, type TraePanel, type TraeProbeResult, type TraeProbeVerdict, type TraeProviderRoute, 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 TraeWebCheckin, type TraeWebCheckinClaim, type TraeWebCredits, type TraeWebUsage, type TraeWireModel, type TraeWireTarget, UnconfiguredTraeUpstreamClient, adaptLegacyPiAiContext, adaptModernPiAiContext, apply, applyContextBudgets, applyImageSelection, applyReasoningEffort, asVolatile, bridgeTraeSoloStream, buildTraeAgentTaskBody, buildTraeCnHeaders, buildTraeFusionRawChatEnvelope, buildTraeModelDetailRequest, buildTraeRawChatDraft, buildTraeRawChatRuntimeConfig, classifyProbeError, classifyProbeResult, classifyTraeRawChatFailure, configuredAccountsOf, createTraeAdapter, createTraeRawGateway, createTraeShim, creditPosition, decidePiAiGeneration, decodeRawChatChunk, decodeTraeEvent, decryptTraeStorageValue, deriveCatalog, describeIdShape, describeNameShape, describeTraeFailure, discoveredCatalog, displayNameOfTraeProvider, fallbackModelsFor, generationOf, hashTraeRawChatArg, identityHeaders, inject, isEnterpriseAccount, isPromotableWireModel, legacyTraeOwnAuthPath, maskUserPath, mergeTraeModelSources, name, nextRegionCreditPosition, nextRegionEnabled, nextRegionSlots, normalizeTraeCredential, normalizeTraeToolSchema, normalizeTraeToolSchemas, normalizeTraeVersionCode, panelOfKey, panelOfProvider, parseObservedModelConfig, parseReasoningCapability, parseTraeAuthValue, parseTraeCachedModel, parseTraeModelExtraConfigLogLine, parseTraeRawChatBehaviorConfig, parseTraeRemoteModel, parseTraeStorageDocument, piAiRuntimeInfo, pickTraeStorageIdentity, prepareSoloBody, probeBody, probeModelsSequentially, probeOneModel, probeTraeRawChatCapability, providerOfPanel, rawCapabilityDiagnostic, rawCapabilityFingerprint, readTraeCachedModel, readTraeCliIdentity, readTraeIdentity, refreshTraeCredential, regionCreditPositionOf, regionEnabled, regionEnabledOf, regionOfCredential, regionOfEdition, regionOfHost, regionOfPanel, regionOfTraeProvider, regionOfTraeStatusUrl, regionOfUserRegion, regionStateOf, registerTraeUsageRoute, resolveTraeIdentity, resolveTraeRawRuntime, routeOfTraeProvider, sanitizeCatalog, settingsNamespaceOf, traeEndpoint, traeInputModalities, traeModelDisplayName, traeOwnAuthPath, traeRawChatExtraInfo, traeStateDatabaseCandidates, traeStorageCandidates, traeWebUsage, traeWindowsAppNames, unwrapVolatile, unwrapVolatileDeep, wireTargetsOf, withContextAdaptation, withTraeRegion };
|
|
4370
|
+
export { Config, FALLBACK_TRAE_MODELS, FALLBACK_TRAE_MODELS_AI, MAX_PROBE_INPUT_TOKENS, type PiAiGeneration, type PiAiRuntimeInfo, REGION_GATEWAYS, type RawChatDelta, type RawChatMessage, type RawChatTool, SseDecoder, type SseEvent, TRAE_ACCOUNT_STATUS_PATH, TRAE_AI_PROVIDER, TRAE_CHANNEL_PRIORITY, TRAE_CHECKIN_PATH, TRAE_CN_AGENT_TASK_PATH, TRAE_CN_TITLE_PATH, TRAE_COMMON_FUNCTIONS, TRAE_ENTERPRISE_PROVIDER, TRAE_MODELS_TEST_PATH, TRAE_MODEL_DETAIL_FUNCTIONS, TRAE_MODEL_DETAIL_PATH, TRAE_OFFICIAL_ROSTER_PATH, TRAE_PANELS, TRAE_PAY_BASE, TRAE_PROBE_TIMEOUT_MS, TRAE_PROVIDER, TRAE_PROVIDERS, TRAE_PROVIDER_DISPLAY_NAMES, TRAE_PROVIDER_IDS, TRAE_PROVIDER_ID_DISPLAY_NAMES, TRAE_PROVIDER_ROUTES, 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, type TraeFailure, TraeFallbackUpstreamClient, type TraeFallbackUpstreamOptions, type TraeFusionRawChatEnvelope, TraeGatedUpstreamClient, type TraeGatedUpstreamOptions, type TraeIdentity, type TraeInputModality, type TraeModelDetailRequest, type TraeModelGroup, type TraeModelInfo, type TraeModelProbeVerdict, type TraeModelView, type TraeModelsTestResponse, type TraeObservedModelConfig, type TraeOfficialChannel, type TraeOfficialFilterResult, type TraeOfficialRoster, TraeOfficialRosterClient, type TraeOfficialVerdict, type TraeOrderableModel, type TraePanel, type TraeProbeResult, type TraeProbeVerdict, type TraeProviderRoute, 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 TraeWebCheckin, type TraeWebCheckinClaim, type TraeWebCredits, type TraeWebUsage, type TraeWireModel, type TraeWireTarget, UnconfiguredTraeUpstreamClient, adaptLegacyPiAiContext, adaptModernPiAiContext, apply, applyContextBudgets, applyImageSelection, applyOfficialRoster, applyReasoningEffort, asVolatile, bridgeTraeSoloStream, buildTraeAgentTaskBody, buildTraeCnHeaders, buildTraeFusionRawChatEnvelope, buildTraeModelDetailRequest, buildTraeRawChatDraft, buildTraeRawChatRuntimeConfig, classifyProbeError, classifyProbeResult, classifyTraeRawChatFailure, configuredAccountsOf, createTraeAdapter, createTraeRawGateway, createTraeShim, creditPosition, decidePiAiGeneration, decodeRawChatChunk, decodeTraeEvent, decryptTraeStorageValue, deriveCatalog, describeIdShape, describeNameShape, describeTraeFailure, discoveredCatalog, displayNameOfTraeProvider, fallbackModelsFor, filterTraeModels, generationOf, groupTraeModels, hashTraeRawChatArg, identityHeaders, inject, isEnterpriseAccount, isPromotableWireModel, legacyTraeOwnAuthPath, maskUserPath, mergeTraeModelSources, name, nextRegionCreditPosition, nextRegionEnabled, nextRegionSlots, normalizeTraeCredential, normalizeTraeToolSchema, normalizeTraeToolSchemas, normalizeTraeVersionCode, officialVerdictOf, orderTraeModels, panelOfKey, panelOfProvider, parseObservedModelConfig, parseReasoningCapability, parseTraeAuthValue, parseTraeCachedModel, parseTraeModelExtraConfigLogLine, parseTraeOfficialRoster, parseTraeRawChatBehaviorConfig, parseTraeRemoteModel, parseTraeStorageDocument, piAiRuntimeInfo, pickTraeStorageIdentity, prepareSoloBody, probeBody, probeModelsSequentially, probeOneModel, probeTraeRawChatCapability, providerOfPanel, rawCapabilityDiagnostic, rawCapabilityFingerprint, readTraeCachedModel, readTraeCliIdentity, readTraeIdentity, refreshTraeCredential, regionCreditPositionOf, regionEnabled, regionEnabledOf, regionOfCredential, regionOfEdition, regionOfHost, regionOfPanel, regionOfTraeProvider, regionOfTraeStatusUrl, regionOfUserRegion, regionStateOf, registerTraeUsageRoute, resolveTraeIdentity, resolveTraeRawRuntime, routeOfTraeProvider, sanitizeCatalog, scopeTraeModels, settingsNamespaceOf, traeEndpoint, traeInputModalities, traeModelCallChannel, traeModelDisplayName, traeModelInView, traeModelMatchesQuery, traeOwnAuthPath, traeRawChatExtraInfo, traeStateDatabaseCandidates, traeStorageCandidates, traeWebUsage, traeWindowsAppNames, unwrapVolatile, unwrapVolatileDeep, wireTargetsOf, withChatCallableFunctions, withContextAdaptation, withTraeRegion };
|