@amaster.ai/employee-runtime-connector 0.1.0-beta.44 → 0.1.0-beta.45
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.
|
@@ -5051,7 +5051,79 @@ function normalizeRuntimeVersionText(value) {
|
|
|
5051
5051
|
const trimmed = value.trim();
|
|
5052
5052
|
return trimmed ? trimmed : null;
|
|
5053
5053
|
}
|
|
5054
|
-
|
|
5054
|
+
var EXACT_SEMVER_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
|
|
5055
|
+
function isExactSemverVersion(value) {
|
|
5056
|
+
const normalized = normalizeRuntimeVersionText(value);
|
|
5057
|
+
const match = normalized?.match(EXACT_SEMVER_PATTERN);
|
|
5058
|
+
if (!match) return false;
|
|
5059
|
+
const prerelease = match[4]?.split(".") ?? [];
|
|
5060
|
+
return !prerelease.some(
|
|
5061
|
+
(identifier) => /^\d+$/.test(identifier) && identifier.length > 1 && identifier.startsWith("0")
|
|
5062
|
+
);
|
|
5063
|
+
}
|
|
5064
|
+
function compareNumericSemverIdentifiers(left, right) {
|
|
5065
|
+
if (left.length !== right.length) return left.length < right.length ? -1 : 1;
|
|
5066
|
+
if (left === right) return 0;
|
|
5067
|
+
return left < right ? -1 : 1;
|
|
5068
|
+
}
|
|
5069
|
+
function compareExactSemverVersions(current, recommended) {
|
|
5070
|
+
const normalizedCurrent = normalizeRuntimeVersionText(current);
|
|
5071
|
+
const normalizedRecommended = normalizeRuntimeVersionText(recommended);
|
|
5072
|
+
if (!normalizedCurrent || !normalizedRecommended || !isExactSemverVersion(normalizedCurrent) || !isExactSemverVersion(normalizedRecommended)) {
|
|
5073
|
+
return null;
|
|
5074
|
+
}
|
|
5075
|
+
const currentMatch = normalizedCurrent.match(EXACT_SEMVER_PATTERN);
|
|
5076
|
+
const recommendedMatch = normalizedRecommended.match(EXACT_SEMVER_PATTERN);
|
|
5077
|
+
if (!currentMatch || !recommendedMatch) return null;
|
|
5078
|
+
for (const index of [1, 2, 3]) {
|
|
5079
|
+
const comparison = compareNumericSemverIdentifiers(
|
|
5080
|
+
currentMatch[index],
|
|
5081
|
+
recommendedMatch[index]
|
|
5082
|
+
);
|
|
5083
|
+
if (comparison !== 0) return comparison;
|
|
5084
|
+
}
|
|
5085
|
+
const currentPrerelease = currentMatch[4]?.split(".");
|
|
5086
|
+
const recommendedPrerelease = recommendedMatch[4]?.split(".");
|
|
5087
|
+
if (!currentPrerelease && !recommendedPrerelease) return 0;
|
|
5088
|
+
if (!currentPrerelease) return 1;
|
|
5089
|
+
if (!recommendedPrerelease) return -1;
|
|
5090
|
+
const identifierCount = Math.max(
|
|
5091
|
+
currentPrerelease.length,
|
|
5092
|
+
recommendedPrerelease.length
|
|
5093
|
+
);
|
|
5094
|
+
for (let index = 0; index < identifierCount; index += 1) {
|
|
5095
|
+
const currentIdentifier = currentPrerelease[index];
|
|
5096
|
+
const recommendedIdentifier = recommendedPrerelease[index];
|
|
5097
|
+
if (currentIdentifier === void 0) return -1;
|
|
5098
|
+
if (recommendedIdentifier === void 0) return 1;
|
|
5099
|
+
if (currentIdentifier === recommendedIdentifier) continue;
|
|
5100
|
+
const currentIsNumeric = /^\d+$/.test(currentIdentifier);
|
|
5101
|
+
const recommendedIsNumeric = /^\d+$/.test(recommendedIdentifier);
|
|
5102
|
+
if (currentIsNumeric && recommendedIsNumeric) {
|
|
5103
|
+
return compareNumericSemverIdentifiers(
|
|
5104
|
+
currentIdentifier,
|
|
5105
|
+
recommendedIdentifier
|
|
5106
|
+
);
|
|
5107
|
+
}
|
|
5108
|
+
if (currentIsNumeric !== recommendedIsNumeric) {
|
|
5109
|
+
return currentIsNumeric ? -1 : 1;
|
|
5110
|
+
}
|
|
5111
|
+
return currentIdentifier < recommendedIdentifier ? -1 : 1;
|
|
5112
|
+
}
|
|
5113
|
+
return 0;
|
|
5114
|
+
}
|
|
5115
|
+
function versionPairRequiresUpgrade(current, recommended) {
|
|
5116
|
+
const normalizedCurrent = normalizeRuntimeVersionText(current);
|
|
5117
|
+
const normalizedRecommended = normalizeRuntimeVersionText(recommended);
|
|
5118
|
+
if (!normalizedCurrent || !normalizedRecommended) return false;
|
|
5119
|
+
const comparison = compareExactSemverVersions(
|
|
5120
|
+
normalizedCurrent,
|
|
5121
|
+
normalizedRecommended
|
|
5122
|
+
);
|
|
5123
|
+
if (comparison !== null) return comparison < 0;
|
|
5124
|
+
return false;
|
|
5125
|
+
}
|
|
5126
|
+
function normalizedTextPairDiffers(current, recommended) {
|
|
5055
5127
|
const normalizedCurrent = normalizeRuntimeVersionText(current);
|
|
5056
5128
|
const normalizedRecommended = normalizeRuntimeVersionText(recommended);
|
|
5057
5129
|
if (!normalizedCurrent || !normalizedRecommended) return false;
|
|
@@ -5060,10 +5132,10 @@ function versionPairDiffers(current, recommended) {
|
|
|
5060
5132
|
function summarizeAmasterRuntimeVersionDrift(input = {}) {
|
|
5061
5133
|
const versionMismatches = [];
|
|
5062
5134
|
const bundleMismatches = [];
|
|
5063
|
-
if (
|
|
5135
|
+
if (versionPairRequiresUpgrade(input.connectorVersion, input.recommendedConnectorVersion)) {
|
|
5064
5136
|
versionMismatches.push("connector package version differs from the recommended package");
|
|
5065
5137
|
}
|
|
5066
|
-
if (
|
|
5138
|
+
if (normalizedTextPairDiffers(input.buildCommit, input.recommendedBuildCommit)) {
|
|
5067
5139
|
bundleMismatches.push("build commit differs from the deployed connector package");
|
|
5068
5140
|
}
|
|
5069
5141
|
const recommendedConnectorVersion = normalizeRuntimeVersionText(input.recommendedConnectorVersion);
|
|
@@ -6159,7 +6231,7 @@ function readWorkspaceStatus(cwd, opts = {}) {
|
|
|
6159
6231
|
}
|
|
6160
6232
|
|
|
6161
6233
|
// src/amaster-runtime-daemon.mjs
|
|
6162
|
-
var CONNECTOR_VERSION = "0.1.0-beta.
|
|
6234
|
+
var CONNECTOR_VERSION = "0.1.0-beta.45";
|
|
6163
6235
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
6164
6236
|
var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
|
|
6165
6237
|
var CHECKPOINT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -6437,7 +6509,10 @@ function piCapabilitySourcesDiagnostics() {
|
|
|
6437
6509
|
const piAgentHome = configuredPiAgentHome ?? piCodingAgentDir;
|
|
6438
6510
|
const piAgentHomeSource = configuredPiAgentHome ? "PI_AGENT_HOME" : piCodingAgentDirSource;
|
|
6439
6511
|
const userSkillsPath = piAgentHome ? join13(piAgentHome, "skills") : null;
|
|
6440
|
-
const
|
|
6512
|
+
const configuredMarketplaceSkillsPath = safeExpandPath(
|
|
6513
|
+
process.env.PI_AGENT_MARKETPLACE_SKILLS_DIR
|
|
6514
|
+
);
|
|
6515
|
+
const marketplaceSkillsPath = configuredMarketplaceSkillsPath ?? (piAgentHome ? join13(piAgentHome, "marketplace", "skills") : null);
|
|
6441
6516
|
const builtinSkillsPath = safeExpandPath(process.env.PI_AGENT_BUILTIN_SKILLS_DIR) ?? safeExpandPath(process.env.AMASTER_BUILTIN_SKILLS);
|
|
6442
6517
|
const mcpConfigPath = safeExpandPath(process.env.PI_AGENT_MCP_SERVERS_FILE) ?? (piAgentHome ? join13(piAgentHome, "mcp.json") : null);
|
|
6443
6518
|
const settingsConfigPath = piCodingAgentDir ? join13(piCodingAgentDir, "settings.json") : null;
|
|
@@ -6445,7 +6520,7 @@ function piCapabilitySourcesDiagnostics() {
|
|
|
6445
6520
|
safeSkillRootSummary("user", `${piAgentHomeSource}/skills`, userSkillsPath),
|
|
6446
6521
|
safeSkillRootSummary(
|
|
6447
6522
|
"marketplace",
|
|
6448
|
-
|
|
6523
|
+
configuredMarketplaceSkillsPath ? "PI_AGENT_MARKETPLACE_SKILLS_DIR" : `${piAgentHomeSource}/marketplace/skills`,
|
|
6449
6524
|
marketplaceSkillsPath
|
|
6450
6525
|
),
|
|
6451
6526
|
safeSkillRootSummary(
|
|
@@ -6455,7 +6530,9 @@ function piCapabilitySourcesDiagnostics() {
|
|
|
6455
6530
|
)
|
|
6456
6531
|
];
|
|
6457
6532
|
const visibleSkillCount = skillRoots.reduce((sum, root) => sum + readNumber(root.skillCount, 0), 0);
|
|
6458
|
-
const missingRootKinds = skillRoots.filter(
|
|
6533
|
+
const missingRootKinds = skillRoots.filter(
|
|
6534
|
+
(root) => root.configured === true && root.available !== true && (root.kind !== "marketplace" || configuredMarketplaceSkillsPath)
|
|
6535
|
+
).map((root) => root.kind);
|
|
6459
6536
|
const mcpConfig = safeJsonConfigSummary(
|
|
6460
6537
|
readString(process.env.PI_AGENT_MCP_SERVERS_FILE) ? "PI_AGENT_MCP_SERVERS_FILE" : `${piAgentHomeSource}/mcp.json`,
|
|
6461
6538
|
mcpConfigPath,
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
5
5
|
import { homedir, hostname } from "node:os";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
|
|
8
|
-
const CONNECTOR_VERSION = "0.1.0-beta.
|
|
8
|
+
const CONNECTOR_VERSION = "0.1.0-beta.45";
|
|
9
9
|
|
|
10
10
|
const CAPABILITIES = [
|
|
11
11
|
"remote_registration",
|