@adhdev/mesh-shared 1.0.58-rc.6 → 1.0.58-rc.60

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.mjs CHANGED
@@ -256,6 +256,7 @@ var QUOTA_SUPPORTED_PROVIDERS = [
256
256
  "antigravity-cli",
257
257
  "claude-cli",
258
258
  "codex-cli",
259
+ "cursor-cli",
259
260
  "grok-cli",
260
261
  "kimi",
261
262
  "opencode"
@@ -653,6 +654,7 @@ function interpolateString(template, ctx) {
653
654
  // src/mesh-tool-names.ts
654
655
  var CANONICAL_MESH_TOOL_NAMES = [
655
656
  "mesh_status",
657
+ "mesh_route_preview",
656
658
  "mesh_list_nodes",
657
659
  // GRAPH-ORCHESTRATION Phase F — batch before task, mirroring ALL_MESH_TOOLS.
658
660
  "mesh_enqueue_batch",
@@ -906,10 +908,93 @@ var MeshChunkAssembler = class {
906
908
  }
907
909
  }
908
910
  };
911
+
912
+ // src/semver-compare.ts
913
+ var SEMVER_PATTERN = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
914
+ var NUMERIC_IDENTIFIER = /^\d+$/;
915
+ function parseSemver(version) {
916
+ if (typeof version !== "string") return null;
917
+ const match = version.trim().replace(/^v/, "").match(SEMVER_PATTERN);
918
+ if (!match) return null;
919
+ return {
920
+ major: Number(match[1]),
921
+ minor: Number(match[2]),
922
+ patch: Number(match[3]),
923
+ prerelease: match[4] ? match[4].split(".") : []
924
+ };
925
+ }
926
+ function comparePrerelease(a, b) {
927
+ if (a.length === 0 && b.length === 0) return 0;
928
+ if (a.length === 0) return 1;
929
+ if (b.length === 0) return -1;
930
+ for (let i = 0; i < Math.min(a.length, b.length); i += 1) {
931
+ const idA = a[i];
932
+ const idB = b[i];
933
+ if (idA === idB) continue;
934
+ const numA = NUMERIC_IDENTIFIER.test(idA);
935
+ const numB = NUMERIC_IDENTIFIER.test(idB);
936
+ if (numA && numB) return Number(idA) < Number(idB) ? -1 : 1;
937
+ if (numA) return -1;
938
+ if (numB) return 1;
939
+ return idA < idB ? -1 : 1;
940
+ }
941
+ return a.length === b.length ? 0 : a.length < b.length ? -1 : 1;
942
+ }
943
+ function compareSemver(a, b) {
944
+ const pa = parseSemver(a);
945
+ const pb = parseSemver(b);
946
+ if (!pa || !pb) return null;
947
+ if (pa.major !== pb.major) return pa.major < pb.major ? -1 : 1;
948
+ if (pa.minor !== pb.minor) return pa.minor < pb.minor ? -1 : 1;
949
+ if (pa.patch !== pb.patch) return pa.patch < pb.patch ? -1 : 1;
950
+ return comparePrerelease(pa.prerelease, pb.prerelease);
951
+ }
952
+ function isDowngrade(current, target) {
953
+ const direction = compareSemver(target, current);
954
+ if (direction === null) return false;
955
+ return direction < 0;
956
+ }
957
+
958
+ // src/ws-protocol.ts
959
+ var DAEMON_TO_SERVER_WS_MSGS = [
960
+ "auth",
961
+ "status_report",
962
+ "status_heartbeat",
963
+ "status_event",
964
+ "command_result",
965
+ "error",
966
+ "agent_event",
967
+ "log",
968
+ "beacon_vectors"
969
+ ];
970
+ var SERVER_TO_DAEMON_WS_MSGS = [
971
+ "auth_ok",
972
+ "auth_error",
973
+ "machine_evicted",
974
+ "force_disconnect",
975
+ "token_revoked",
976
+ "version_mismatch",
977
+ "force_update_required",
978
+ "command",
979
+ "agent_command",
980
+ "resolve_action",
981
+ "beacon_vectors_result"
982
+ ];
983
+ function isDaemonToServerWsMsg(value) {
984
+ return typeof value === "string" && DAEMON_TO_SERVER_WS_MSGS.includes(value);
985
+ }
986
+ function isServerToDaemonWsMsg(value) {
987
+ return typeof value === "string" && SERVER_TO_DAEMON_WS_MSGS.includes(value);
988
+ }
989
+
990
+ // src/interactive-prompt-constants.ts
991
+ var CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX = "Claude TUI review page is not focused";
909
992
  export {
910
993
  CANONICAL_MESH_TOOL_COUNT,
911
994
  CANONICAL_MESH_TOOL_NAMES,
995
+ CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX,
912
996
  CLI_SLOT_RECIPES,
997
+ DAEMON_TO_SERVER_WS_MSGS,
913
998
  DEFAULT_DIFFICULTY_BRAINS,
914
999
  MAGI_RAW_ANSWER_CAP,
915
1000
  MESH_CHUNK_KIND,
@@ -921,12 +1006,14 @@ export {
921
1006
  MESH_TASK_DIFFICULTIES,
922
1007
  MeshChunkAssembler,
923
1008
  QUOTA_SUPPORTED_PROVIDERS,
1009
+ SERVER_TO_DAEMON_WS_MSGS,
924
1010
  STATUS_PROBE_ARG_KEY,
925
1011
  UNKNOWN_CLI_SLOT_RECIPE,
926
1012
  argsCarryStatusProbeMarker,
927
1013
  buildMagiPanelProposal,
928
1014
  buildSlotProposal,
929
1015
  canonicalDaemonId,
1016
+ compareSemver,
930
1017
  daemonIdsEquivalent,
931
1018
  deriveProviderPriorityFromSlots,
932
1019
  deriveSlotsFromLegacy,
@@ -935,9 +1022,12 @@ export {
935
1022
  hasGitStatusEvidence,
936
1023
  interpolateArgs,
937
1024
  interpolateString,
1025
+ isDaemonToServerWsMsg,
1026
+ isDowngrade,
938
1027
  isMeshTaskDifficulty,
939
1028
  isPhantomDaemonEntry,
940
1029
  isRawDaemonDoId,
1030
+ isServerToDaemonWsMsg,
941
1031
  joinRepoPath,
942
1032
  machineCoreFromDaemonId,
943
1033
  measureWorstCaseChunkEnvelopeBytes,
@@ -956,6 +1046,7 @@ export {
956
1046
  normalizeNodeCapabilitySlots,
957
1047
  normalizeThinkingLevel,
958
1048
  parseJsonRecord,
1049
+ parseSemver,
959
1050
  pickBestTransitGitStatus,
960
1051
  readBoolean,
961
1052
  readGitSubmodules,