@amaster.ai/employee-runtime-connector 0.1.0-beta.30 → 0.1.0-beta.31
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.
|
@@ -4750,7 +4750,7 @@ function readWorkspaceStatus(cwd, opts = {}) {
|
|
|
4750
4750
|
}
|
|
4751
4751
|
|
|
4752
4752
|
// src/amaster-runtime-daemon.mjs
|
|
4753
|
-
var CONNECTOR_VERSION = "0.1.0-beta.
|
|
4753
|
+
var CONNECTOR_VERSION = "0.1.0-beta.31";
|
|
4754
4754
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
4755
4755
|
var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
|
|
4756
4756
|
var CHECKPOINT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -5923,22 +5923,26 @@ function syncAmasterProviderSettings(agentDir, executorEnv) {
|
|
|
5923
5923
|
writeJsonFileAtomic(settingsPath, settings);
|
|
5924
5924
|
return true;
|
|
5925
5925
|
}
|
|
5926
|
-
|
|
5927
|
-
const hasGovernedMcp = Object.keys(asRecord(commandRuntimeAuth(command).governedMcp)).length > 0;
|
|
5928
|
-
const agentDir = piAgentLocalPlatformRunnerEnabled(config) || hasGovernedMcp ? readString(executorEnv.PI_AGENT_HOME) ?? readString(executorEnv.PI_CODING_AGENT_DIR) : readString(executorEnv.PI_CODING_AGENT_DIR) ?? readString(executorEnv.PI_AGENT_HOME) ?? null;
|
|
5929
|
-
if (!agentDir) return;
|
|
5926
|
+
function resolvePiExecutorProviderConfig(config, command, executorEnv) {
|
|
5930
5927
|
const localPlatformCredential = piAgentLocalPlatformCredentialForCommand(config, command);
|
|
5931
5928
|
if (piAgentLocalPlatformRunnerEnabled(config) && !localPlatformCredential) {
|
|
5932
5929
|
throw new Error("Pi Agent local Platform credential is unavailable for this command organization");
|
|
5933
5930
|
}
|
|
5934
|
-
|
|
5931
|
+
return {
|
|
5932
|
+
providerConfig: localPlatformCredential ?? executorEnv,
|
|
5933
|
+
credentialSource: localPlatformCredential ? "pi_agent_local_platform" : "command_executor_env"
|
|
5934
|
+
};
|
|
5935
|
+
}
|
|
5936
|
+
async function syncPiExecutorProviderConfig(config, command, agentDir, resolvedProviderConfig) {
|
|
5937
|
+
if (!agentDir) return;
|
|
5938
|
+
const { providerConfig, credentialSource } = resolvedProviderConfig;
|
|
5935
5939
|
const modelsSynced = syncAmasterProviderModels(agentDir, providerConfig);
|
|
5936
5940
|
const settingsSynced = syncAmasterProviderSettings(agentDir, providerConfig);
|
|
5937
5941
|
if (modelsSynced || settingsSynced) {
|
|
5938
5942
|
await ingestLog(config, command, "system", "info", "Synced AMaster provider config for pi executor", {
|
|
5939
5943
|
modelsSynced,
|
|
5940
5944
|
settingsSynced,
|
|
5941
|
-
credentialSource
|
|
5945
|
+
credentialSource,
|
|
5942
5946
|
providerBaseUrlConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_BASE_URL)),
|
|
5943
5947
|
defaultModelConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_DEFAULT_MODEL)),
|
|
5944
5948
|
flashModelConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_FLASH_MODEL))
|
|
@@ -7935,7 +7939,7 @@ async function executeRunCommand(config, command) {
|
|
|
7935
7939
|
delete executorEnv.AMASTER_PROVIDER_DEFAULT_MODEL;
|
|
7936
7940
|
delete executorEnv.AMASTER_PROVIDER_FLASH_MODEL;
|
|
7937
7941
|
}
|
|
7938
|
-
|
|
7942
|
+
const resolvedProviderConfig = resolvePiExecutorProviderConfig(config, command, executorEnv);
|
|
7939
7943
|
if (Object.keys(governedMcp).length > 0) {
|
|
7940
7944
|
managedMcpProfile = prepareManagedPiMcpProfile({
|
|
7941
7945
|
commandId: command.commandId,
|
|
@@ -7952,6 +7956,28 @@ async function executeRunCommand(config, command) {
|
|
|
7952
7956
|
extraArgs: splitExtraArgs(process.env.AMASTER_PI_EXTRA_ARGS)
|
|
7953
7957
|
});
|
|
7954
7958
|
cleanupManagedMcpProfile = cleanupManagedPiMcpProfile;
|
|
7959
|
+
try {
|
|
7960
|
+
await syncPiExecutorProviderConfig(
|
|
7961
|
+
config,
|
|
7962
|
+
command,
|
|
7963
|
+
readString(managedMcpProfile.env.PI_CODING_AGENT_DIR) ?? readString(managedMcpProfile.env.PI_AGENT_HOME) ?? null,
|
|
7964
|
+
resolvedProviderConfig
|
|
7965
|
+
);
|
|
7966
|
+
const providerCredential = readString(resolvedProviderConfig.providerConfig.AMASTER_API_KEY);
|
|
7967
|
+
if (providerCredential && !managedMcpProfile.protectedValues.includes(providerCredential)) {
|
|
7968
|
+
managedMcpProfile.protectedValues.push(providerCredential);
|
|
7969
|
+
}
|
|
7970
|
+
} catch (error) {
|
|
7971
|
+
cleanupManagedMcpProfile(managedMcpProfile, {
|
|
7972
|
+
commandId: command.commandId,
|
|
7973
|
+
runId: commandRunId(command)
|
|
7974
|
+
});
|
|
7975
|
+
managedMcpProfile = null;
|
|
7976
|
+
throw error;
|
|
7977
|
+
}
|
|
7978
|
+
} else {
|
|
7979
|
+
const agentDir = piAgentLocalPlatformRunnerEnabled(config) ? readString(executorEnv.PI_AGENT_HOME) ?? readString(executorEnv.PI_CODING_AGENT_DIR) ?? null : readString(executorEnv.PI_CODING_AGENT_DIR) ?? readString(executorEnv.PI_AGENT_HOME) ?? null;
|
|
7980
|
+
await syncPiExecutorProviderConfig(config, command, agentDir, resolvedProviderConfig);
|
|
7955
7981
|
}
|
|
7956
7982
|
}
|
|
7957
7983
|
if (managedMcpProfile) {
|
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.31";
|
|
9
9
|
|
|
10
10
|
const CAPABILITIES = [
|
|
11
11
|
"remote_registration",
|