@adhdev/mesh-shared 1.0.58-rc.5 → 1.0.58-rc.50
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 +99 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +91 -0
- package/dist/index.mjs.map +1 -1
- package/dist/interactive-prompt-constants.d.ts +1 -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 +1 -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.d.ts
CHANGED
|
@@ -25,3 +25,6 @@ export * from './interpolation';
|
|
|
25
25
|
export * from './mesh-tool-names';
|
|
26
26
|
export * from './mesh-status-probe';
|
|
27
27
|
export * from './rpc-chunking';
|
|
28
|
+
export * from './semver-compare';
|
|
29
|
+
export * from './ws-protocol';
|
|
30
|
+
export * from './interactive-prompt-constants';
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,9 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
CANONICAL_MESH_TOOL_COUNT: () => CANONICAL_MESH_TOOL_COUNT,
|
|
24
24
|
CANONICAL_MESH_TOOL_NAMES: () => CANONICAL_MESH_TOOL_NAMES,
|
|
25
|
+
CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX: () => CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX,
|
|
25
26
|
CLI_SLOT_RECIPES: () => CLI_SLOT_RECIPES,
|
|
27
|
+
DAEMON_TO_SERVER_WS_MSGS: () => DAEMON_TO_SERVER_WS_MSGS,
|
|
26
28
|
DEFAULT_DIFFICULTY_BRAINS: () => DEFAULT_DIFFICULTY_BRAINS,
|
|
27
29
|
MAGI_RAW_ANSWER_CAP: () => MAGI_RAW_ANSWER_CAP,
|
|
28
30
|
MESH_CHUNK_KIND: () => MESH_CHUNK_KIND,
|
|
@@ -34,12 +36,14 @@ __export(index_exports, {
|
|
|
34
36
|
MESH_TASK_DIFFICULTIES: () => MESH_TASK_DIFFICULTIES,
|
|
35
37
|
MeshChunkAssembler: () => MeshChunkAssembler,
|
|
36
38
|
QUOTA_SUPPORTED_PROVIDERS: () => QUOTA_SUPPORTED_PROVIDERS,
|
|
39
|
+
SERVER_TO_DAEMON_WS_MSGS: () => SERVER_TO_DAEMON_WS_MSGS,
|
|
37
40
|
STATUS_PROBE_ARG_KEY: () => STATUS_PROBE_ARG_KEY,
|
|
38
41
|
UNKNOWN_CLI_SLOT_RECIPE: () => UNKNOWN_CLI_SLOT_RECIPE,
|
|
39
42
|
argsCarryStatusProbeMarker: () => argsCarryStatusProbeMarker,
|
|
40
43
|
buildMagiPanelProposal: () => buildMagiPanelProposal,
|
|
41
44
|
buildSlotProposal: () => buildSlotProposal,
|
|
42
45
|
canonicalDaemonId: () => canonicalDaemonId,
|
|
46
|
+
compareSemver: () => compareSemver,
|
|
43
47
|
daemonIdsEquivalent: () => daemonIdsEquivalent,
|
|
44
48
|
deriveProviderPriorityFromSlots: () => deriveProviderPriorityFromSlots,
|
|
45
49
|
deriveSlotsFromLegacy: () => deriveSlotsFromLegacy,
|
|
@@ -48,9 +52,12 @@ __export(index_exports, {
|
|
|
48
52
|
hasGitStatusEvidence: () => hasGitStatusEvidence,
|
|
49
53
|
interpolateArgs: () => interpolateArgs,
|
|
50
54
|
interpolateString: () => interpolateString,
|
|
55
|
+
isDaemonToServerWsMsg: () => isDaemonToServerWsMsg,
|
|
56
|
+
isDowngrade: () => isDowngrade,
|
|
51
57
|
isMeshTaskDifficulty: () => isMeshTaskDifficulty,
|
|
52
58
|
isPhantomDaemonEntry: () => isPhantomDaemonEntry,
|
|
53
59
|
isRawDaemonDoId: () => isRawDaemonDoId,
|
|
60
|
+
isServerToDaemonWsMsg: () => isServerToDaemonWsMsg,
|
|
54
61
|
joinRepoPath: () => joinRepoPath,
|
|
55
62
|
machineCoreFromDaemonId: () => machineCoreFromDaemonId,
|
|
56
63
|
measureWorstCaseChunkEnvelopeBytes: () => measureWorstCaseChunkEnvelopeBytes,
|
|
@@ -69,6 +76,7 @@ __export(index_exports, {
|
|
|
69
76
|
normalizeNodeCapabilitySlots: () => normalizeNodeCapabilitySlots,
|
|
70
77
|
normalizeThinkingLevel: () => normalizeThinkingLevel,
|
|
71
78
|
parseJsonRecord: () => parseJsonRecord,
|
|
79
|
+
parseSemver: () => parseSemver,
|
|
72
80
|
pickBestTransitGitStatus: () => pickBestTransitGitStatus,
|
|
73
81
|
readBoolean: () => readBoolean,
|
|
74
82
|
readGitSubmodules: () => readGitSubmodules,
|
|
@@ -345,6 +353,7 @@ var QUOTA_SUPPORTED_PROVIDERS = [
|
|
|
345
353
|
"antigravity-cli",
|
|
346
354
|
"claude-cli",
|
|
347
355
|
"codex-cli",
|
|
356
|
+
"cursor-cli",
|
|
348
357
|
"grok-cli",
|
|
349
358
|
"kimi",
|
|
350
359
|
"opencode"
|
|
@@ -742,6 +751,7 @@ function interpolateString(template, ctx) {
|
|
|
742
751
|
// src/mesh-tool-names.ts
|
|
743
752
|
var CANONICAL_MESH_TOOL_NAMES = [
|
|
744
753
|
"mesh_status",
|
|
754
|
+
"mesh_route_preview",
|
|
745
755
|
"mesh_list_nodes",
|
|
746
756
|
// GRAPH-ORCHESTRATION Phase F — batch before task, mirroring ALL_MESH_TOOLS.
|
|
747
757
|
"mesh_enqueue_batch",
|
|
@@ -995,11 +1005,94 @@ var MeshChunkAssembler = class {
|
|
|
995
1005
|
}
|
|
996
1006
|
}
|
|
997
1007
|
};
|
|
1008
|
+
|
|
1009
|
+
// src/semver-compare.ts
|
|
1010
|
+
var SEMVER_PATTERN = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
1011
|
+
var NUMERIC_IDENTIFIER = /^\d+$/;
|
|
1012
|
+
function parseSemver(version) {
|
|
1013
|
+
if (typeof version !== "string") return null;
|
|
1014
|
+
const match = version.trim().replace(/^v/, "").match(SEMVER_PATTERN);
|
|
1015
|
+
if (!match) return null;
|
|
1016
|
+
return {
|
|
1017
|
+
major: Number(match[1]),
|
|
1018
|
+
minor: Number(match[2]),
|
|
1019
|
+
patch: Number(match[3]),
|
|
1020
|
+
prerelease: match[4] ? match[4].split(".") : []
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
function comparePrerelease(a, b) {
|
|
1024
|
+
if (a.length === 0 && b.length === 0) return 0;
|
|
1025
|
+
if (a.length === 0) return 1;
|
|
1026
|
+
if (b.length === 0) return -1;
|
|
1027
|
+
for (let i = 0; i < Math.min(a.length, b.length); i += 1) {
|
|
1028
|
+
const idA = a[i];
|
|
1029
|
+
const idB = b[i];
|
|
1030
|
+
if (idA === idB) continue;
|
|
1031
|
+
const numA = NUMERIC_IDENTIFIER.test(idA);
|
|
1032
|
+
const numB = NUMERIC_IDENTIFIER.test(idB);
|
|
1033
|
+
if (numA && numB) return Number(idA) < Number(idB) ? -1 : 1;
|
|
1034
|
+
if (numA) return -1;
|
|
1035
|
+
if (numB) return 1;
|
|
1036
|
+
return idA < idB ? -1 : 1;
|
|
1037
|
+
}
|
|
1038
|
+
return a.length === b.length ? 0 : a.length < b.length ? -1 : 1;
|
|
1039
|
+
}
|
|
1040
|
+
function compareSemver(a, b) {
|
|
1041
|
+
const pa = parseSemver(a);
|
|
1042
|
+
const pb = parseSemver(b);
|
|
1043
|
+
if (!pa || !pb) return null;
|
|
1044
|
+
if (pa.major !== pb.major) return pa.major < pb.major ? -1 : 1;
|
|
1045
|
+
if (pa.minor !== pb.minor) return pa.minor < pb.minor ? -1 : 1;
|
|
1046
|
+
if (pa.patch !== pb.patch) return pa.patch < pb.patch ? -1 : 1;
|
|
1047
|
+
return comparePrerelease(pa.prerelease, pb.prerelease);
|
|
1048
|
+
}
|
|
1049
|
+
function isDowngrade(current, target) {
|
|
1050
|
+
const direction = compareSemver(target, current);
|
|
1051
|
+
if (direction === null) return false;
|
|
1052
|
+
return direction < 0;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// src/ws-protocol.ts
|
|
1056
|
+
var DAEMON_TO_SERVER_WS_MSGS = [
|
|
1057
|
+
"auth",
|
|
1058
|
+
"status_report",
|
|
1059
|
+
"status_heartbeat",
|
|
1060
|
+
"status_event",
|
|
1061
|
+
"command_result",
|
|
1062
|
+
"error",
|
|
1063
|
+
"agent_event",
|
|
1064
|
+
"log",
|
|
1065
|
+
"beacon_vectors"
|
|
1066
|
+
];
|
|
1067
|
+
var SERVER_TO_DAEMON_WS_MSGS = [
|
|
1068
|
+
"auth_ok",
|
|
1069
|
+
"auth_error",
|
|
1070
|
+
"machine_evicted",
|
|
1071
|
+
"force_disconnect",
|
|
1072
|
+
"token_revoked",
|
|
1073
|
+
"version_mismatch",
|
|
1074
|
+
"force_update_required",
|
|
1075
|
+
"command",
|
|
1076
|
+
"agent_command",
|
|
1077
|
+
"resolve_action",
|
|
1078
|
+
"beacon_vectors_result"
|
|
1079
|
+
];
|
|
1080
|
+
function isDaemonToServerWsMsg(value) {
|
|
1081
|
+
return typeof value === "string" && DAEMON_TO_SERVER_WS_MSGS.includes(value);
|
|
1082
|
+
}
|
|
1083
|
+
function isServerToDaemonWsMsg(value) {
|
|
1084
|
+
return typeof value === "string" && SERVER_TO_DAEMON_WS_MSGS.includes(value);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
// src/interactive-prompt-constants.ts
|
|
1088
|
+
var CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX = "Claude TUI review page is not focused";
|
|
998
1089
|
// Annotate the CommonJS export names for ESM import in node:
|
|
999
1090
|
0 && (module.exports = {
|
|
1000
1091
|
CANONICAL_MESH_TOOL_COUNT,
|
|
1001
1092
|
CANONICAL_MESH_TOOL_NAMES,
|
|
1093
|
+
CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX,
|
|
1002
1094
|
CLI_SLOT_RECIPES,
|
|
1095
|
+
DAEMON_TO_SERVER_WS_MSGS,
|
|
1003
1096
|
DEFAULT_DIFFICULTY_BRAINS,
|
|
1004
1097
|
MAGI_RAW_ANSWER_CAP,
|
|
1005
1098
|
MESH_CHUNK_KIND,
|
|
@@ -1011,12 +1104,14 @@ var MeshChunkAssembler = class {
|
|
|
1011
1104
|
MESH_TASK_DIFFICULTIES,
|
|
1012
1105
|
MeshChunkAssembler,
|
|
1013
1106
|
QUOTA_SUPPORTED_PROVIDERS,
|
|
1107
|
+
SERVER_TO_DAEMON_WS_MSGS,
|
|
1014
1108
|
STATUS_PROBE_ARG_KEY,
|
|
1015
1109
|
UNKNOWN_CLI_SLOT_RECIPE,
|
|
1016
1110
|
argsCarryStatusProbeMarker,
|
|
1017
1111
|
buildMagiPanelProposal,
|
|
1018
1112
|
buildSlotProposal,
|
|
1019
1113
|
canonicalDaemonId,
|
|
1114
|
+
compareSemver,
|
|
1020
1115
|
daemonIdsEquivalent,
|
|
1021
1116
|
deriveProviderPriorityFromSlots,
|
|
1022
1117
|
deriveSlotsFromLegacy,
|
|
@@ -1025,9 +1120,12 @@ var MeshChunkAssembler = class {
|
|
|
1025
1120
|
hasGitStatusEvidence,
|
|
1026
1121
|
interpolateArgs,
|
|
1027
1122
|
interpolateString,
|
|
1123
|
+
isDaemonToServerWsMsg,
|
|
1124
|
+
isDowngrade,
|
|
1028
1125
|
isMeshTaskDifficulty,
|
|
1029
1126
|
isPhantomDaemonEntry,
|
|
1030
1127
|
isRawDaemonDoId,
|
|
1128
|
+
isServerToDaemonWsMsg,
|
|
1031
1129
|
joinRepoPath,
|
|
1032
1130
|
machineCoreFromDaemonId,
|
|
1033
1131
|
measureWorstCaseChunkEnvelopeBytes,
|
|
@@ -1046,6 +1144,7 @@ var MeshChunkAssembler = class {
|
|
|
1046
1144
|
normalizeNodeCapabilitySlots,
|
|
1047
1145
|
normalizeThinkingLevel,
|
|
1048
1146
|
parseJsonRecord,
|
|
1147
|
+
parseSemver,
|
|
1049
1148
|
pickBestTransitGitStatus,
|
|
1050
1149
|
readBoolean,
|
|
1051
1150
|
readGitSubmodules,
|