@amaster.ai/employee-runtime-connector 0.1.1-beta.2 → 0.1.1-beta.3
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.
|
@@ -1593,8 +1593,6 @@ var MANAGED_PI_PROVIDER_ENV_NAMES = Object.freeze([
|
|
|
1593
1593
|
"AMASTER_MODEL_CREDENTIAL_REF",
|
|
1594
1594
|
"AMASTER_API_KEY",
|
|
1595
1595
|
"AMASTER_PROVIDER_BASE_URL",
|
|
1596
|
-
"AMASTER_PROVIDER_DEFAULT_MODEL",
|
|
1597
|
-
"AMASTER_PROVIDER_FLASH_MODEL",
|
|
1598
1596
|
"AMASTER_PLATFORM_OAUTH_TOKEN",
|
|
1599
1597
|
"AMASTER_PLATFORM_ORGANIZATION_ID",
|
|
1600
1598
|
"AMASTER_BILLING_TURN_ID"
|
|
@@ -1636,28 +1634,6 @@ function imageGenBaseUrlFromProviderBaseUrl(value) {
|
|
|
1636
1634
|
return input.replace(/\/v1\/?$/, "");
|
|
1637
1635
|
}
|
|
1638
1636
|
}
|
|
1639
|
-
function ensureAmasterProviderModel(models, modelId, flash) {
|
|
1640
|
-
const id = readString(modelId);
|
|
1641
|
-
if (!id) return;
|
|
1642
|
-
const existing = Array.isArray(models) ? models : [];
|
|
1643
|
-
const index = existing.findIndex((entry) => asRecord(entry).id === id);
|
|
1644
|
-
if (index >= 0) {
|
|
1645
|
-
existing[index] = {
|
|
1646
|
-
...asRecord(existing[index]),
|
|
1647
|
-
id,
|
|
1648
|
-
input: readStringArray(asRecord(existing[index]).input).length > 0 ? asRecord(existing[index]).input : ["text", "image"],
|
|
1649
|
-
reasoning: asRecord(existing[index]).reasoning ?? true,
|
|
1650
|
-
...flash ? { flash: true } : {}
|
|
1651
|
-
};
|
|
1652
|
-
return;
|
|
1653
|
-
}
|
|
1654
|
-
existing.push({
|
|
1655
|
-
id,
|
|
1656
|
-
input: ["text", "image"],
|
|
1657
|
-
reasoning: true,
|
|
1658
|
-
...flash ? { flash: true } : {}
|
|
1659
|
-
});
|
|
1660
|
-
}
|
|
1661
1637
|
function withoutManagedBillingHeaders(value) {
|
|
1662
1638
|
const headers = { ...asRecord(value) };
|
|
1663
1639
|
for (const name of Object.keys(AMASTER_BILLING_HEADER_ENV_REFERENCES)) {
|
|
@@ -1689,10 +1665,6 @@ function syncAmasterProviderModels(agentDir, executorEnv) {
|
|
|
1689
1665
|
const headers = syncManagedBillingHeaders(amaster.headers, executorEnv);
|
|
1690
1666
|
if (headers) amaster.headers = headers;
|
|
1691
1667
|
else delete amaster.headers;
|
|
1692
|
-
const models = Array.isArray(amaster.models) ? [...amaster.models] : [];
|
|
1693
|
-
ensureAmasterProviderModel(models, executorEnv.AMASTER_PROVIDER_DEFAULT_MODEL, false);
|
|
1694
|
-
ensureAmasterProviderModel(models, executorEnv.AMASTER_PROVIDER_FLASH_MODEL, true);
|
|
1695
|
-
if (models.length > 0) amaster.models = models;
|
|
1696
1668
|
writeJsonFileAtomic(modelsPath, {
|
|
1697
1669
|
...config,
|
|
1698
1670
|
providers: {
|
|
@@ -1709,19 +1681,8 @@ function syncAmasterProviderSettings(agentDir, executorEnv) {
|
|
|
1709
1681
|
if (!existsSync2(settingsPath)) return false;
|
|
1710
1682
|
const settings = readJsonFile(settingsPath);
|
|
1711
1683
|
const baseUrl = readString(executorEnv.AMASTER_PROVIDER_BASE_URL);
|
|
1712
|
-
const defaultModel = readString(executorEnv.AMASTER_PROVIDER_DEFAULT_MODEL);
|
|
1713
1684
|
const imageGenBaseUrl = imageGenBaseUrlFromProviderBaseUrl(baseUrl);
|
|
1714
1685
|
let changed = false;
|
|
1715
|
-
if (defaultModel) {
|
|
1716
|
-
if (settings.defaultProvider !== "amaster") {
|
|
1717
|
-
settings.defaultProvider = "amaster";
|
|
1718
|
-
changed = true;
|
|
1719
|
-
}
|
|
1720
|
-
if (settings.defaultModel !== defaultModel) {
|
|
1721
|
-
settings.defaultModel = defaultModel;
|
|
1722
|
-
changed = true;
|
|
1723
|
-
}
|
|
1724
|
-
}
|
|
1725
1686
|
const imageGen = settings["pi-image-gen"];
|
|
1726
1687
|
if (isRecord(imageGen) && isRecord(imageGen.customProviders) && isRecord(imageGen.customProviders.amaster)) {
|
|
1727
1688
|
const customProviders = imageGen.customProviders;
|
|
@@ -8210,7 +8171,7 @@ function assertSourceAcquisitionRuntimeAuthority({
|
|
|
8210
8171
|
}
|
|
8211
8172
|
|
|
8212
8173
|
// src/amaster-runtime-daemon.mjs
|
|
8213
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
8174
|
+
var CONNECTOR_VERSION = "0.1.1-beta.3";
|
|
8214
8175
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
8215
8176
|
var SOURCE_ACQUISITION_CAPABILITY = "source_acquisition_v1";
|
|
8216
8177
|
var SOURCE_ACQUISITION_PROFILE_VERSION = "source_acquisition_v1";
|
|
@@ -8934,9 +8895,7 @@ function readPiAgentLocalPlatformCredential(credentialsDir) {
|
|
|
8934
8895
|
return {
|
|
8935
8896
|
organizationId,
|
|
8936
8897
|
apiKey,
|
|
8937
|
-
...readString(credential.baseUrl) ? { baseUrl: readString(credential.baseUrl) } : {}
|
|
8938
|
-
...readString(credential.defaultModel) ? { defaultModel: readString(credential.defaultModel) } : {},
|
|
8939
|
-
...readString(credential.flashModel) ? { flashModel: readString(credential.flashModel) } : {}
|
|
8898
|
+
...readString(credential.baseUrl) ? { baseUrl: readString(credential.baseUrl) } : {}
|
|
8940
8899
|
};
|
|
8941
8900
|
}
|
|
8942
8901
|
function piAgentLocalPlatformCredentials(config) {
|
|
@@ -9557,9 +9516,7 @@ async function syncPiExecutorProviderConfig(config, command, agentDir, resolvedP
|
|
|
9557
9516
|
modelsSynced,
|
|
9558
9517
|
settingsSynced,
|
|
9559
9518
|
credentialSource,
|
|
9560
|
-
providerBaseUrlConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_BASE_URL))
|
|
9561
|
-
defaultModelConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_DEFAULT_MODEL)),
|
|
9562
|
-
flashModelConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_FLASH_MODEL))
|
|
9519
|
+
providerBaseUrlConfigured: Boolean(readString(providerConfig.AMASTER_PROVIDER_BASE_URL))
|
|
9563
9520
|
});
|
|
9564
9521
|
}
|
|
9565
9522
|
}
|
|
@@ -9573,9 +9530,7 @@ function piAgentLocalPlatformCredentialForCommand(config, command) {
|
|
|
9573
9530
|
if (!credential) return null;
|
|
9574
9531
|
return {
|
|
9575
9532
|
AMASTER_API_KEY: credential.apiKey,
|
|
9576
|
-
...credential.baseUrl ? { AMASTER_PROVIDER_BASE_URL: credential.baseUrl } : {}
|
|
9577
|
-
...credential.defaultModel ? { AMASTER_PROVIDER_DEFAULT_MODEL: credential.defaultModel } : {},
|
|
9578
|
-
...credential.flashModel ? { AMASTER_PROVIDER_FLASH_MODEL: credential.flashModel } : {}
|
|
9533
|
+
...credential.baseUrl ? { AMASTER_PROVIDER_BASE_URL: credential.baseUrl } : {}
|
|
9579
9534
|
};
|
|
9580
9535
|
}
|
|
9581
9536
|
function normalizeWorkspaceContext(workspace) {
|
|
@@ -12647,8 +12602,6 @@ async function executeRunCommand(config, command) {
|
|
|
12647
12602
|
if (piAgentLocalPlatformRunnerEnabled(config)) {
|
|
12648
12603
|
delete executorEnv.AMASTER_API_KEY;
|
|
12649
12604
|
delete executorEnv.AMASTER_PROVIDER_BASE_URL;
|
|
12650
|
-
delete executorEnv.AMASTER_PROVIDER_DEFAULT_MODEL;
|
|
12651
|
-
delete executorEnv.AMASTER_PROVIDER_FLASH_MODEL;
|
|
12652
12605
|
}
|
|
12653
12606
|
piResolvedProviderConfig = resolvePiExecutorProviderConfig(config, command, executorEnv);
|
|
12654
12607
|
for (const envName of ["AMASTER_API_KEY", "AMASTER_PLATFORM_OAUTH_TOKEN"]) {
|
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.1-beta.
|
|
8
|
+
const CONNECTOR_VERSION = "0.1.1-beta.3";
|
|
9
9
|
|
|
10
10
|
const CAPABILITIES = [
|
|
11
11
|
"remote_registration",
|