dsh-connect-trae 2.2.0 → 2.3.1
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 +116 -2
- package/README.en.md +66 -18
- package/README.md +66 -18
- package/icons/dsh-connect-trae-128.png +0 -0
- package/icons/dsh-connect-trae-64.png +0 -0
- package/lib/client.js +124 -37
- package/lib/index.d.ts +210 -34
- package/lib/index.js +280 -62
- package/package.json +29 -26
- package/scripts/verify-windows.mjs +311 -0
package/lib/client.js
CHANGED
|
@@ -165,10 +165,8 @@ window.__ModuleLoader__.load({
|
|
|
165
165
|
.dsm-plugin-card-head{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}
|
|
166
166
|
.dsm-plugin-card-title{color:var(--dsw-alias-label-primary,#e6e6e6);font-size:15px;font-weight:600;line-height:1.4}
|
|
167
167
|
.dsm-plugin-card-description{color:var(--dsw-alias-label-tertiary,#999);font-size:13px;line-height:1.5}
|
|
168
|
-
/* Pure-CSS caret: the host primitives' chevron icon names
|
|
169
|
-
|
|
170
|
-
so no static import can serve both — importing the 0.1.5 name makes the
|
|
171
|
-
client bundle fail to resolve on 0.1.7, taking the whole card down. A border
|
|
168
|
+
/* Pure-CSS caret: the host primitives' chevron icon names are not part of any
|
|
169
|
+
stable contract across DSH releases, so no static import is used — a border
|
|
172
170
|
caret in the plugin's own CSS is version-proof. */
|
|
173
171
|
.dsm-plugin-card-chevron{color:var(--dsw-alias-label-tertiary,#999);flex:none;width:16px;height:16px;position:relative;transition:transform .16s}
|
|
174
172
|
.dsm-plugin-card-chevron::before{content:"";display:block;position:absolute;left:4px;top:5px;width:7px;height:7px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(45deg)}
|
|
@@ -267,6 +265,10 @@ window.__ModuleLoader__.load({
|
|
|
267
265
|
.dsm-trae-checkin-label{color:var(--dsw-alias-label-primary,#e6e6e6);font-size:13px;line-height:18px;font-weight:600}
|
|
268
266
|
.dsm-trae-checkin-hint{color:var(--dsw-alias-label-tertiary,#9aa0a8);font-size:12px;line-height:17px}
|
|
269
267
|
.dsm-trae-checkin-button{flex:none}
|
|
268
|
+
/* The "this machine already used today's check-in" note is INFORMATIONAL, not
|
|
269
|
+
an error: it is Trae's one-per-device-per-day rule, and the day is simply
|
|
270
|
+
spent. Rendering it in the error colour would read as a plugin fault. */
|
|
271
|
+
.dsm-trae-checkin-note{margin:8px 0 0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#c6c9d0)}
|
|
270
272
|
`;
|
|
271
273
|
//#endregion
|
|
272
274
|
//#region src/client/TraeUsageCard.tsx
|
|
@@ -295,11 +297,11 @@ window.__ModuleLoader__.load({
|
|
|
295
297
|
/**
|
|
296
298
|
* Write one settings field and confirm the value actually landed.
|
|
297
299
|
*
|
|
298
|
-
* `
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
300
|
+
* `configForms.set()` resolving is NOT proof that anything was stored: a write
|
|
301
|
+
* can be accepted by the transport and still not materialize — a rejected
|
|
302
|
+
* write reloads Host state and merely RETURNS, so the caller's `await`
|
|
303
|
+
* succeeds while the document is unchanged. The form answers with an explicit
|
|
304
|
+
* boolean for exactly this reason.
|
|
303
305
|
*
|
|
304
306
|
* Either way the caller must not report success on an unpersisted write: the
|
|
305
307
|
* user would see the control flip and then silently revert.
|
|
@@ -391,6 +393,14 @@ window.__ModuleLoader__.load({
|
|
|
391
393
|
/** Last claim refusal, shown until the next successful refresh. */
|
|
392
394
|
const [claimError, setClaimError] = (0, react.useState)(void 0);
|
|
393
395
|
/**
|
|
396
|
+
* Whether this MACHINE has spent today's check-in while the selected account
|
|
397
|
+
* has not been paid — the "switched account" state. Kept separate from
|
|
398
|
+
* `claimError` because it is not a failure: it is the upstream's one-per-
|
|
399
|
+
* device-per-day rule, and rendering it through the "签到失败:…" line would
|
|
400
|
+
* present a normal rule as a plugin fault.
|
|
401
|
+
*/
|
|
402
|
+
const [deviceSpentNotice, setDeviceSpentNotice] = (0, react.useState)(false);
|
|
403
|
+
/**
|
|
394
404
|
* A refused or unpersisted settings write, surfaced instead of silently
|
|
395
405
|
* reverting. On 0.1.7 a rejected write resolves normally, so without this
|
|
396
406
|
* the control would flip and then quietly snap back on the next snapshot.
|
|
@@ -471,6 +481,7 @@ window.__ModuleLoader__.load({
|
|
|
471
481
|
*/
|
|
472
482
|
(0, react.useEffect)(() => {
|
|
473
483
|
setClaimError(void 0);
|
|
484
|
+
setDeviceSpentNotice(false);
|
|
474
485
|
}, [activeRegion]);
|
|
475
486
|
(0, react.useEffect)(() => {
|
|
476
487
|
if (!open || !activeRegionOn || status.status !== "signed-in") return;
|
|
@@ -538,13 +549,21 @@ window.__ModuleLoader__.load({
|
|
|
538
549
|
* (it stops an obviously pointless click), not the protection.
|
|
539
550
|
*
|
|
540
551
|
* A refusal is not thrown away: the route answers `claimed: false` with the
|
|
541
|
-
* upstream's business code and message, and the card shows it.
|
|
542
|
-
*
|
|
543
|
-
*
|
|
552
|
+
* upstream's business code and message, and the card shows it. Three answers
|
|
553
|
+
* are distinguished rather than collapsed into "failed":
|
|
554
|
+
*
|
|
555
|
+
* - `alreadyCheckedIn` — this ACCOUNT was already paid today; show it as
|
|
556
|
+
* claimed and refresh, never as an error.
|
|
557
|
+
* - `deviceCheckedIn` (code 9095) — this MACHINE already spent today's
|
|
558
|
+
* check-in, so this account cannot claim here today. That is the normal
|
|
559
|
+
* outcome after switching accounts, and saying "check-in failed" would
|
|
560
|
+
* blame the plugin for an upstream rule.
|
|
561
|
+
* - anything else — a real refusal, reported verbatim.
|
|
544
562
|
*/
|
|
545
563
|
const claimCheckin = async () => {
|
|
546
564
|
setClaiming(true);
|
|
547
565
|
setClaimError(void 0);
|
|
566
|
+
setDeviceSpentNotice(false);
|
|
548
567
|
try {
|
|
549
568
|
const response = await fetch(withTraeRegion(TRAE_CHECKIN_PATH, activeRegion), {
|
|
550
569
|
method: "POST",
|
|
@@ -553,6 +572,11 @@ window.__ModuleLoader__.load({
|
|
|
553
572
|
});
|
|
554
573
|
const body = await response.json().catch(() => void 0);
|
|
555
574
|
if (!response.ok) throw new Error(body?.error ?? `HTTP ${response.status}`);
|
|
575
|
+
if (body?.claimed === false && body.deviceCheckedIn === true) {
|
|
576
|
+
await refreshUsage(activeRegion);
|
|
577
|
+
if (mounted.current) setDeviceSpentNotice(true);
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
556
580
|
if (body?.claimed === false && body.alreadyCheckedIn !== true) throw new Error(body.message === void 0 || body.message === "" ? t("row.checkinRefused", { code: String(body.code ?? "") }) : `${t("row.checkinRefused", { code: String(body.code ?? "") })}: ${body.message}`);
|
|
557
581
|
await refreshUsage(activeRegion);
|
|
558
582
|
} catch (error) {
|
|
@@ -957,10 +981,11 @@ window.__ModuleLoader__.load({
|
|
|
957
981
|
children: t("row.creditsError", { message: status.creditsError })
|
|
958
982
|
}),
|
|
959
983
|
status.checkin === void 0 ? null : (() => {
|
|
960
|
-
const
|
|
984
|
+
const accountClaimed = status.checkin.checkedIn;
|
|
985
|
+
const deviceSpent = !accountClaimed && (status.checkin.didCheckedIn || deviceSpentNotice);
|
|
961
986
|
const reward = formatNumber(status.checkin.credits);
|
|
962
987
|
const bonus = status.checkin.extraCredits === void 0 ? "" : ` + ${formatNumber(status.checkin.extraCredits)}`;
|
|
963
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
988
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
964
989
|
className: "dsm-trae-checkin",
|
|
965
990
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
966
991
|
className: "dsm-trae-checkin-copy",
|
|
@@ -969,18 +994,22 @@ window.__ModuleLoader__.load({
|
|
|
969
994
|
children: t("row.checkinLabel")
|
|
970
995
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
971
996
|
className: "dsm-trae-checkin-hint",
|
|
972
|
-
children: [t("row.checkinReward", { reward: `${reward}${bonus}` }),
|
|
997
|
+
children: [t("row.checkinReward", { reward: `${reward}${bonus}` }), accountClaimed ? ` · ${t("row.checkinDoneHint")}` : ""]
|
|
973
998
|
})]
|
|
974
999
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
975
1000
|
type: "button",
|
|
976
1001
|
className: "dsm-btn dsm-btn-primary dsm-trae-checkin-button",
|
|
977
|
-
disabled: !status.checkin.enabled ||
|
|
1002
|
+
disabled: !status.checkin.enabled || accountClaimed || deviceSpent || claiming,
|
|
978
1003
|
onClick: () => {
|
|
979
1004
|
claimCheckin();
|
|
980
1005
|
},
|
|
981
|
-
children: claiming ? t("row.checkinClaiming") :
|
|
1006
|
+
children: claiming ? t("row.checkinClaiming") : accountClaimed ? t("row.checkinClaimed") : t("row.checkinClaim")
|
|
982
1007
|
})]
|
|
983
|
-
})
|
|
1008
|
+
}), deviceSpent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1009
|
+
className: "dsm-trae-checkin-note",
|
|
1010
|
+
role: "status",
|
|
1011
|
+
children: t("row.checkinDeviceSpent")
|
|
1012
|
+
}) : null] });
|
|
984
1013
|
})(),
|
|
985
1014
|
status.checkin !== void 0 && !status.checkin.enabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
986
1015
|
className: "dsm-trae-usage-error",
|
|
@@ -1212,6 +1241,7 @@ window.__ModuleLoader__.load({
|
|
|
1212
1241
|
"row.checkinDoneHint": "come back tomorrow",
|
|
1213
1242
|
"row.checkinRefused": "Trae refused the check-in (code {code})",
|
|
1214
1243
|
"row.checkinError": "Check-in failed: {message}",
|
|
1244
|
+
"row.checkinDeviceSpent": "This machine already used today's check-in — Trae allows one per device per day, so this account cannot claim here today. Claim it on another device or from the account that checked in, or come back tomorrow.",
|
|
1215
1245
|
"row.checkinDisabled": "This account has no check-in activity available.",
|
|
1216
1246
|
"row.regionCn": "CN",
|
|
1217
1247
|
"row.regionAi": "International",
|
|
@@ -1290,6 +1320,7 @@ window.__ModuleLoader__.load({
|
|
|
1290
1320
|
"row.checkinDoneHint": "明天再来",
|
|
1291
1321
|
"row.checkinRefused": "Trae 拒绝了本次签到(业务码 {code})",
|
|
1292
1322
|
"row.checkinError": "签到失败:{message}",
|
|
1323
|
+
"row.checkinDeviceSpent": "本机今日的签到已用掉——Trae 按「每台设备每天一次」限制,所以当前账号在本机今天无法再签。可换一台设备领取,或用今天已签到的那台设备/账号,或明天再来。",
|
|
1293
1324
|
"row.checkinDisabled": "该账号当前没有可用的签到活动。",
|
|
1294
1325
|
"row.regionCn": "国内版",
|
|
1295
1326
|
"row.regionAi": "国际版",
|
|
@@ -1332,12 +1363,11 @@ window.__ModuleLoader__.load({
|
|
|
1332
1363
|
/**
|
|
1333
1364
|
* Client services required by the Plugin configuration contribution.
|
|
1334
1365
|
*
|
|
1335
|
-
* Deliberately only the two services
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1339
|
-
*
|
|
1340
|
-
* for an absent service) is what lets one build serve both lines.
|
|
1366
|
+
* Deliberately only the two services the 0.1.7 line provides unconditionally:
|
|
1367
|
+
* `slots` (card injection) and `locale` (copy). The settings surface is probed
|
|
1368
|
+
* through `ctx.get()` (which returns undefined, never throws, for an absent
|
|
1369
|
+
* service), so the card degrades to read-only rather than failing to load if
|
|
1370
|
+
* configForms is not served yet.
|
|
1341
1371
|
*/
|
|
1342
1372
|
const inject = ["slots", "locale"];
|
|
1343
1373
|
/**
|
|
@@ -1364,27 +1394,85 @@ window.__ModuleLoader__.load({
|
|
|
1364
1394
|
}), "dsh-connect-trae: settings copy");
|
|
1365
1395
|
const t = ctx.locale.bind(namespace);
|
|
1366
1396
|
const softGet = (name) => ctx.get(name);
|
|
1367
|
-
let settingsScope;
|
|
1368
1397
|
const forms = softGet("configForms");
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1398
|
+
/**
|
|
1399
|
+
* The card's settings scope, bound to whichever namespace the Host actually
|
|
1400
|
+
* serves — resolved from the describe mirror, and RE-BOUND whenever the
|
|
1401
|
+
* mirror changes.
|
|
1402
|
+
*
|
|
1403
|
+
* The mirror answers asynchronously relative to this plugin's `apply()`
|
|
1404
|
+
* (and, on a profile reload, may gain namespaces that did not exist at
|
|
1405
|
+
* boot — this plugin's entry is exactly such a case). Resolving the
|
|
1406
|
+
* namespace ONCE at apply time and falling back to the declared constant
|
|
1407
|
+
* is a real failure: the form controller is bound to its namespace forever,
|
|
1408
|
+
* so a card whose entry appeared after the mirror's first load writes to
|
|
1409
|
+
* `trae` — a namespace the host does not serve — and every write is
|
|
1410
|
+
* refused (`No configurable plugin entry "trae"`), while the controls stay
|
|
1411
|
+
* enabled (the mirror reports global `writable` even when the namespace is
|
|
1412
|
+
* missing).
|
|
1413
|
+
*
|
|
1414
|
+
* The scope therefore forwards every read/write to the CURRENT controller:
|
|
1415
|
+
* once the mirror lists the trae namespace (any name matching `/trae/i`,
|
|
1416
|
+
* e.g. `dsh-connect-trae` or `include:dsh-connect-trae`), the card lands on
|
|
1417
|
+
* the right namespace and re-renders through its own subscription. Before
|
|
1418
|
+
* the mirror answers, the scope reports `writable: false` so the card is
|
|
1419
|
+
* read-only rather than offering controls that cannot save.
|
|
1420
|
+
*/
|
|
1421
|
+
const settingsScope = (() => {
|
|
1422
|
+
let current;
|
|
1423
|
+
let currentOff;
|
|
1424
|
+
let refreshedOnce = false;
|
|
1425
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1426
|
+
const notify = () => {
|
|
1427
|
+
for (const listener of [...listeners]) listener();
|
|
1428
|
+
};
|
|
1429
|
+
const scope = {
|
|
1430
|
+
getSnapshot: () => current?.getSnapshot() ?? {
|
|
1431
|
+
status: "unavailable",
|
|
1432
|
+
value: void 0,
|
|
1433
|
+
writable: false
|
|
1434
|
+
},
|
|
1435
|
+
subscribe: (listener) => {
|
|
1436
|
+
listeners.add(listener);
|
|
1437
|
+
return () => {
|
|
1438
|
+
listeners.delete(listener);
|
|
1439
|
+
};
|
|
1440
|
+
},
|
|
1441
|
+
set: (field, value) => current !== void 0 ? current.set(field, value) : Promise.resolve(false)
|
|
1442
|
+
};
|
|
1443
|
+
const rebind = () => {
|
|
1444
|
+
let served;
|
|
1445
|
+
try {
|
|
1446
|
+
served = (forms?.describe().getSnapshot().view?.namespaces ?? []).find((entry) => entry.ns === "trae" || /trae/i.test(entry.ns));
|
|
1447
|
+
} catch {}
|
|
1448
|
+
const next = served === void 0 || forms === void 0 ? void 0 : forms.get(served.ns);
|
|
1449
|
+
if (next !== current) {
|
|
1450
|
+
currentOff?.();
|
|
1451
|
+
current = next;
|
|
1452
|
+
currentOff = current?.subscribe(notify);
|
|
1453
|
+
notify();
|
|
1454
|
+
}
|
|
1455
|
+
if (next === void 0 && !refreshedOnce) {
|
|
1456
|
+
refreshedOnce = true;
|
|
1457
|
+
try {
|
|
1458
|
+
(forms?.describe()).load?.();
|
|
1459
|
+
} catch {}
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
rebind();
|
|
1463
|
+
forms?.describe().subscribe?.(rebind);
|
|
1464
|
+
return scope;
|
|
1465
|
+
})();
|
|
1378
1466
|
const registerCard = (slotName, key) => {
|
|
1379
1467
|
try {
|
|
1380
1468
|
ctx.slots.inject(slotName, () => ctx.slots.register({
|
|
1381
1469
|
name: slotName,
|
|
1382
1470
|
key,
|
|
1383
1471
|
priority: 30,
|
|
1384
|
-
inject: () =>
|
|
1472
|
+
inject: () => ({
|
|
1385
1473
|
t,
|
|
1386
1474
|
settingsScope
|
|
1387
|
-
}
|
|
1475
|
+
})
|
|
1388
1476
|
}, TraeUsageCard));
|
|
1389
1477
|
} catch (error) {
|
|
1390
1478
|
console.error(`[dsh-connect-trae] card slot "${slotName}" failed to register (host provider unaffected):`, error);
|
|
@@ -1392,7 +1480,6 @@ window.__ModuleLoader__.load({
|
|
|
1392
1480
|
};
|
|
1393
1481
|
registerCard("plugins.bundle.config", "dsh-connect-trae");
|
|
1394
1482
|
registerCard("plugins.row.config", "dsh-connect-trae#dsh-connect-trae");
|
|
1395
|
-
registerCard("settings.plugin.item", "trae");
|
|
1396
1483
|
} catch (error) {
|
|
1397
1484
|
console.error("[dsh-connect-trae] client card failed to load (host provider unaffected):", error);
|
|
1398
1485
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -46,6 +46,15 @@ interface TraeStorageCandidate {
|
|
|
46
46
|
path: string;
|
|
47
47
|
source: TraeCredentialSource;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* One edition's plausible Windows directory spellings, in probe order.
|
|
51
|
+
*
|
|
52
|
+
* Exported so the identity reader and the credential scanner probe the SAME
|
|
53
|
+
* names: the two resolve different files (the install's `product.json` vs the
|
|
54
|
+
* per-user `storage.json`) but they describe one installation, and a spelling
|
|
55
|
+
* that works for one but not the other is a bug rather than a preference.
|
|
56
|
+
*/
|
|
57
|
+
declare function traeWindowsAppNames(edition: TraeEdition): readonly string[];
|
|
49
58
|
declare function traeStorageCandidates(platform?: NodeJS.Platform, home?: string, env?: NodeJS.ProcessEnv): TraeStorageCandidate[];
|
|
50
59
|
//#endregion
|
|
51
60
|
//#region src/region.d.ts
|
|
@@ -175,6 +184,13 @@ interface TraeWireModel {
|
|
|
175
184
|
contextWindow?: number;
|
|
176
185
|
maxTokens?: number;
|
|
177
186
|
reasoning?: TraeReasoningCapability;
|
|
187
|
+
/**
|
|
188
|
+
* Effective (post-discount) credit multiplier, read from the row's
|
|
189
|
+
* `display_contact_config` — the figure the Trae IDE renders (see
|
|
190
|
+
* `wireCreditMultiplier` in solo.ts). Wins over the Remote directory's own
|
|
191
|
+
* `consumption_rate`, which reports the undiscounted value.
|
|
192
|
+
*/
|
|
193
|
+
creditMultiplier?: number;
|
|
178
194
|
/**
|
|
179
195
|
* The `get_detail_param` function this config_name came from. Trae splits its
|
|
180
196
|
* callable roster across several functions (SOLO modes), and a model is only
|
|
@@ -191,12 +207,19 @@ interface TraeWireModel {
|
|
|
191
207
|
* skeleton: it supplies the display id, display name, context windows, credit
|
|
192
208
|
* multiplier, reasoning and multimodal flags. `wire` (from `get_detail_param`)
|
|
193
209
|
* supplies the real `llm_utils_chat` `config_name` — the only id the chat
|
|
194
|
-
* endpoint actually accepts
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
210
|
+
* endpoint actually accepts — plus the authoritative post-discount credit
|
|
211
|
+
* multiplier when `display_contact_config` carries one. A remote row is only
|
|
212
|
+
* callable when it maps to a wire `config_name`, so a remote row with no wire
|
|
213
|
+
* match is DROPPED (it would otherwise be sent as an invalid `config_name` and
|
|
214
|
+
* rejected with 4001 "param is invalid"). Verified 2026-08-30: the Remote
|
|
215
|
+
* directory advertises `Doubao-Seed-Code` and `glm-5.3`, neither of which is a
|
|
216
|
+
* current `config_name`; both fail every request, so they must not be exposed.
|
|
217
|
+
*
|
|
218
|
+
* Credit multiplier precedence: the wire's `display_contact_config` rate wins
|
|
219
|
+
* whenever present (it is the post-discount figure the Trae IDE renders — the
|
|
220
|
+
* Remote directory can report up to 10x the undiscounted value, see
|
|
221
|
+
* `wireCreditMultiplier` in solo.ts); the Remote `consumption_rate` is the
|
|
222
|
+
* fallback when the wire row carries none.
|
|
200
223
|
*
|
|
201
224
|
* Joining is two-tier, in priority order:
|
|
202
225
|
* 1. `wire.id` (the `config_name`) equals the remote id — the model's display
|
|
@@ -562,6 +585,8 @@ interface TraeObservedModelConfig {
|
|
|
562
585
|
declare function parseObservedModelConfig(line: string): TraeObservedModelConfig | undefined;
|
|
563
586
|
//#endregion
|
|
564
587
|
//#region src/model-cache.d.ts
|
|
588
|
+
/** Basename of the SQLite cache sitting beside the credential document. */
|
|
589
|
+
declare const TRAE_STATE_DB_FILENAME = "state.vscdb";
|
|
565
590
|
interface TraeCachedModelConfig {
|
|
566
591
|
name: string;
|
|
567
592
|
customConfig?: Record<string, unknown>;
|
|
@@ -580,11 +605,54 @@ interface TraeCachedModelReadOptions {
|
|
|
580
605
|
home?: string;
|
|
581
606
|
/** Environment override for testing; defaults to process.env. */
|
|
582
607
|
env?: NodeJS.ProcessEnv;
|
|
608
|
+
/**
|
|
609
|
+
* The credential candidate whose account is being read. Supplying it pins the
|
|
610
|
+
* lookup to the installation the credential actually came from, which is the
|
|
611
|
+
* only way to stay correct when several editions are installed: `storage.json`
|
|
612
|
+
* and `state.vscdb` live in the SAME `globalStorage` directory, so the cache
|
|
613
|
+
* belongs to whichever candidate yielded the sign-in.
|
|
614
|
+
*/
|
|
615
|
+
candidate?: TraeStorageCandidate;
|
|
616
|
+
/** Injectable for tests; defaults to node:fs existsSync. */
|
|
617
|
+
exists?: (path: string) => boolean;
|
|
618
|
+
/**
|
|
619
|
+
* Injectable `sqlite3` runner for tests; defaults to promisified `execFile`.
|
|
620
|
+
* Mirrors the `fetchImpl` injection used elsewhere in this plugin, and exists
|
|
621
|
+
* so a test can assert the exact argv — in particular WHICH database path was
|
|
622
|
+
* chosen, which no assertion on the candidate list alone can prove.
|
|
623
|
+
*/
|
|
624
|
+
runSqlite?: (database: string, sql: string) => Promise<{
|
|
625
|
+
stdout: string;
|
|
626
|
+
}>;
|
|
583
627
|
}
|
|
628
|
+
/**
|
|
629
|
+
* The cache paths to try, most-specific first.
|
|
630
|
+
*
|
|
631
|
+
* `state.vscdb` is a SIBLING of the credential document (both sit in
|
|
632
|
+
* `globalStorage`), so a candidate's own path is the authority for its cache —
|
|
633
|
+
* this is why the database is derived from {@link traeStorageCandidates} rather
|
|
634
|
+
* than re-spelled here.
|
|
635
|
+
*
|
|
636
|
+
* It previously hardcoded the single macOS spelling `Trae CN`, which was wrong
|
|
637
|
+
* in two ways on Windows: `paths.ts` probes `Trae CN` AND `trae-cn`, and the
|
|
638
|
+
* edition actually installed is often SOLO (`TRAE SOLO CN`). This module would
|
|
639
|
+
* then point at a directory that does not exist. That went unnoticed only
|
|
640
|
+
* because the Windows `sqlite3` dependency is absent, so the lookup failed and
|
|
641
|
+
* callers fell back — masking the wrong path behind a different error. Sharing
|
|
642
|
+
* one path table means a spelling that works for sign-in also works for the
|
|
643
|
+
* cache.
|
|
644
|
+
*/
|
|
645
|
+
declare function traeStateDatabaseCandidates(options?: TraeCachedModelReadOptions): string[];
|
|
584
646
|
/**
|
|
585
647
|
* Read Trae's own current user's model map via sqlite3 without exposing
|
|
586
648
|
* secrets. The sqlite3 command line is a macOS prerequisite; on Windows it is
|
|
587
649
|
* typically absent, so the call fails and callers fall back gracefully.
|
|
650
|
+
*
|
|
651
|
+
* Every candidate database is tried in order and the first that EXISTS is
|
|
652
|
+
* queried. Existence is checked before spawning because a missing file and a
|
|
653
|
+
* missing `sqlite3` binary are different problems: choosing the wrong directory
|
|
654
|
+
* would otherwise surface as a confusing `sqlite3` failure, hiding a path bug
|
|
655
|
+
* behind a dependency error.
|
|
588
656
|
*/
|
|
589
657
|
declare function readTraeCachedModel(functionName: string, modelName: string, userId: string, options?: TraeCachedModelReadOptions): Promise<TraeCachedModelConfig | undefined>;
|
|
590
658
|
//#endregion
|
|
@@ -620,6 +688,55 @@ interface TraeModelDetailRequest {
|
|
|
620
688
|
/** Build the exact request shape observed in successful current Trae CN logs. */
|
|
621
689
|
declare function buildTraeModelDetailRequest(configName?: string, custom?: boolean): TraeModelDetailRequest;
|
|
622
690
|
//#endregion
|
|
691
|
+
//#region src/redact.d.ts
|
|
692
|
+
/**
|
|
693
|
+
* Redaction helpers for diagnostics that a user may paste into a public issue.
|
|
694
|
+
*
|
|
695
|
+
* A verification report is only useful if it can be shared, and it is only safe
|
|
696
|
+
* to share if it carries no personal identifiers. Paths are the hard case:
|
|
697
|
+
* `C:\Users\<real name>\AppData\Roaming\Trae CN\...` contains both a real
|
|
698
|
+
* account name AND the single most diagnostic token in the whole report (the
|
|
699
|
+
* Trae data directory spelling). Redacting the whole path would make the report
|
|
700
|
+
* worthless; printing it whole would leak the user's name. So the user segment
|
|
701
|
+
* is replaced and the meaningful tail is preserved.
|
|
702
|
+
*
|
|
703
|
+
* @module dsh-connect-trae/redact
|
|
704
|
+
*/
|
|
705
|
+
/**
|
|
706
|
+
* Replace the user segment of a path with `<user>`, keeping the rest intact.
|
|
707
|
+
*
|
|
708
|
+
* Handles the shapes a Trae install can produce:
|
|
709
|
+
* - `C:\Users\<name>\...` and `C:\Documents and Settings\<name>\...` (Windows)
|
|
710
|
+
* - `/Users/<name>/...` and `/home/<name>/...` (macOS / Linux)
|
|
711
|
+
*
|
|
712
|
+
* Anything after that segment — edition directory, `User\globalStorage`,
|
|
713
|
+
* `storage.json` — is preserved verbatim, because that is what a report is
|
|
714
|
+
* actually read for. Cross-platform on purpose: the function is called by
|
|
715
|
+
* Windows-focused diagnostics, but the same helpers run in tests and on other
|
|
716
|
+
* hosts, and a report from the wrong platform must not leak either.
|
|
717
|
+
*/
|
|
718
|
+
declare function maskUserPath(path: string): string;
|
|
719
|
+
/**
|
|
720
|
+
* Describe a name by shape instead of by value: a character count, plus whether
|
|
721
|
+
* it is purely numeric.
|
|
722
|
+
*
|
|
723
|
+
* This is the deliberate middle ground for account names. A Trae account name
|
|
724
|
+
* is often a real name or a phone number, so it must never be printed; but the
|
|
725
|
+
* report still needs to show that an account WAS resolved, and the shape
|
|
726
|
+
* distinguishes a real nickname from a generated `用户<n>` id — which is the
|
|
727
|
+
* only thing a reader needs to judge whether account discovery worked.
|
|
728
|
+
*/
|
|
729
|
+
declare function describeNameShape(name: unknown): string;
|
|
730
|
+
/**
|
|
731
|
+
* Describe an identifier by shape instead of by value.
|
|
732
|
+
*
|
|
733
|
+
* A device id (`x-device-id`) is a stable installation identifier and is
|
|
734
|
+
* directly tied to the upstream's per-device rules, so it is never printed.
|
|
735
|
+
* Its shape still proves which resolution path ran: a real `icube-dc` id is
|
|
736
|
+
* 15 digits, while the fallback is a 32-character hex hash.
|
|
737
|
+
*/
|
|
738
|
+
declare function describeIdShape(value: unknown): string;
|
|
739
|
+
//#endregion
|
|
623
740
|
//#region src/protocol.d.ts
|
|
624
741
|
declare const TRAE_CN_AGENT_TASK_PATH = "/api/agent/v3/create_agent_task";
|
|
625
742
|
declare const TRAE_CN_TITLE_PATH = "/api/agent/v3/llm_utils_chat";
|
|
@@ -1054,6 +1171,8 @@ interface TraeSoloModel {
|
|
|
1054
1171
|
contextWindow?: number;
|
|
1055
1172
|
maxTokens?: number;
|
|
1056
1173
|
reasoning?: TraeReasoningCapability;
|
|
1174
|
+
/** Effective (post-discount) credit multiplier, as the Trae IDE shows it. */
|
|
1175
|
+
creditMultiplier?: number;
|
|
1057
1176
|
/** The directory function that listed this config (replayed when calling it). */
|
|
1058
1177
|
function?: string;
|
|
1059
1178
|
}
|
|
@@ -1223,15 +1342,32 @@ interface TraeUsageSnapshot {
|
|
|
1223
1342
|
packs: TraeUsagePack[];
|
|
1224
1343
|
}
|
|
1225
1344
|
interface TraeCheckinStatus {
|
|
1345
|
+
/**
|
|
1346
|
+
* Whether the account's REWARD PACK for today already exists. This is the
|
|
1347
|
+
* account-wide answer and it is the one that decides whether there is
|
|
1348
|
+
* anything left to claim: a day with `checkedIn: true` has already been paid
|
|
1349
|
+
* out, whichever device produced it.
|
|
1350
|
+
*/
|
|
1226
1351
|
checkedIn: boolean;
|
|
1227
1352
|
/** Reward for one check-in, as reported by the upstream (`credits`). */
|
|
1228
1353
|
credits: number;
|
|
1229
1354
|
enabled: boolean;
|
|
1230
1355
|
/**
|
|
1231
|
-
* Whether
|
|
1232
|
-
*
|
|
1233
|
-
*
|
|
1234
|
-
*
|
|
1356
|
+
* Whether THIS device's claim for today was already recorded. The upstream
|
|
1357
|
+
* keys this on the `x-device-id` the request carries — not on the account —
|
|
1358
|
+
* so it answers `true` for the device that claimed and `false` for the same
|
|
1359
|
+
* account and day read from any other device.
|
|
1360
|
+
*
|
|
1361
|
+
* Measured 2026-09-26 on a live CN account whose claim had succeeded minutes
|
|
1362
|
+
* earlier: `did_checked_in` was `true` with the claiming device id and
|
|
1363
|
+
* `false` with the header omitted, with a synthetic id, and with another
|
|
1364
|
+
* install's id. Repeating the read never flips it, so it is not "have I seen
|
|
1365
|
+
* you before" state either — only an actual claim sets it.
|
|
1366
|
+
*
|
|
1367
|
+
* It is therefore NOT a "today is done" signal on its own (claiming again
|
|
1368
|
+
* answers the upstream's own 9095 "该设备今日已参与签到" refusal); it is
|
|
1369
|
+
* evidence that this exact device is already accounted for, which is what
|
|
1370
|
+
* makes a claim safe to skip.
|
|
1235
1371
|
*/
|
|
1236
1372
|
didCheckedIn: boolean;
|
|
1237
1373
|
/** Bonus credit granted on top of the base reward, when the upstream reports one. */
|
|
@@ -1307,6 +1443,12 @@ declare class TraeUsageClient {
|
|
|
1307
1443
|
/**
|
|
1308
1444
|
* Daily check-in status. Read-only, and answered with or without the device
|
|
1309
1445
|
* header — the claim is what needs it.
|
|
1446
|
+
*
|
|
1447
|
+
* The read DOES carry the header whenever this installation has one, and
|
|
1448
|
+
* that is deliberate rather than incidental: `did_checked_in` is answered
|
|
1449
|
+
* per device, so omitting the header would make a device that already claimed
|
|
1450
|
+
* today look identical to one that never has (measured 2026-09-26, see
|
|
1451
|
+
* {@link TraeCheckinStatus.didCheckedIn}).
|
|
1310
1452
|
*/
|
|
1311
1453
|
checkinStatus(signal?: AbortSignal): Promise<TraeCheckinStatus>;
|
|
1312
1454
|
/**
|
|
@@ -1386,11 +1528,22 @@ interface TraeWebModel {
|
|
|
1386
1528
|
/**
|
|
1387
1529
|
* Daily check-in state rendered below the credit stats.
|
|
1388
1530
|
*
|
|
1389
|
-
*
|
|
1390
|
-
*
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
1393
|
-
*
|
|
1531
|
+
* The two booleans answer DIFFERENT questions and must never be collapsed into
|
|
1532
|
+
* one "done" flag — doing that was a shipped bug (see CHANGELOG 2.3.1):
|
|
1533
|
+
*
|
|
1534
|
+
* - `checkedIn` is ACCOUNT-level: today's reward pack exists for this account,
|
|
1535
|
+
* so there is nothing left to claim and the balance already includes it.
|
|
1536
|
+
* - `didCheckedIn` is DEVICE-level: this MACHINE already spent its one
|
|
1537
|
+
* check-in for the day, whichever account spent it. The upstream keys it on
|
|
1538
|
+
* the `x-device-id` in the request and answers it per device, not per
|
|
1539
|
+
* account (measured 2026-09-26: the same account and Beijing day answered
|
|
1540
|
+
* `false` with the header omitted, with a synthetic id, and with another
|
|
1541
|
+
* install's id, and `true` for the device that actually claimed).
|
|
1542
|
+
*
|
|
1543
|
+
* So `didCheckedIn && !checkedIn` is the "switched account" case: the device's
|
|
1544
|
+
* daily check-in is used up, but THIS account was never rewarded. Claiming
|
|
1545
|
+
* again is refused upstream (business code 9095, "该设备今日已参与签到"), so
|
|
1546
|
+
* the card disables the button — but it must say that, not "claimed today".
|
|
1394
1547
|
*/
|
|
1395
1548
|
interface TraeWebCheckin {
|
|
1396
1549
|
checkedIn: boolean;
|
|
@@ -1403,8 +1556,19 @@ interface TraeWebCheckin {
|
|
|
1403
1556
|
interface TraeWebCheckinClaim {
|
|
1404
1557
|
/** False when the upstream answered a non-zero business code (e.g. 9004). */
|
|
1405
1558
|
claimed: boolean;
|
|
1406
|
-
/**
|
|
1559
|
+
/**
|
|
1560
|
+
* True only when THIS ACCOUNT's reward for today already exists, so nothing
|
|
1561
|
+
* was sent upstream. Distinct from {@link TraeWebCheckinClaim.deviceCheckedIn}:
|
|
1562
|
+
* a device that already claimed for another account leaves this false.
|
|
1563
|
+
*/
|
|
1407
1564
|
alreadyCheckedIn: boolean;
|
|
1565
|
+
/**
|
|
1566
|
+
* True when today's check-in was already spent on this DEVICE (by this or
|
|
1567
|
+
* another account), so no claim was sent or the upstream refused it with
|
|
1568
|
+
* 9095. Not an error: it is the truthful answer to "can this account claim
|
|
1569
|
+
* here today?" — no, and the reason is the machine, not the account.
|
|
1570
|
+
*/
|
|
1571
|
+
deviceCheckedIn?: boolean;
|
|
1408
1572
|
code?: number;
|
|
1409
1573
|
message?: string;
|
|
1410
1574
|
/** The refreshed check-in state, present whenever the claim path ran. */
|
|
@@ -1598,13 +1762,30 @@ declare const name = "dsh-connect-trae";
|
|
|
1598
1762
|
declare const inject: string[];
|
|
1599
1763
|
/**
|
|
1600
1764
|
* Settings namespace, as a plain lowercase literal. DSH 0.1.2 removed the
|
|
1601
|
-
* `settingsNamespace` brand constructor from the npm package
|
|
1602
|
-
*
|
|
1603
|
-
*
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1765
|
+
* `settingsNamespace` brand constructor from the npm package, and every
|
|
1766
|
+
* consumer of this constant takes it as a kebab string — so no branding is
|
|
1767
|
+
* needed. It is the FALLBACK namespace; the namespace the host actually serves
|
|
1768
|
+
* comes from {@link settingsNamespaceOf} (0.1.7 keys settings by the Loader
|
|
1769
|
+
* entry id, which a profile patch may mount as `dsh-connect-trae` or
|
|
1770
|
+
* `include:dsh-connect-trae`).
|
|
1606
1771
|
*/
|
|
1607
1772
|
declare const TRAE_SETTINGS_NS = "trae";
|
|
1773
|
+
/**
|
|
1774
|
+
* The namespace the HOST actually serves this plugin under.
|
|
1775
|
+
*
|
|
1776
|
+
* On DSH 0.1.7 `SettingsForms.describe()` keys every namespace by the Loader
|
|
1777
|
+
* entry id, and the harness looks a provider's namespace up by EXACT match —
|
|
1778
|
+
* advertising `trae` while the host serves `include:dsh-connect-trae` made the
|
|
1779
|
+
* provider read as "not configured": its configure affordance and model
|
|
1780
|
+
* discovery both silently went dead.
|
|
1781
|
+
*
|
|
1782
|
+
* `ctx.fiber.entry` is added by the Loader, not by Cordis itself, so it is not
|
|
1783
|
+
* in Cordis's public types and is absent on hosts that mount a plugin without a
|
|
1784
|
+
* Loader entry (a test harness, or `ctx.plugin()` called directly). Hence the
|
|
1785
|
+
* probe plus the documented fallback, mirroring the first-party plugins:
|
|
1786
|
+
* `const settingsNs = ctx.fiber.entry?.options.id ?? NS`.
|
|
1787
|
+
*/
|
|
1788
|
+
declare function settingsNamespaceOf(ctx: unknown): string;
|
|
1608
1789
|
/** One region's saved model state: its own directory and the user's selection within it. */
|
|
1609
1790
|
interface TraeRegionState {
|
|
1610
1791
|
/**
|
|
@@ -1681,26 +1862,21 @@ declare function regionStateOf(config: Config, region: TraeRegion): TraeRegionSt
|
|
|
1681
1862
|
*/
|
|
1682
1863
|
declare function regionEnabled(config: Config, region: TraeRegion): boolean;
|
|
1683
1864
|
/**
|
|
1684
|
-
* Mark a schema's field as volatile
|
|
1865
|
+
* Mark a schema's field as volatile.
|
|
1685
1866
|
*
|
|
1686
|
-
* `volatile()` exists from schemastery 3.18.3
|
|
1687
|
-
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1690
|
-
* bypass schemastery's own `validateVolatileSchema`
|
|
1691
|
-
*
|
|
1692
|
-
* no-op.
|
|
1867
|
+
* `volatile()` exists from schemastery 3.18.3; since 2.3.0 the peer range
|
|
1868
|
+
* requires `>=3.18.4`, so it is always present on a supported host. The probe
|
|
1869
|
+
* is kept as a safety net for a consumer that resolves an older schemastery
|
|
1870
|
+
* anyway (where the helper must degrade to identity — hand-writing
|
|
1871
|
+
* `meta.volatile = true` would bypass schemastery's own `validateVolatileSchema`
|
|
1872
|
+
* checks) and to keep both arms deterministically testable.
|
|
1693
1873
|
*
|
|
1694
1874
|
* Without the marker, 0.1.7's settings write gate REJECTS every write with
|
|
1695
1875
|
* `Plugin entry "trae" has no volatile fields` while the scope's `set()` still
|
|
1696
1876
|
* resolves — so the card would look like it saved and silently revert.
|
|
1697
|
-
*
|
|
1698
|
-
* Exported so BOTH arms are testable on any machine: the capability is decided
|
|
1699
|
-
* by whichever schemastery the dependency tree resolves, so without a seam the
|
|
1700
|
-
* no-op arm would silently stop being exercised the moment the pin moved up.
|
|
1701
1877
|
*/
|
|
1702
1878
|
declare function asVolatile<S>(schema: S): S;
|
|
1703
1879
|
declare const Config: z<Config>;
|
|
1704
1880
|
declare function apply(ctx: Context, config: Config): void;
|
|
1705
1881
|
//#endregion
|
|
1706
|
-
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_MODEL_DETAIL_FUNCTIONS, TRAE_MODEL_DETAIL_PATH, TRAE_PAY_BASE, 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_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 TraeObservedModelConfig, 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, classifyTraeRawChatFailure, createTraeAdapter, createTraeRawGateway, createTraeShim, decodeRawChatChunk, decodeTraeEvent, decryptTraeStorageValue, deriveCatalog, discoveredCatalog, fallbackModelsFor, hashTraeRawChatArg, identityHeaders, inject, legacyTraeOwnAuthPath, mergeTraeModelSources, name, nextRegionEnabled, nextRegionSlots, normalizeTraeCredential, normalizeTraeVersionCode, parseObservedModelConfig, parseReasoningCapability, parseTraeAuthValue, parseTraeCachedModel, parseTraeModelExtraConfigLogLine, parseTraeRawChatBehaviorConfig, parseTraeRemoteModel, parseTraeStorageDocument, pickTraeStorageIdentity, prepareSoloBody, probeTraeRawChatCapability, rawCapabilityDiagnostic, rawCapabilityFingerprint, readTraeCachedModel, readTraeCliIdentity, readTraeIdentity, refreshTraeCredential, regionEnabled, regionEnabledOf, regionOfCredential, regionOfEdition, regionOfHost, regionOfTraeProvider, regionOfTraeStatusUrl, regionOfUserRegion, regionStateOf, registerTraeUsageRoute, resolveTraeIdentity, resolveTraeRawRuntime, sanitizeCatalog, traeEndpoint, traeInputModalities, traeModelDisplayName, traeOwnAuthPath, traeRawChatExtraInfo, traeStorageCandidates, traeWebUsage, unwrapVolatile, unwrapVolatileDeep, withTraeRegion };
|
|
1882
|
+
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_MODEL_DETAIL_FUNCTIONS, TRAE_MODEL_DETAIL_PATH, TRAE_PAY_BASE, 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 TraeObservedModelConfig, 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, 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, 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 };
|