@amaster.ai/employee-runtime-connector 0.1.1-beta.296 → 0.1.1-beta.297
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.
|
@@ -34380,7 +34380,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
|
|
|
34380
34380
|
}
|
|
34381
34381
|
|
|
34382
34382
|
// src/amaster-runtime-daemon.mjs
|
|
34383
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
34383
|
+
var CONNECTOR_VERSION = "0.1.1-beta.297";
|
|
34384
34384
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
34385
34385
|
var daemonRequire = createRequire(import.meta.url);
|
|
34386
34386
|
var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
|
|
@@ -35076,8 +35076,13 @@ function piIsolatedChildOwnership(config) {
|
|
|
35076
35076
|
function handoffPiRunPathsToChild(config, paths) {
|
|
35077
35077
|
const ownership = piIsolatedChildOwnership(config);
|
|
35078
35078
|
if (!ownership) return;
|
|
35079
|
+
const allowedRoot = readString(config.runtimeWorkspacesRoot);
|
|
35079
35080
|
for (const path of paths) {
|
|
35080
|
-
if (typeof path
|
|
35081
|
+
if (typeof path !== "string" || !path) continue;
|
|
35082
|
+
if (allowedRoot && !pathWithin3(path, allowedRoot)) {
|
|
35083
|
+
throw new Error("pi_executor_access_path_outside_runtime_root");
|
|
35084
|
+
}
|
|
35085
|
+
makePiRunPathWritable(path, ownership.uid, ownership.gid);
|
|
35081
35086
|
}
|
|
35082
35087
|
}
|
|
35083
35088
|
function writeLocalRuntimeStatus(config, runtimeStatus) {
|
|
@@ -35783,21 +35788,16 @@ function readJsonFile2(filePath) {
|
|
|
35783
35788
|
return {};
|
|
35784
35789
|
}
|
|
35785
35790
|
}
|
|
35786
|
-
|
|
35787
|
-
if (!agentDir) return;
|
|
35791
|
+
function syncPiExecutorProviderConfig(config, agentDir, providerConfig) {
|
|
35792
|
+
if (!agentDir) return null;
|
|
35788
35793
|
const { modelsSynced, settingsSynced } = syncAmasterProviderFiles(agentDir, providerConfig);
|
|
35789
35794
|
if (modelsSynced || settingsSynced) {
|
|
35790
35795
|
handoffPiRunPathsToChild(config, [
|
|
35791
35796
|
modelsSynced ? join19(agentDir, "models.json") : null,
|
|
35792
35797
|
settingsSynced ? join19(agentDir, "settings.json") : null
|
|
35793
35798
|
]);
|
|
35794
|
-
await ingestLog(config, command, "system", "info", "Synced AMaster provider config for pi executor", {
|
|
35795
|
-
modelsSynced,
|
|
35796
|
-
settingsSynced,
|
|
35797
|
-
credentialSource: "server_command_env",
|
|
35798
|
-
providerBaseUrlConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_BASE_URL))
|
|
35799
|
-
});
|
|
35800
35799
|
}
|
|
35800
|
+
return { modelsSynced, settingsSynced };
|
|
35801
35801
|
}
|
|
35802
35802
|
function normalizeWorkspaceContext(workspace) {
|
|
35803
35803
|
if (typeof workspace === "string") {
|
|
@@ -39178,6 +39178,10 @@ async function ackCommand(config, command, phase = "preparing") {
|
|
|
39178
39178
|
}
|
|
39179
39179
|
async function executeRunCommand(config, command) {
|
|
39180
39180
|
const preparationStartedAtMs = Date.now();
|
|
39181
|
+
let preparationLogChain = Promise.resolve();
|
|
39182
|
+
const enqueuePreparationLog = (stream, level, message, payload = {}) => {
|
|
39183
|
+
preparationLogChain = preparationLogChain.then(() => ingestLog(config, command, stream, level, message, payload)).catch(() => void 0);
|
|
39184
|
+
};
|
|
39181
39185
|
const executor = selectExecutor(config, command);
|
|
39182
39186
|
const governedMcp = asRecord(commandRuntimeAuth(command).governedMcp);
|
|
39183
39187
|
if (Array.isArray(command.requiredCapabilities) && command.requiredCapabilities.includes("runtime_actions_v2") && (Object.keys(governedMcp).length === 0 || !MIRRORX_FORMAL_TASK_EXECUTOR_KINDS.includes(executor.kind) || readString(governedMcp.executorKind) !== executor.kind)) {
|
|
@@ -39222,7 +39226,7 @@ async function executeRunCommand(config, command) {
|
|
|
39222
39226
|
}
|
|
39223
39227
|
const executionCommand = taskSessionCheckpointUnavailable ? { ...command, payload: { ...asRecord(command.payload), nativeSession: void 0 } } : command;
|
|
39224
39228
|
if (taskSessionCheckpointUnavailable) {
|
|
39225
|
-
|
|
39229
|
+
enqueuePreparationLog("system", "info", "Starting fresh: no exact task-session workspace checkpoint is available", {
|
|
39226
39230
|
skippedReason: "native_session_checkpoint_unavailable"
|
|
39227
39231
|
});
|
|
39228
39232
|
}
|
|
@@ -39232,7 +39236,7 @@ async function executeRunCommand(config, command) {
|
|
|
39232
39236
|
materializedAttachments = [...requiredArtifactInputs, ...await materializeIssueAttachments(config, command, workspace)];
|
|
39233
39237
|
} catch (err) {
|
|
39234
39238
|
if (issueAttachmentsAreRequired(command, commandTaskResourceInput(command))) throw err;
|
|
39235
|
-
|
|
39239
|
+
enqueuePreparationLog("system", "warn", `Failed to materialize issue attachments: ${err instanceof Error ? err.message : String(err)}`, {
|
|
39236
39240
|
error: err instanceof Error ? err.message : String(err)
|
|
39237
39241
|
});
|
|
39238
39242
|
}
|
|
@@ -39256,10 +39260,6 @@ async function executeRunCommand(config, command) {
|
|
|
39256
39260
|
let completionOwnsManagedMcpProfile = false;
|
|
39257
39261
|
const trustedPiRuntimeAssertion = commandTrustedPiRuntimeAssertion(command);
|
|
39258
39262
|
const preparationStages = [];
|
|
39259
|
-
let preparationLogChain = Promise.resolve();
|
|
39260
|
-
const enqueuePreparationLog = (stream, level, message, payload = {}) => {
|
|
39261
|
-
preparationLogChain = preparationLogChain.then(() => ingestLog(config, command, stream, level, message, payload)).catch(() => void 0);
|
|
39262
|
-
};
|
|
39263
39263
|
const runExecutionStage = (phase, operation) => {
|
|
39264
39264
|
const startedAtMs = Date.now();
|
|
39265
39265
|
const recordDuration = () => preparationStages.push({
|
|
@@ -39452,12 +39452,19 @@ async function executeRunCommand(config, command) {
|
|
|
39452
39452
|
agentDir = null;
|
|
39453
39453
|
}
|
|
39454
39454
|
try {
|
|
39455
|
-
await runExecutionStage("provider_config", () => syncPiExecutorProviderConfig(
|
|
39455
|
+
const providerSync = await runExecutionStage("provider_config", () => syncPiExecutorProviderConfig(
|
|
39456
39456
|
config,
|
|
39457
|
-
command,
|
|
39458
39457
|
agentDir,
|
|
39459
39458
|
piResolvedProviderConfig
|
|
39460
39459
|
));
|
|
39460
|
+
if (providerSync && (providerSync.modelsSynced || providerSync.settingsSynced)) {
|
|
39461
|
+
enqueuePreparationLog("system", "info", "Synced AMaster provider config for pi executor", {
|
|
39462
|
+
modelsSynced: providerSync.modelsSynced,
|
|
39463
|
+
settingsSynced: providerSync.settingsSynced,
|
|
39464
|
+
credentialSource: "server_command_env",
|
|
39465
|
+
providerBaseUrlConfigured: Boolean(readString(piResolvedProviderConfig.AMASTER_PROVIDER_BASE_URL))
|
|
39466
|
+
});
|
|
39467
|
+
}
|
|
39461
39468
|
} catch (error2) {
|
|
39462
39469
|
if (managedMcpProfile && cleanupManagedMcpProfile) {
|
|
39463
39470
|
cleanupManagedMcpProfile(managedMcpProfile, {
|
|
@@ -39605,7 +39612,6 @@ async function executeRunCommand(config, command) {
|
|
|
39605
39612
|
currentRunContractShadow: contextManifest.currentRunContractShadow
|
|
39606
39613
|
});
|
|
39607
39614
|
}
|
|
39608
|
-
await preparationLogChain;
|
|
39609
39615
|
await ackCommand(config, command, "spawned");
|
|
39610
39616
|
enqueuePreparationLog("system", "info", `Starting ${executor.kind} executor`, {
|
|
39611
39617
|
executorKind: executor.kind,
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { homedir, hostname } from "node:os";
|
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { BUILD_SUPPORTED_CAPABILITIES } from "./amaster-runtime-daemon/capability-registry.mjs";
|
|
9
9
|
|
|
10
|
-
const CONNECTOR_VERSION = "0.1.1-beta.
|
|
10
|
+
const CONNECTOR_VERSION = "0.1.1-beta.297";
|
|
11
11
|
|
|
12
12
|
const CONFIG_KEY_MAP = new Map([
|
|
13
13
|
["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
|