@amaster.ai/employee-runtime-connector 0.1.1-beta.131 → 0.1.1-beta.132
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.
package/README.md
CHANGED
|
@@ -12,8 +12,7 @@ For production images, install an exact version and invoke the package bin:
|
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
14
|
npm install --omit=dev --prefix /opt/pi-cli-runtime @amaster.ai/employee-runtime-connector@0.1.0
|
|
15
|
-
/opt/pi-cli-runtime/node_modules/.bin/amaster-runtime setup https://employee.example.com
|
|
16
|
-
--capabilities remote_registration,heartbeat,executor_discovery,workspace_binding,run_wakeup,context_envelope_v1,managed_project_instructions_v1,final_model_context_attestation_v1,runtime_actions_v2,run_exit_live_path_closure_v1,model_call,model_call_output_contract_v1,run_cancel,run_terminate,logs_cost_workspace_status
|
|
15
|
+
/opt/pi-cli-runtime/node_modules/.bin/amaster-runtime setup https://employee.example.com
|
|
17
16
|
/opt/pi-cli-runtime/node_modules/.bin/amaster-runtime daemon start --foreground
|
|
18
17
|
```
|
|
19
18
|
|
|
@@ -21,6 +20,15 @@ Do not use `latest`, `^`, or `~` in a runtime image. The image tag and connector
|
|
|
21
20
|
|
|
22
21
|
Immutable images should pin an exact package version as their baseline. The current connector does not download or replace runtime code while running; package upgrades and rollbacks belong to the image build and rollout.
|
|
23
22
|
|
|
23
|
+
Connector capability declaration is automatic. The exact package build declares
|
|
24
|
+
what it implements, and runtime readiness removes dynamic capabilities when their
|
|
25
|
+
executor or supporting runtime is unavailable. Operators restrict what the Server
|
|
26
|
+
accepts with `AMASTER_RUNTIME_CONNECTOR_CAPABILITY_ALLOWLIST`; users do not need to
|
|
27
|
+
configure a connector-local capability list. Historical `AMASTER_CAPABILITIES` and
|
|
28
|
+
`--capabilities` inputs remain accepted for rollback compatibility in this release,
|
|
29
|
+
but are ignored and reported as deprecated. They cannot add, remove, or authorize a
|
|
30
|
+
capability.
|
|
31
|
+
|
|
24
32
|
The publish workflow verifies that npm records the publishing commit as the package `gitHead`, then updates the repository deployment pin. Remote deployment accepts that package only when its `gitHead` is an ancestor of the target source commit and the connector runtime build inputs are unchanged between them. Those inputs are the package path plus `packages/shared/src/source-acquisition-compatibility.json`, which is copied into the published package and bundled into the daemon. If another workspace source becomes a runtime build input, expand the provenance scope and tests before release. After restart, deployment also verifies the package CLI version inside the container. Do not update the deployment pin manually to bypass either provenance check.
|
|
25
33
|
|
|
26
34
|
## Package Contents
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const BUILD_SUPPORTED_CAPABILITIES = Object.freeze([
|
|
2
|
+
"remote_registration",
|
|
3
|
+
"heartbeat",
|
|
4
|
+
"executor_discovery",
|
|
5
|
+
"workspace_binding",
|
|
6
|
+
"run_wakeup",
|
|
7
|
+
"context_envelope_v1",
|
|
8
|
+
"managed_project_instructions_v1",
|
|
9
|
+
"final_model_context_attestation_v1",
|
|
10
|
+
"runtime_actions_v2",
|
|
11
|
+
"run_exit_live_path_closure_v1",
|
|
12
|
+
"model_call",
|
|
13
|
+
"model_call_output_contract_v1",
|
|
14
|
+
"run_cancel",
|
|
15
|
+
"run_terminate",
|
|
16
|
+
"logs_cost_workspace_status",
|
|
17
|
+
"source_acquisition_v1",
|
|
18
|
+
"headed_browser_auth",
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
const DYNAMIC_READINESS = Object.freeze({
|
|
22
|
+
final_model_context_attestation_v1: {
|
|
23
|
+
reasonCode: "managed_pi_executor_required",
|
|
24
|
+
ready: (input) => input.runnerKind === "cloud_managed"
|
|
25
|
+
&& input.executors.some((executor) => executor.kind === "pi"),
|
|
26
|
+
},
|
|
27
|
+
source_acquisition_v1: {
|
|
28
|
+
reasonCode: "source_acquisition_not_ready",
|
|
29
|
+
ready: (input) => input.sourceAcquisition?.ready === true,
|
|
30
|
+
},
|
|
31
|
+
headed_browser_auth: {
|
|
32
|
+
reasonCode: "headed_browser_runtime_not_ready",
|
|
33
|
+
ready: (input) => input.browserSessionBroker?.ready === true,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
function uniqueStrings(values) {
|
|
38
|
+
return Array.from(new Set((Array.isArray(values) ? values : [])
|
|
39
|
+
.map((value) => String(value ?? "").trim())
|
|
40
|
+
.filter(Boolean)));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function buildRuntimeCapabilityReport(input) {
|
|
44
|
+
const legacyConfiguredCapabilities = uniqueStrings(input.legacyConfiguredCapabilities);
|
|
45
|
+
const runtimeUnavailable = [];
|
|
46
|
+
const advertised = BUILD_SUPPORTED_CAPABILITIES.filter((capability) => {
|
|
47
|
+
const readiness = DYNAMIC_READINESS[capability];
|
|
48
|
+
if (!readiness || readiness.ready(input)) return true;
|
|
49
|
+
runtimeUnavailable.push({ capability, reasonCode: readiness.reasonCode });
|
|
50
|
+
return false;
|
|
51
|
+
});
|
|
52
|
+
const buildSet = new Set(BUILD_SUPPORTED_CAPABILITIES);
|
|
53
|
+
const legacySet = new Set(legacyConfiguredCapabilities);
|
|
54
|
+
return {
|
|
55
|
+
schemaVersion: "mirrorx.connector-capability-report/v1",
|
|
56
|
+
source: "build_attested",
|
|
57
|
+
buildSupported: [...BUILD_SUPPORTED_CAPABILITIES],
|
|
58
|
+
runtimeUnavailable,
|
|
59
|
+
advertised,
|
|
60
|
+
deprecatedCapabilityOverridePresent: legacyConfiguredCapabilities.length > 0,
|
|
61
|
+
legacyMissingFromBuildTruth: legacyConfiguredCapabilities.length > 0
|
|
62
|
+
? BUILD_SUPPORTED_CAPABILITIES.filter((capability) => !legacySet.has(capability))
|
|
63
|
+
: [],
|
|
64
|
+
legacyUnsupportedClaims: legacyConfiguredCapabilities.filter((capability) => !buildSet.has(capability)),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -4666,6 +4666,52 @@ var AMASTER_RUNTIME_CONNECTOR_CAPABILITIES = [
|
|
|
4666
4666
|
"headed_browser_auth",
|
|
4667
4667
|
"browser_auth_relay_outbound_e0"
|
|
4668
4668
|
];
|
|
4669
|
+
var TERMINAL_BUSINESS_RECONCILIATION_VERSION = "mirrorx.terminal-business-reconciliation/v1";
|
|
4670
|
+
var terminalBusinessReconciliationAuthoritySnapshotSchema = external_exports.object({
|
|
4671
|
+
outcomeId: external_exports.string().uuid().nullable(),
|
|
4672
|
+
outcomeRevision: external_exports.number().int().positive().nullable(),
|
|
4673
|
+
businessRevision: external_exports.number().int().positive().nullable(),
|
|
4674
|
+
manifestId: external_exports.string().uuid().nullable(),
|
|
4675
|
+
manifestRevision: external_exports.number().int().positive().nullable()
|
|
4676
|
+
}).strict();
|
|
4677
|
+
var terminalBusinessReconciliationSchema = external_exports.discriminatedUnion("outcome", [
|
|
4678
|
+
external_exports.object({
|
|
4679
|
+
outcome: external_exports.literal("finalized"),
|
|
4680
|
+
issueStatus: external_exports.literal("done"),
|
|
4681
|
+
acceptanceId: external_exports.string().uuid()
|
|
4682
|
+
}).strict(),
|
|
4683
|
+
external_exports.object({
|
|
4684
|
+
outcome: external_exports.literal("review_pending"),
|
|
4685
|
+
interactionId: external_exports.string().uuid()
|
|
4686
|
+
}).strict(),
|
|
4687
|
+
external_exports.object({
|
|
4688
|
+
outcome: external_exports.literal("live_path_owned"),
|
|
4689
|
+
owner: external_exports.string().trim().min(1),
|
|
4690
|
+
reasonCode: external_exports.string().trim().min(1)
|
|
4691
|
+
}).strict(),
|
|
4692
|
+
external_exports.object({
|
|
4693
|
+
outcome: external_exports.literal("recoverable_missing_disposition"),
|
|
4694
|
+
reasonCode: external_exports.string().trim().min(1)
|
|
4695
|
+
}).strict(),
|
|
4696
|
+
external_exports.object({
|
|
4697
|
+
outcome: external_exports.literal("blocked_by_gate"),
|
|
4698
|
+
owner: external_exports.string().trim().min(1),
|
|
4699
|
+
reasonCode: external_exports.string().trim().min(1)
|
|
4700
|
+
}).strict(),
|
|
4701
|
+
external_exports.object({
|
|
4702
|
+
outcome: external_exports.literal("missing_authority"),
|
|
4703
|
+
reasonCode: external_exports.string().trim().min(1)
|
|
4704
|
+
}).strict()
|
|
4705
|
+
]);
|
|
4706
|
+
var terminalBusinessReconciliationEnvelopeSchema = external_exports.object({
|
|
4707
|
+
schemaVersion: external_exports.literal(TERMINAL_BUSINESS_RECONCILIATION_VERSION),
|
|
4708
|
+
decisionKey: external_exports.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
4709
|
+
commandId: external_exports.string().uuid(),
|
|
4710
|
+
runId: external_exports.string().uuid(),
|
|
4711
|
+
executionEpoch: external_exports.number().int().positive(),
|
|
4712
|
+
authoritySnapshot: terminalBusinessReconciliationAuthoritySnapshotSchema,
|
|
4713
|
+
decision: terminalBusinessReconciliationSchema
|
|
4714
|
+
}).strict();
|
|
4669
4715
|
var MIRRORX_RUNTIME_CONTEXT_ENVELOPE_VERSION = "mirrorx.context-envelope.v1";
|
|
4670
4716
|
var mirrorxEffectiveInstructionsSchema = external_exports.object({
|
|
4671
4717
|
schemaVersion: external_exports.literal("mirrorx.project-instructions.v1"),
|
|
@@ -24080,7 +24126,9 @@ function agentInstructionDeliveryAudit(bundle, delivery) {
|
|
|
24080
24126
|
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync10, renameSync as renameSync7, rmSync as rmSync6, writeFileSync as writeFileSync8 } from "node:fs";
|
|
24081
24127
|
import { homedir as homedir2, hostname } from "node:os";
|
|
24082
24128
|
import { dirname as dirname7, join as join9 } from "node:path";
|
|
24083
|
-
|
|
24129
|
+
|
|
24130
|
+
// src/amaster-runtime-daemon/capability-registry.mjs
|
|
24131
|
+
var BUILD_SUPPORTED_CAPABILITIES = Object.freeze([
|
|
24084
24132
|
"remote_registration",
|
|
24085
24133
|
"heartbeat",
|
|
24086
24134
|
"executor_discovery",
|
|
@@ -24096,8 +24144,50 @@ var CAPABILITIES = [
|
|
|
24096
24144
|
"run_cancel",
|
|
24097
24145
|
"run_terminate",
|
|
24098
24146
|
"logs_cost_workspace_status",
|
|
24099
|
-
"source_acquisition_v1"
|
|
24100
|
-
|
|
24147
|
+
"source_acquisition_v1",
|
|
24148
|
+
"headed_browser_auth"
|
|
24149
|
+
]);
|
|
24150
|
+
var DYNAMIC_READINESS = Object.freeze({
|
|
24151
|
+
final_model_context_attestation_v1: {
|
|
24152
|
+
reasonCode: "managed_pi_executor_required",
|
|
24153
|
+
ready: (input) => input.runnerKind === "cloud_managed" && input.executors.some((executor) => executor.kind === "pi")
|
|
24154
|
+
},
|
|
24155
|
+
source_acquisition_v1: {
|
|
24156
|
+
reasonCode: "source_acquisition_not_ready",
|
|
24157
|
+
ready: (input) => input.sourceAcquisition?.ready === true
|
|
24158
|
+
},
|
|
24159
|
+
headed_browser_auth: {
|
|
24160
|
+
reasonCode: "headed_browser_runtime_not_ready",
|
|
24161
|
+
ready: (input) => input.browserSessionBroker?.ready === true
|
|
24162
|
+
}
|
|
24163
|
+
});
|
|
24164
|
+
function uniqueStrings2(values) {
|
|
24165
|
+
return Array.from(new Set((Array.isArray(values) ? values : []).map((value) => String(value ?? "").trim()).filter(Boolean)));
|
|
24166
|
+
}
|
|
24167
|
+
function buildRuntimeCapabilityReport(input) {
|
|
24168
|
+
const legacyConfiguredCapabilities = uniqueStrings2(input.legacyConfiguredCapabilities);
|
|
24169
|
+
const runtimeUnavailable = [];
|
|
24170
|
+
const advertised = BUILD_SUPPORTED_CAPABILITIES.filter((capability) => {
|
|
24171
|
+
const readiness = DYNAMIC_READINESS[capability];
|
|
24172
|
+
if (!readiness || readiness.ready(input)) return true;
|
|
24173
|
+
runtimeUnavailable.push({ capability, reasonCode: readiness.reasonCode });
|
|
24174
|
+
return false;
|
|
24175
|
+
});
|
|
24176
|
+
const buildSet = new Set(BUILD_SUPPORTED_CAPABILITIES);
|
|
24177
|
+
const legacySet = new Set(legacyConfiguredCapabilities);
|
|
24178
|
+
return {
|
|
24179
|
+
schemaVersion: "mirrorx.connector-capability-report/v1",
|
|
24180
|
+
source: "build_attested",
|
|
24181
|
+
buildSupported: [...BUILD_SUPPORTED_CAPABILITIES],
|
|
24182
|
+
runtimeUnavailable,
|
|
24183
|
+
advertised,
|
|
24184
|
+
deprecatedCapabilityOverridePresent: legacyConfiguredCapabilities.length > 0,
|
|
24185
|
+
legacyMissingFromBuildTruth: legacyConfiguredCapabilities.length > 0 ? BUILD_SUPPORTED_CAPABILITIES.filter((capability) => !legacySet.has(capability)) : [],
|
|
24186
|
+
legacyUnsupportedClaims: legacyConfiguredCapabilities.filter((capability) => !buildSet.has(capability))
|
|
24187
|
+
};
|
|
24188
|
+
}
|
|
24189
|
+
|
|
24190
|
+
// src/amaster-runtime-daemon/config-state.mjs
|
|
24101
24191
|
var RUNNER_KIND_CLOUD_MANAGED = "cloud_managed";
|
|
24102
24192
|
var RUNNER_KIND_DESKTOP_DELEGATED = "desktop_delegated";
|
|
24103
24193
|
function readEnum(value, allowed, fallback, label) {
|
|
@@ -24279,7 +24369,8 @@ function buildConfig(env = process.env, flags = {}) {
|
|
|
24279
24369
|
piExecutorUid,
|
|
24280
24370
|
piExecutorGid,
|
|
24281
24371
|
runnerKind,
|
|
24282
|
-
capabilities:
|
|
24372
|
+
capabilities: [...BUILD_SUPPORTED_CAPABILITIES],
|
|
24373
|
+
legacyConfiguredCapabilities: splitList(flags.capabilities ?? env.AMASTER_CAPABILITIES ?? ""),
|
|
24283
24374
|
pollIntervalSeconds: Number(flags.pollIntervalSeconds ?? env.AMASTER_POLL_INTERVAL_SECONDS ?? 10),
|
|
24284
24375
|
maxConcurrentCommands: Math.min(
|
|
24285
24376
|
parsePositiveInteger(flags.maxConcurrentCommands ?? env.AMASTER_MAX_CONCURRENT_COMMANDS, 1),
|
|
@@ -28670,7 +28761,7 @@ function createSourceCompletionStopPolicy({
|
|
|
28670
28761
|
}
|
|
28671
28762
|
|
|
28672
28763
|
// src/amaster-runtime-daemon.mjs
|
|
28673
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
28764
|
+
var CONNECTOR_VERSION = "0.1.1-beta.132";
|
|
28674
28765
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
28675
28766
|
var SOURCE_ACQUISITION_CAPABILITY2 = source_acquisition_compatibility_default.profileVersion;
|
|
28676
28767
|
var daemonRequire = createRequire(import.meta.url);
|
|
@@ -29333,12 +29424,19 @@ function browserSessionRuntimeStatus(config) {
|
|
|
29333
29424
|
return broker ? { ...readiness, ...broker.status() } : readiness;
|
|
29334
29425
|
}
|
|
29335
29426
|
function runtimeAdvertisedCapabilities(config, sourceAcquisition, browserSessionBroker) {
|
|
29336
|
-
return
|
|
29427
|
+
return buildRuntimeCapabilityReport({
|
|
29428
|
+
legacyConfiguredCapabilities: config.legacyConfiguredCapabilities,
|
|
29429
|
+
sourceAcquisition,
|
|
29430
|
+
browserSessionBroker,
|
|
29431
|
+
runnerKind: config.runnerKind,
|
|
29432
|
+
executors: config.executors
|
|
29433
|
+
});
|
|
29337
29434
|
}
|
|
29338
29435
|
function buildRegisterPayload(config) {
|
|
29339
29436
|
const buildCommit = readString(process.env.AMASTER_RUNTIME_BUILD_COMMIT ?? process.env.AMASTER_SOURCE_COMMIT);
|
|
29340
29437
|
const sourceAcquisition = sourceAcquisitionRuntimeReadiness(config);
|
|
29341
29438
|
const browserSessionBroker = browserSessionRuntimeReadiness(config);
|
|
29439
|
+
const capabilityReport = runtimeAdvertisedCapabilities(config, sourceAcquisition, browserSessionBroker);
|
|
29342
29440
|
return {
|
|
29343
29441
|
...config.companyId ? { companyId: config.companyId } : {},
|
|
29344
29442
|
connectorName: config.connectorName,
|
|
@@ -29346,7 +29444,7 @@ function buildRegisterPayload(config) {
|
|
|
29346
29444
|
workspaceBindings: config.workspaceBindings,
|
|
29347
29445
|
networkDomains: config.networkDomains,
|
|
29348
29446
|
executors: config.executors,
|
|
29349
|
-
capabilities:
|
|
29447
|
+
capabilities: capabilityReport.advertised,
|
|
29350
29448
|
contractVersion: CONNECTOR_CONTRACT_VERSION,
|
|
29351
29449
|
connectorVersion: CONNECTOR_VERSION,
|
|
29352
29450
|
...buildCommit ? { buildCommit } : {},
|
|
@@ -29359,7 +29457,12 @@ function buildRegisterPayload(config) {
|
|
|
29359
29457
|
authMode: config.token ? "bearer_token" : config.authHeader ? "custom_header" : "none",
|
|
29360
29458
|
platform: process.platform,
|
|
29361
29459
|
arch: process.arch,
|
|
29362
|
-
node: process.version
|
|
29460
|
+
node: process.version,
|
|
29461
|
+
capabilityReport: {
|
|
29462
|
+
...capabilityReport,
|
|
29463
|
+
connectorVersion: CONNECTOR_VERSION,
|
|
29464
|
+
...buildCommit ? { connectorDigest: `build:${buildCommit}` } : {}
|
|
29465
|
+
}
|
|
29363
29466
|
}
|
|
29364
29467
|
};
|
|
29365
29468
|
}
|
|
@@ -29393,6 +29496,7 @@ function buildHeartbeatPayload(config, options = {}) {
|
|
|
29393
29496
|
const executorReadiness = buildExecutorReadiness(config);
|
|
29394
29497
|
const sourceAcquisition = sourceAcquisitionRuntimeReadiness(config);
|
|
29395
29498
|
const browserSessionBroker = browserSessionRuntimeStatus(config);
|
|
29499
|
+
const capabilityReport = runtimeAdvertisedCapabilities(config, sourceAcquisition, browserSessionBroker);
|
|
29396
29500
|
const status = options.status === "offline" ? "offline" : "online";
|
|
29397
29501
|
const daemonStatus = status === "offline" ? "stopping" : "running";
|
|
29398
29502
|
return {
|
|
@@ -29400,7 +29504,7 @@ function buildHeartbeatPayload(config, options = {}) {
|
|
|
29400
29504
|
workspaceBindings: config.workspaceBindings,
|
|
29401
29505
|
networkDomains: config.networkDomains,
|
|
29402
29506
|
executors: config.executors,
|
|
29403
|
-
capabilities:
|
|
29507
|
+
capabilities: capabilityReport.advertised,
|
|
29404
29508
|
connectorVersion: CONNECTOR_VERSION,
|
|
29405
29509
|
...buildCommit ? { buildCommit } : {},
|
|
29406
29510
|
contractVersion: CONNECTOR_CONTRACT_VERSION,
|
|
@@ -29426,7 +29530,12 @@ function buildHeartbeatPayload(config, options = {}) {
|
|
|
29426
29530
|
...versionDrift.versionDrift || versionDrift.bundleDrift ? versionDrift : {}
|
|
29427
29531
|
},
|
|
29428
29532
|
metadata: {
|
|
29429
|
-
authMode: config.token ? "bearer_token" : config.authHeader ? "custom_header" : "none"
|
|
29533
|
+
authMode: config.token ? "bearer_token" : config.authHeader ? "custom_header" : "none",
|
|
29534
|
+
capabilityReport: {
|
|
29535
|
+
...capabilityReport,
|
|
29536
|
+
connectorVersion: CONNECTOR_VERSION,
|
|
29537
|
+
...buildCommit ? { connectorDigest: `build:${buildCommit}` } : {}
|
|
29538
|
+
}
|
|
29430
29539
|
}
|
|
29431
29540
|
};
|
|
29432
29541
|
}
|
|
@@ -29593,7 +29702,6 @@ AMASTER_CONNECTOR_NAME=${quoteShell(config.connectorName)}
|
|
|
29593
29702
|
AMASTER_MACHINE_ID=${quoteShell(config.machineId)}
|
|
29594
29703
|
AMASTER_WORKSPACE_ALLOWLIST=${quoteShell(config.workspaceBindings.join(","))}
|
|
29595
29704
|
AMASTER_EXECUTORS=${quoteShell(executorEnv)}
|
|
29596
|
-
AMASTER_CAPABILITIES=${quoteShell(config.capabilities.join(","))}
|
|
29597
29705
|
AMASTER_NETWORK_DOMAINS=${quoteShell(config.networkDomains.join(","))}
|
|
29598
29706
|
AMASTER_DAEMON_STATE_FILE=${quoteShell(join16(homedir3(), ".amaster-employee", "runtime-connector-state.json"))}
|
|
29599
29707
|
EOF
|
|
@@ -34508,6 +34616,7 @@ async function executeRunCommand(config, command) {
|
|
|
34508
34616
|
parsed.errorMessage = null;
|
|
34509
34617
|
}
|
|
34510
34618
|
if (succeeded && managedMcpProfile && Array.isArray(command.requiredCapabilities) && command.requiredCapabilities.includes("runtime_actions_v2")) {
|
|
34619
|
+
const usesLivePathClosureContract = command.requiredCapabilities.includes("run_exit_live_path_closure_v1");
|
|
34511
34620
|
const productiveSuccessfulRun = outputTelemetry.meaningfulProgressEventCount > 0 || runtimeArtifacts.length > 0 || mcpToolResults.some((toolResult) => ["succeeded", "approval_required"].includes(readString(toolResult.status)));
|
|
34512
34621
|
let completionState = createRunCompletionState({
|
|
34513
34622
|
connectorId: requireConnectorId(config),
|
|
@@ -34540,13 +34649,13 @@ async function executeRunCommand(config, command) {
|
|
|
34540
34649
|
}
|
|
34541
34650
|
},
|
|
34542
34651
|
completionRequest: {
|
|
34543
|
-
contractVersion:
|
|
34652
|
+
contractVersion: usesLivePathClosureContract ? "amaster.runtime-connector.completion-check.v2" : "amaster.runtime-connector.completion-check.v1",
|
|
34544
34653
|
leaseId: command.leaseId,
|
|
34545
34654
|
proposedStatus: "succeeded",
|
|
34546
34655
|
resultSignals: {
|
|
34547
34656
|
productiveSuccessfulRun,
|
|
34548
34657
|
executorTurnCount: terminalTextRepairUsageBreakdown ? 2 : 1,
|
|
34549
|
-
...
|
|
34658
|
+
...usesLivePathClosureContract ? {
|
|
34550
34659
|
closureAttempts: {
|
|
34551
34660
|
workDisposition: 0,
|
|
34552
34661
|
livePath: 0,
|
|
@@ -34893,7 +35002,7 @@ Commands:
|
|
|
34893
35002
|
|
|
34894
35003
|
Key env:
|
|
34895
35004
|
AMASTER_EMPLOYEE_SERVER_URL, AMASTER_CONNECTOR_TOKEN or AMASTER_CONNECTOR_AUTH_HEADER,
|
|
34896
|
-
AMASTER_WORKSPACE_ALLOWLIST, AMASTER_EXECUTORS,
|
|
35005
|
+
AMASTER_WORKSPACE_ALLOWLIST, AMASTER_EXECUTORS,
|
|
34897
35006
|
AMASTER_NETWORK_DOMAINS, AMASTER_CONNECTOR_ID, AMASTER_DAEMON_STATE_FILE,
|
|
34898
35007
|
AMASTER_MAX_CONCURRENT_COMMANDS, AMASTER_EXECUTOR_MAX_RSS_MB (default 0, disabled),
|
|
34899
35008
|
AMASTER_RUNTIME_ORPHAN_REAPER_INTERVAL_SECONDS (default 300, set 0 to disable),
|
|
@@ -34903,6 +35012,11 @@ Key env:
|
|
|
34903
35012
|
async function main() {
|
|
34904
35013
|
const { command, flags } = parseArgs(process.argv.slice(2));
|
|
34905
35014
|
const config = buildConfig(process.env, flags);
|
|
35015
|
+
if (config.legacyConfiguredCapabilities.length > 0) {
|
|
35016
|
+
process.stderr.write(
|
|
35017
|
+
"Warning: AMASTER_CAPABILITIES/--capabilities is deprecated and ignored; use the Server capability allowlist for operator restrictions.\n"
|
|
35018
|
+
);
|
|
35019
|
+
}
|
|
34906
35020
|
switch (command) {
|
|
34907
35021
|
case "config-template":
|
|
34908
35022
|
printInstall(config);
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -5,26 +5,9 @@ import { randomUUID } from "node:crypto";
|
|
|
5
5
|
import { basename, dirname, join, resolve } from "node:path";
|
|
6
6
|
import { homedir, hostname } from "node:os";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { BUILD_SUPPORTED_CAPABILITIES } from "./amaster-runtime-daemon/capability-registry.mjs";
|
|
8
9
|
|
|
9
|
-
const CONNECTOR_VERSION = "0.1.1-beta.
|
|
10
|
-
|
|
11
|
-
const CAPABILITIES = [
|
|
12
|
-
"remote_registration",
|
|
13
|
-
"heartbeat",
|
|
14
|
-
"executor_discovery",
|
|
15
|
-
"workspace_binding",
|
|
16
|
-
"run_wakeup",
|
|
17
|
-
"context_envelope_v1", "managed_project_instructions_v1",
|
|
18
|
-
"final_model_context_attestation_v1",
|
|
19
|
-
"runtime_actions_v2",
|
|
20
|
-
"run_exit_live_path_closure_v1",
|
|
21
|
-
"model_call",
|
|
22
|
-
"model_call_output_contract_v1",
|
|
23
|
-
"run_cancel",
|
|
24
|
-
"run_terminate",
|
|
25
|
-
"logs_cost_workspace_status",
|
|
26
|
-
"source_acquisition_v1",
|
|
27
|
-
];
|
|
10
|
+
const CONNECTOR_VERSION = "0.1.1-beta.132";
|
|
28
11
|
|
|
29
12
|
const CONFIG_KEY_MAP = new Map([
|
|
30
13
|
["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
|
|
@@ -257,7 +240,6 @@ function withDefaults(config) {
|
|
|
257
240
|
AMASTER_CONNECTOR_NAME: `${hostname()}-amaster`,
|
|
258
241
|
AMASTER_MACHINE_ID: defaultMachineId(),
|
|
259
242
|
AMASTER_WORKSPACE_ALLOWLIST: runtimeWorkspacesRoot,
|
|
260
|
-
AMASTER_CAPABILITIES: CAPABILITIES.join(","),
|
|
261
243
|
AMASTER_NETWORK_DOMAINS: "self-host",
|
|
262
244
|
AMASTER_DAEMON_STATE_FILE: join(configDir, "runtime-connector-state.json"),
|
|
263
245
|
AMASTER_RUNTIME_WORKSPACES_ROOT: runtimeWorkspacesRoot,
|
|
@@ -463,7 +445,8 @@ function printConfig(config) {
|
|
|
463
445
|
["runner_kind", merged.AMASTER_RUNTIME_RUNNER_KIND || "cloud_managed"],
|
|
464
446
|
["heartbeat_log_mode", merged.AMASTER_HEARTBEAT_LOG_MODE || "(compact)"],
|
|
465
447
|
["network_domains", merged.AMASTER_NETWORK_DOMAINS],
|
|
466
|
-
["
|
|
448
|
+
["capability_source", `connector build (${BUILD_SUPPORTED_CAPABILITIES.length}) + runtime readiness`],
|
|
449
|
+
["legacy_capabilities", merged.AMASTER_CAPABILITIES ? "(deprecated; ignored)" : "(none)"],
|
|
467
450
|
["state_file", merged.AMASTER_DAEMON_STATE_FILE],
|
|
468
451
|
["env_file", envFile],
|
|
469
452
|
];
|
|
@@ -498,7 +481,12 @@ function commandSetup(argv) {
|
|
|
498
481
|
config.AMASTER_MACHINE_ID = flags.machine_id || defaultConfig.AMASTER_MACHINE_ID;
|
|
499
482
|
config.AMASTER_RUNTIME_WORKSPACES_ROOT = flags.runtime_workspaces_root || defaultConfig.AMASTER_RUNTIME_WORKSPACES_ROOT;
|
|
500
483
|
config.AMASTER_WORKSPACE_ALLOWLIST = flags.workspace_allowlist || flags.workspace || defaultConfig.AMASTER_WORKSPACE_ALLOWLIST;
|
|
501
|
-
|
|
484
|
+
if (flags.capabilities) {
|
|
485
|
+
config.AMASTER_CAPABILITIES = flags.capabilities;
|
|
486
|
+
process.stderr.write(
|
|
487
|
+
"Warning: --capabilities is deprecated and ignored; restrict accepted capabilities with the Server allowlist.\n",
|
|
488
|
+
);
|
|
489
|
+
}
|
|
502
490
|
config.AMASTER_NETWORK_DOMAINS = flags.network_domains || defaultConfig.AMASTER_NETWORK_DOMAINS;
|
|
503
491
|
config.AMASTER_DAEMON_STATE_FILE = flags.state_file || defaultConfig.AMASTER_DAEMON_STATE_FILE;
|
|
504
492
|
if (flags.executors) config.AMASTER_EXECUTORS = flags.executors;
|
|
@@ -528,6 +516,11 @@ function commandConfig(argv) {
|
|
|
528
516
|
const envKey = envKeyFor(key);
|
|
529
517
|
const value = valueParts.join(" ").trim();
|
|
530
518
|
config[envKey] = envKey === "AMASTER_EMPLOYEE_SERVER_URL" ? normalizeServerUrl(value) : value;
|
|
519
|
+
if (envKey === "AMASTER_CAPABILITIES") {
|
|
520
|
+
process.stderr.write(
|
|
521
|
+
"Warning: connector-local capabilities are deprecated and ignored; restrict accepted capabilities with the Server allowlist.\n",
|
|
522
|
+
);
|
|
523
|
+
}
|
|
531
524
|
writeConfig(config);
|
|
532
525
|
process.stdout.write(`${normalizeKey(key)} updated\n`);
|
|
533
526
|
}
|