@adhdev/mesh-shared 1.0.78 → 1.0.79-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -1
- package/dist/node-facts.d.ts +22 -0
- package/package.json +1 -1
- package/src/node-facts.ts +47 -0
package/dist/index.mjs
CHANGED
|
@@ -278,6 +278,27 @@ function formatQuotaAccount(quota) {
|
|
|
278
278
|
const parts = [email, plan].filter(Boolean);
|
|
279
279
|
return parts.length > 0 ? parts.join(" \xB7 ") : null;
|
|
280
280
|
}
|
|
281
|
+
var BUILTIN_PROVIDER_PREFERENCE = ["claude-cli", "codex-cli", "gemini-cli"];
|
|
282
|
+
function orderProvidersByBuiltinPreference(types) {
|
|
283
|
+
const unique = [...new Set(types.map((t) => typeof t === "string" ? t.trim() : "").filter(Boolean))];
|
|
284
|
+
const rank = (t) => {
|
|
285
|
+
const i = BUILTIN_PROVIDER_PREFERENCE.indexOf(t);
|
|
286
|
+
return i < 0 ? BUILTIN_PROVIDER_PREFERENCE.length : i;
|
|
287
|
+
};
|
|
288
|
+
return unique.sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));
|
|
289
|
+
}
|
|
290
|
+
function defaultProviderPriorityFromNodeFacts(facts) {
|
|
291
|
+
const f = facts && typeof facts === "object" && !Array.isArray(facts) ? facts : null;
|
|
292
|
+
const enablement = f?.providerEnablement;
|
|
293
|
+
if (!enablement || typeof enablement !== "object" || Array.isArray(enablement)) return [];
|
|
294
|
+
const enabled = Object.entries(enablement).filter(([, v]) => !!v && typeof v === "object" && v.enabled === true).map(([type]) => type);
|
|
295
|
+
const versions = f?.providerVersions;
|
|
296
|
+
const detected = versions && typeof versions === "object" && !Array.isArray(versions) ? enabled.filter((type) => {
|
|
297
|
+
const v = versions[type];
|
|
298
|
+
return typeof v === "string" && !!v.trim();
|
|
299
|
+
}) : [];
|
|
300
|
+
return orderProvidersByBuiltinPreference(detected.length ? detected : enabled);
|
|
301
|
+
}
|
|
281
302
|
|
|
282
303
|
// src/workspace-normalize.ts
|
|
283
304
|
function normalizeMeshWorkspaceForCompare(dir) {
|
|
@@ -3381,6 +3402,7 @@ export {
|
|
|
3381
3402
|
ASSISTANT_TOOL_VERBS,
|
|
3382
3403
|
ASSISTANT_VERB,
|
|
3383
3404
|
ASSISTANT_WRITE_TOOLS,
|
|
3405
|
+
BUILTIN_PROVIDER_PREFERENCE,
|
|
3384
3406
|
CANCEL_REASONS,
|
|
3385
3407
|
CANONICAL_MESH_TOOL_COUNT,
|
|
3386
3408
|
CANONICAL_MESH_TOOL_NAMES,
|
|
@@ -3562,6 +3584,7 @@ export {
|
|
|
3562
3584
|
decodeTypeField,
|
|
3563
3585
|
decodeUserSessionToDashboard,
|
|
3564
3586
|
decodeViewerToSharedSession,
|
|
3587
|
+
defaultProviderPriorityFromNodeFacts,
|
|
3565
3588
|
deriveProviderPriorityFromSlots,
|
|
3566
3589
|
deriveSlotsFromLegacy,
|
|
3567
3590
|
describeModelSelection,
|
|
@@ -3668,6 +3691,7 @@ export {
|
|
|
3668
3691
|
normalizeOwnedPaths,
|
|
3669
3692
|
normalizeSessionStatus,
|
|
3670
3693
|
normalizeThinkingLevel,
|
|
3694
|
+
orderProvidersByBuiltinPreference,
|
|
3671
3695
|
parseJsonRecord,
|
|
3672
3696
|
parseSemver,
|
|
3673
3697
|
parseSessionLaunchRecord,
|