@amaster.ai/employee-runtime-connector 0.1.1-beta.32 → 0.1.1-beta.33
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.
|
@@ -2755,7 +2755,8 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
2755
2755
|
const DELEGATED_PROFILE_MARKER = ".amaster-delegated-pi-profile.json";
|
|
2756
2756
|
const SESSION_ROLLOUT_MARKER2 = ".amaster-pi-session-rollout.json";
|
|
2757
2757
|
const DEFAULT_SESSION_ROLLOUT_TTL_MS2 = 24 * 60 * 60 * 1e3;
|
|
2758
|
-
const
|
|
2758
|
+
const PI_VERSION_ATTESTATION_TIMEOUT_MS = 1e4;
|
|
2759
|
+
const PI_EFFECTIVE_TOOLS_ATTESTATION_TIMEOUT_MS = 3e4;
|
|
2759
2760
|
const PI_ATTESTATION_MAX_ATTEMPTS = 2;
|
|
2760
2761
|
const PI_ATTESTATION_RECENT_LIVE_TTL_MS = Number.isFinite(options.recentLiveTtlMs) && options.recentLiveTtlMs > 0 ? options.recentLiveTtlMs : 30 * 60 * 1e3;
|
|
2761
2762
|
const recentLivePiVersionProbes = /* @__PURE__ */ new Map();
|
|
@@ -3343,7 +3344,7 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
3343
3344
|
cwd: env.AMASTER_RUNTIME_EXECUTION_WORKDIR,
|
|
3344
3345
|
env,
|
|
3345
3346
|
encoding: "utf8",
|
|
3346
|
-
timeout:
|
|
3347
|
+
timeout: PI_VERSION_ATTESTATION_TIMEOUT_MS,
|
|
3347
3348
|
killSignal: "SIGKILL",
|
|
3348
3349
|
maxBuffer: 1024 * 1024,
|
|
3349
3350
|
...spawnIdentity ?? {}
|
|
@@ -3407,7 +3408,18 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
3407
3408
|
liveProbeAgeMs
|
|
3408
3409
|
};
|
|
3409
3410
|
}
|
|
3411
|
+
function inspectEffectiveToolsProbeReceipt(receiptPath) {
|
|
3412
|
+
if (!existsSync3(receiptPath)) return { phase: "missing", receipt: null };
|
|
3413
|
+
try {
|
|
3414
|
+
const receipt = JSON.parse(readFileSync3(receiptPath, "utf8"));
|
|
3415
|
+
const phase = receipt?.status === "attested" || receipt?.status === "rejected" ? receipt.status : "present";
|
|
3416
|
+
return { phase, receipt };
|
|
3417
|
+
} catch {
|
|
3418
|
+
return { phase: "invalid", receipt: null };
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3410
3421
|
function attestDirectPiTools(executorCommand, env, input, spawnIdentity = null) {
|
|
3422
|
+
const startedAtMs = currentTimeMs();
|
|
3411
3423
|
const result3 = spawnSyncImpl(executorCommand, [
|
|
3412
3424
|
"--no-session",
|
|
3413
3425
|
"--no-approve",
|
|
@@ -3423,25 +3435,28 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
3423
3435
|
cwd: env.AMASTER_RUNTIME_EXECUTION_WORKDIR,
|
|
3424
3436
|
env: { ...env, AMASTER_PI_EFFECTIVE_TOOLS_MODE: "probe" },
|
|
3425
3437
|
encoding: "utf8",
|
|
3426
|
-
timeout:
|
|
3438
|
+
timeout: PI_EFFECTIVE_TOOLS_ATTESTATION_TIMEOUT_MS,
|
|
3427
3439
|
killSignal: "SIGKILL",
|
|
3428
3440
|
maxBuffer: 1024 * 1024,
|
|
3429
3441
|
...spawnIdentity ?? {}
|
|
3430
3442
|
});
|
|
3443
|
+
const elapsedMs = Math.max(0, currentTimeMs() - startedAtMs);
|
|
3431
3444
|
if (result3.error) {
|
|
3432
3445
|
const code = typeof result3.error.code === "string" ? result3.error.code : "UNKNOWN";
|
|
3433
|
-
|
|
3446
|
+
const receiptDiagnostic = inspectEffectiveToolsProbeReceipt(input.receiptPath);
|
|
3447
|
+
throw new Error(
|
|
3448
|
+
`pi_managed_mcp_effective_tools_failed: probe error=${code} elapsedMs=${elapsedMs} timeoutMs=${PI_EFFECTIVE_TOOLS_ATTESTATION_TIMEOUT_MS} receiptPhase=${receiptDiagnostic.phase}`
|
|
3449
|
+
);
|
|
3434
3450
|
}
|
|
3435
3451
|
if (result3.status !== 0) {
|
|
3452
|
+
const receiptDiagnostic = inspectEffectiveToolsProbeReceipt(input.receiptPath);
|
|
3436
3453
|
let receiptError = "receipt unavailable";
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
if (typeof rejectedReceipt.error === "string" && rejectedReceipt.error.length > 0) {
|
|
3440
|
-
receiptError = rejectedReceipt.error.slice(0, 512);
|
|
3441
|
-
}
|
|
3442
|
-
} catch {
|
|
3454
|
+
if (typeof receiptDiagnostic.receipt?.error === "string" && receiptDiagnostic.receipt.error.length > 0) {
|
|
3455
|
+
receiptError = receiptDiagnostic.receipt.error.slice(0, 512);
|
|
3443
3456
|
}
|
|
3444
|
-
throw new Error(
|
|
3457
|
+
throw new Error(
|
|
3458
|
+
`pi_managed_mcp_effective_tools_failed: probe exit=${result3.status ?? "unknown"} elapsedMs=${elapsedMs} timeoutMs=${PI_EFFECTIVE_TOOLS_ATTESTATION_TIMEOUT_MS} receiptPhase=${receiptDiagnostic.phase} reason=${receiptError}`
|
|
3459
|
+
);
|
|
3445
3460
|
}
|
|
3446
3461
|
let receipt;
|
|
3447
3462
|
try {
|
|
@@ -3465,6 +3480,8 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
3465
3480
|
effectiveToolSetHash: receipt.effectiveSetHash,
|
|
3466
3481
|
effectiveToolProbeDigest: sha2562(stablePiJson(receipt)),
|
|
3467
3482
|
effectiveToolProbeAt: receipt.attestedAt,
|
|
3483
|
+
effectiveToolProbeElapsedMs: elapsedMs,
|
|
3484
|
+
effectiveToolProbeTimeoutMs: PI_EFFECTIVE_TOOLS_ATTESTATION_TIMEOUT_MS,
|
|
3468
3485
|
effectiveToolBindings: receipt.effectiveToolBindings
|
|
3469
3486
|
};
|
|
3470
3487
|
}
|
|
@@ -9511,7 +9528,7 @@ function assertSourceAcquisitionRuntimeAuthority({
|
|
|
9511
9528
|
}
|
|
9512
9529
|
|
|
9513
9530
|
// src/amaster-runtime-daemon.mjs
|
|
9514
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
9531
|
+
var CONNECTOR_VERSION = "0.1.1-beta.33";
|
|
9515
9532
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
9516
9533
|
var SOURCE_ACQUISITION_CAPABILITY = "source_acquisition_v1";
|
|
9517
9534
|
var SOURCE_ACQUISITION_PROFILE_VERSION = "source_acquisition_v1";
|
|
@@ -13993,7 +14010,7 @@ async function executeRunCommand(config, command) {
|
|
|
13993
14010
|
}
|
|
13994
14011
|
if (executor.kind === "pi") {
|
|
13995
14012
|
piResolvedProviderConfig = executorEnv;
|
|
13996
|
-
for (const envName of ["AMASTER_API_KEY", "AMASTER_PLATFORM_OAUTH_TOKEN"]) {
|
|
14013
|
+
for (const envName of ["AMASTER_API_KEY", "AMASTER_PLATFORM_OAUTH_TOKEN", "PLATFORM_ACCESS_TOKEN"]) {
|
|
13997
14014
|
const protectedValue = readString(piResolvedProviderConfig[envName]);
|
|
13998
14015
|
if (protectedValue && !providerProtectedValues.includes(protectedValue)) {
|
|
13999
14016
|
providerProtectedValues.push(protectedValue);
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { basename, dirname, join, resolve } from "node:path";
|
|
|
6
6
|
import { homedir, hostname } from "node:os";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
|
|
9
|
-
const CONNECTOR_VERSION = "0.1.1-beta.
|
|
9
|
+
const CONNECTOR_VERSION = "0.1.1-beta.33";
|
|
10
10
|
|
|
11
11
|
const CAPABILITIES = [
|
|
12
12
|
"remote_registration",
|