@adhdev/mesh-shared 1.0.78 → 1.0.79-rc.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/dist/index.js CHANGED
@@ -28,6 +28,7 @@ __export(index_exports, {
28
28
  ASSISTANT_TOOL_VERBS: () => ASSISTANT_TOOL_VERBS,
29
29
  ASSISTANT_VERB: () => ASSISTANT_VERB,
30
30
  ASSISTANT_WRITE_TOOLS: () => ASSISTANT_WRITE_TOOLS,
31
+ BUILTIN_PROVIDER_PREFERENCE: () => BUILTIN_PROVIDER_PREFERENCE,
31
32
  CANCEL_REASONS: () => CANCEL_REASONS,
32
33
  CANONICAL_MESH_TOOL_COUNT: () => CANONICAL_MESH_TOOL_COUNT,
33
34
  CANONICAL_MESH_TOOL_NAMES: () => CANONICAL_MESH_TOOL_NAMES,
@@ -209,6 +210,7 @@ __export(index_exports, {
209
210
  decodeTypeField: () => decodeTypeField,
210
211
  decodeUserSessionToDashboard: () => decodeUserSessionToDashboard,
211
212
  decodeViewerToSharedSession: () => decodeViewerToSharedSession,
213
+ defaultProviderPriorityFromNodeFacts: () => defaultProviderPriorityFromNodeFacts,
212
214
  deriveProviderPriorityFromSlots: () => deriveProviderPriorityFromSlots,
213
215
  deriveSlotsFromLegacy: () => deriveSlotsFromLegacy,
214
216
  describeModelSelection: () => describeModelSelection,
@@ -315,6 +317,7 @@ __export(index_exports, {
315
317
  normalizeOwnedPaths: () => normalizeOwnedPaths,
316
318
  normalizeSessionStatus: () => normalizeSessionStatus,
317
319
  normalizeThinkingLevel: () => normalizeThinkingLevel,
320
+ orderProvidersByBuiltinPreference: () => orderProvidersByBuiltinPreference,
318
321
  parseJsonRecord: () => parseJsonRecord,
319
322
  parseSemver: () => parseSemver,
320
323
  parseSessionLaunchRecord: () => parseSessionLaunchRecord,
@@ -631,6 +634,27 @@ function formatQuotaAccount(quota) {
631
634
  const parts = [email, plan].filter(Boolean);
632
635
  return parts.length > 0 ? parts.join(" \xB7 ") : null;
633
636
  }
637
+ var BUILTIN_PROVIDER_PREFERENCE = ["claude-cli", "codex-cli", "gemini-cli"];
638
+ function orderProvidersByBuiltinPreference(types) {
639
+ const unique = [...new Set(types.map((t) => typeof t === "string" ? t.trim() : "").filter(Boolean))];
640
+ const rank = (t) => {
641
+ const i = BUILTIN_PROVIDER_PREFERENCE.indexOf(t);
642
+ return i < 0 ? BUILTIN_PROVIDER_PREFERENCE.length : i;
643
+ };
644
+ return unique.sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));
645
+ }
646
+ function defaultProviderPriorityFromNodeFacts(facts) {
647
+ const f = facts && typeof facts === "object" && !Array.isArray(facts) ? facts : null;
648
+ const enablement = f?.providerEnablement;
649
+ if (!enablement || typeof enablement !== "object" || Array.isArray(enablement)) return [];
650
+ const enabled = Object.entries(enablement).filter(([, v]) => !!v && typeof v === "object" && v.enabled === true).map(([type]) => type);
651
+ const versions = f?.providerVersions;
652
+ const detected = versions && typeof versions === "object" && !Array.isArray(versions) ? enabled.filter((type) => {
653
+ const v = versions[type];
654
+ return typeof v === "string" && !!v.trim();
655
+ }) : [];
656
+ return orderProvidersByBuiltinPreference(detected.length ? detected : enabled);
657
+ }
634
658
 
635
659
  // src/workspace-normalize.ts
636
660
  function normalizeMeshWorkspaceForCompare(dir) {
@@ -3735,6 +3759,7 @@ function stableMeshNodeRow(row) {
3735
3759
  ASSISTANT_TOOL_VERBS,
3736
3760
  ASSISTANT_VERB,
3737
3761
  ASSISTANT_WRITE_TOOLS,
3762
+ BUILTIN_PROVIDER_PREFERENCE,
3738
3763
  CANCEL_REASONS,
3739
3764
  CANONICAL_MESH_TOOL_COUNT,
3740
3765
  CANONICAL_MESH_TOOL_NAMES,
@@ -3916,6 +3941,7 @@ function stableMeshNodeRow(row) {
3916
3941
  decodeTypeField,
3917
3942
  decodeUserSessionToDashboard,
3918
3943
  decodeViewerToSharedSession,
3944
+ defaultProviderPriorityFromNodeFacts,
3919
3945
  deriveProviderPriorityFromSlots,
3920
3946
  deriveSlotsFromLegacy,
3921
3947
  describeModelSelection,
@@ -4022,6 +4048,7 @@ function stableMeshNodeRow(row) {
4022
4048
  normalizeOwnedPaths,
4023
4049
  normalizeSessionStatus,
4024
4050
  normalizeThinkingLevel,
4051
+ orderProvidersByBuiltinPreference,
4025
4052
  parseJsonRecord,
4026
4053
  parseSemver,
4027
4054
  parseSessionLaunchRecord,