@adhdev/mesh-shared 1.0.58-rc.1 → 1.0.58-rc.100
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.d.ts +3 -0
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +93 -0
- package/dist/index.mjs.map +1 -1
- package/dist/interactive-prompt-constants.d.ts +17 -0
- package/dist/magi.d.ts +32 -0
- package/dist/mesh-tool-names.d.ts +2 -2
- package/dist/node-facts.d.ts +20 -1
- package/dist/semver-compare.d.ts +68 -0
- package/dist/ws-protocol.d.ts +50 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/interactive-prompt-constants.ts +18 -0
- package/src/magi.ts +32 -0
- package/src/mesh-tool-names.ts +1 -0
- package/src/node-facts.ts +21 -1
- package/src/semver-compare.ts +122 -0
- package/src/ws-protocol.ts +107 -0
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,95 @@ 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";
|
|
992
|
+
var CLAUDE_TUI_REVIEW_UNCONFIRMED_PREFIX = "Claude TUI answer delivered but not confirmed";
|
|
909
993
|
export {
|
|
910
994
|
CANONICAL_MESH_TOOL_COUNT,
|
|
911
995
|
CANONICAL_MESH_TOOL_NAMES,
|
|
996
|
+
CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX,
|
|
997
|
+
CLAUDE_TUI_REVIEW_UNCONFIRMED_PREFIX,
|
|
912
998
|
CLI_SLOT_RECIPES,
|
|
999
|
+
DAEMON_TO_SERVER_WS_MSGS,
|
|
913
1000
|
DEFAULT_DIFFICULTY_BRAINS,
|
|
914
1001
|
MAGI_RAW_ANSWER_CAP,
|
|
915
1002
|
MESH_CHUNK_KIND,
|
|
@@ -921,12 +1008,14 @@ export {
|
|
|
921
1008
|
MESH_TASK_DIFFICULTIES,
|
|
922
1009
|
MeshChunkAssembler,
|
|
923
1010
|
QUOTA_SUPPORTED_PROVIDERS,
|
|
1011
|
+
SERVER_TO_DAEMON_WS_MSGS,
|
|
924
1012
|
STATUS_PROBE_ARG_KEY,
|
|
925
1013
|
UNKNOWN_CLI_SLOT_RECIPE,
|
|
926
1014
|
argsCarryStatusProbeMarker,
|
|
927
1015
|
buildMagiPanelProposal,
|
|
928
1016
|
buildSlotProposal,
|
|
929
1017
|
canonicalDaemonId,
|
|
1018
|
+
compareSemver,
|
|
930
1019
|
daemonIdsEquivalent,
|
|
931
1020
|
deriveProviderPriorityFromSlots,
|
|
932
1021
|
deriveSlotsFromLegacy,
|
|
@@ -935,9 +1024,12 @@ export {
|
|
|
935
1024
|
hasGitStatusEvidence,
|
|
936
1025
|
interpolateArgs,
|
|
937
1026
|
interpolateString,
|
|
1027
|
+
isDaemonToServerWsMsg,
|
|
1028
|
+
isDowngrade,
|
|
938
1029
|
isMeshTaskDifficulty,
|
|
939
1030
|
isPhantomDaemonEntry,
|
|
940
1031
|
isRawDaemonDoId,
|
|
1032
|
+
isServerToDaemonWsMsg,
|
|
941
1033
|
joinRepoPath,
|
|
942
1034
|
machineCoreFromDaemonId,
|
|
943
1035
|
measureWorstCaseChunkEnvelopeBytes,
|
|
@@ -956,6 +1048,7 @@ export {
|
|
|
956
1048
|
normalizeNodeCapabilitySlots,
|
|
957
1049
|
normalizeThinkingLevel,
|
|
958
1050
|
parseJsonRecord,
|
|
1051
|
+
parseSemver,
|
|
959
1052
|
pickBestTransitGitStatus,
|
|
960
1053
|
readBoolean,
|
|
961
1054
|
readGitSubmodules,
|