@amaster.ai/employee-runtime-connector 0.1.1-beta.131 → 0.1.1-beta.133
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"),
|
|
@@ -5185,6 +5231,165 @@ var amasterRuntimeConnectorWorkspaceStatusIngestSchema = external_exports.object
|
|
|
5185
5231
|
metadata: external_exports.record(external_exports.unknown()).default({})
|
|
5186
5232
|
});
|
|
5187
5233
|
|
|
5234
|
+
// ../shared/src/issue-live-path.ts
|
|
5235
|
+
var ISSUE_LIVE_PATH_KINDS = [
|
|
5236
|
+
"execution",
|
|
5237
|
+
"continuation",
|
|
5238
|
+
"scheduled_monitor",
|
|
5239
|
+
"external_wait",
|
|
5240
|
+
"pending_interaction",
|
|
5241
|
+
"pending_approval",
|
|
5242
|
+
"dependency_wait",
|
|
5243
|
+
"recovery"
|
|
5244
|
+
];
|
|
5245
|
+
var ISSUE_LIVE_PATH_STATES = ["current", "superseded", "released"];
|
|
5246
|
+
var issueLivePathKindSchema = external_exports.enum(ISSUE_LIVE_PATH_KINDS);
|
|
5247
|
+
var issueLivePathStateSchema = external_exports.enum(ISSUE_LIVE_PATH_STATES);
|
|
5248
|
+
var issueLivePathOwnerRefSchema = external_exports.discriminatedUnion("kind", [
|
|
5249
|
+
external_exports.object({ kind: external_exports.literal("run"), id: external_exports.string().uuid() }).strict(),
|
|
5250
|
+
external_exports.object({ kind: external_exports.literal("runtime_command"), id: external_exports.string().uuid() }).strict(),
|
|
5251
|
+
external_exports.object({ kind: external_exports.literal("wakeup_request"), id: external_exports.string().uuid() }).strict(),
|
|
5252
|
+
external_exports.object({ kind: external_exports.literal("continuation_intent"), id: external_exports.string().uuid() }).strict(),
|
|
5253
|
+
external_exports.object({ kind: external_exports.literal("monitor"), id: external_exports.string().uuid() }).strict(),
|
|
5254
|
+
external_exports.object({ kind: external_exports.literal("external_wait"), id: external_exports.string().min(1) }).strict(),
|
|
5255
|
+
external_exports.object({ kind: external_exports.literal("interaction"), id: external_exports.string().uuid() }).strict(),
|
|
5256
|
+
external_exports.object({ kind: external_exports.literal("approval"), id: external_exports.string().uuid() }).strict(),
|
|
5257
|
+
external_exports.object({ kind: external_exports.literal("dependency"), id: external_exports.string().uuid() }).strict(),
|
|
5258
|
+
external_exports.object({ kind: external_exports.literal("recovery_action"), id: external_exports.string().uuid() }).strict()
|
|
5259
|
+
]);
|
|
5260
|
+
var OWNER_KINDS_BY_PATH = {
|
|
5261
|
+
execution: ["run", "runtime_command", "wakeup_request"],
|
|
5262
|
+
continuation: ["continuation_intent"],
|
|
5263
|
+
scheduled_monitor: ["monitor"],
|
|
5264
|
+
external_wait: ["external_wait"],
|
|
5265
|
+
pending_interaction: ["interaction"],
|
|
5266
|
+
pending_approval: ["approval"],
|
|
5267
|
+
dependency_wait: ["dependency"],
|
|
5268
|
+
recovery: ["recovery_action"]
|
|
5269
|
+
};
|
|
5270
|
+
var issueLivePathTransitionInputSchema = external_exports.object({
|
|
5271
|
+
companyId: external_exports.string().uuid(),
|
|
5272
|
+
issueId: external_exports.string().uuid(),
|
|
5273
|
+
executionEpoch: external_exports.number().int().positive(),
|
|
5274
|
+
toKind: issueLivePathKindSchema,
|
|
5275
|
+
ownerRef: issueLivePathOwnerRefSchema,
|
|
5276
|
+
expectedAuthorityRevision: external_exports.number().int().nonnegative(),
|
|
5277
|
+
idempotencyIdentity: external_exports.string().min(1).max(512),
|
|
5278
|
+
requestHash: external_exports.string().regex(/^sha256:[a-f0-9]{64}$/)
|
|
5279
|
+
}).strict().superRefine((input, context) => {
|
|
5280
|
+
const allowedOwnerKinds = OWNER_KINDS_BY_PATH[input.toKind];
|
|
5281
|
+
if (!allowedOwnerKinds.includes(input.ownerRef.kind)) {
|
|
5282
|
+
context.addIssue({
|
|
5283
|
+
code: external_exports.ZodIssueCode.custom,
|
|
5284
|
+
path: ["ownerRef", "kind"],
|
|
5285
|
+
message: `${input.ownerRef.kind} cannot own ${input.toKind}`
|
|
5286
|
+
});
|
|
5287
|
+
}
|
|
5288
|
+
});
|
|
5289
|
+
var issueLivePathClaimSchema = external_exports.object({
|
|
5290
|
+
id: external_exports.string().uuid(),
|
|
5291
|
+
companyId: external_exports.string().uuid(),
|
|
5292
|
+
issueId: external_exports.string().uuid(),
|
|
5293
|
+
executionEpoch: external_exports.number().int().positive(),
|
|
5294
|
+
state: issueLivePathStateSchema,
|
|
5295
|
+
kind: issueLivePathKindSchema,
|
|
5296
|
+
ownerRef: issueLivePathOwnerRefSchema,
|
|
5297
|
+
authorityRevision: external_exports.number().int().positive(),
|
|
5298
|
+
idempotencyIdentity: external_exports.string().min(1),
|
|
5299
|
+
requestHash: external_exports.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
5300
|
+
committedAt: external_exports.string().datetime({ offset: true }),
|
|
5301
|
+
supersededAt: external_exports.string().datetime({ offset: true }).nullable(),
|
|
5302
|
+
releasedAt: external_exports.string().datetime({ offset: true }).nullable()
|
|
5303
|
+
}).strict();
|
|
5304
|
+
var issueLivePathReleaseInputSchema = external_exports.object({
|
|
5305
|
+
companyId: external_exports.string().uuid(),
|
|
5306
|
+
issueId: external_exports.string().uuid(),
|
|
5307
|
+
executionEpoch: external_exports.number().int().positive(),
|
|
5308
|
+
expectedAuthorityRevision: external_exports.number().int().positive(),
|
|
5309
|
+
idempotencyIdentity: external_exports.string().min(1).max(512),
|
|
5310
|
+
requestHash: external_exports.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
5311
|
+
terminalReceipt: external_exports.record(external_exports.unknown())
|
|
5312
|
+
}).strict();
|
|
5313
|
+
|
|
5314
|
+
// ../shared/src/company-cold-start.ts
|
|
5315
|
+
var COMPANY_COLD_START_PHASES = [
|
|
5316
|
+
"not_started",
|
|
5317
|
+
"awaiting_strategy_confirmation",
|
|
5318
|
+
"preparing_workset",
|
|
5319
|
+
"executing_workset",
|
|
5320
|
+
"evaluating_admission",
|
|
5321
|
+
"admitted",
|
|
5322
|
+
"interrupted"
|
|
5323
|
+
];
|
|
5324
|
+
var COMPANY_STAGES = [
|
|
5325
|
+
"initialization",
|
|
5326
|
+
"strategy_confirmation",
|
|
5327
|
+
"cold_start",
|
|
5328
|
+
"operating",
|
|
5329
|
+
"needs_attention"
|
|
5330
|
+
];
|
|
5331
|
+
var COLD_START_STAGES = [
|
|
5332
|
+
"awaiting_strategy_confirmation",
|
|
5333
|
+
"running",
|
|
5334
|
+
"admitted",
|
|
5335
|
+
"interrupted"
|
|
5336
|
+
];
|
|
5337
|
+
var COMPANY_COLD_START_ACTIONS = [
|
|
5338
|
+
"complete_initialization",
|
|
5339
|
+
"review_strategy",
|
|
5340
|
+
"submit_cold_start_workset",
|
|
5341
|
+
"advance_cold_start_tasks",
|
|
5342
|
+
"evaluate_operating_admission",
|
|
5343
|
+
"operate",
|
|
5344
|
+
"repair_cold_start_invariant"
|
|
5345
|
+
];
|
|
5346
|
+
var COMPANY_COLD_START_FACT_SLOTS = [
|
|
5347
|
+
"goal_metric_baseline",
|
|
5348
|
+
"customer_problem_evidence",
|
|
5349
|
+
"offer_delivery_baseline",
|
|
5350
|
+
"operating_risk_baseline",
|
|
5351
|
+
"near_term_priority_ownership",
|
|
5352
|
+
"reusable_company_artifact"
|
|
5353
|
+
];
|
|
5354
|
+
var companyColdStartPhaseSchema = external_exports.enum(COMPANY_COLD_START_PHASES);
|
|
5355
|
+
var companyStageSchema = external_exports.enum(COMPANY_STAGES);
|
|
5356
|
+
var coldStartStageSchema = external_exports.enum(COLD_START_STAGES);
|
|
5357
|
+
var coldStartExpectedActionSchema = external_exports.enum(COMPANY_COLD_START_ACTIONS);
|
|
5358
|
+
var companyColdStartFactSlotSchema = external_exports.enum(COMPANY_COLD_START_FACT_SLOTS);
|
|
5359
|
+
var companyColdStartWorksetItemDispositionSchema = external_exports.enum([
|
|
5360
|
+
"pending",
|
|
5361
|
+
"accepted_outcome",
|
|
5362
|
+
"external_wait",
|
|
5363
|
+
"scheduled_monitor",
|
|
5364
|
+
"deferred_operating_dependency",
|
|
5365
|
+
"cancelled"
|
|
5366
|
+
]);
|
|
5367
|
+
var companyColdStartWorksetItemReadSchema = external_exports.object({
|
|
5368
|
+
id: external_exports.string().uuid(),
|
|
5369
|
+
issueId: external_exports.string().uuid(),
|
|
5370
|
+
enrollmentId: external_exports.string().uuid(),
|
|
5371
|
+
priorityOrder: external_exports.number().int().positive(),
|
|
5372
|
+
factSlots: external_exports.array(companyColdStartFactSlotSchema).min(1),
|
|
5373
|
+
disposition: companyColdStartWorksetItemDispositionSchema,
|
|
5374
|
+
dispositionReceiptId: external_exports.string().min(1).max(512).nullable()
|
|
5375
|
+
}).strict();
|
|
5376
|
+
var companyColdStartWorksetReadSchema = external_exports.object({
|
|
5377
|
+
id: external_exports.string().uuid(),
|
|
5378
|
+
companyId: external_exports.string().uuid(),
|
|
5379
|
+
strategyRevisionId: external_exports.string().uuid(),
|
|
5380
|
+
goalId: external_exports.string().uuid(),
|
|
5381
|
+
organizationVersion: external_exports.number().int().nonnegative(),
|
|
5382
|
+
authorityRevision: external_exports.number().int().positive(),
|
|
5383
|
+
priorityIssueId: external_exports.string().uuid(),
|
|
5384
|
+
items: external_exports.array(companyColdStartWorksetItemReadSchema).min(1)
|
|
5385
|
+
}).strict();
|
|
5386
|
+
var companyColdStartAdmissionReadSchema = external_exports.object({
|
|
5387
|
+
admitted: external_exports.boolean(),
|
|
5388
|
+
receiptId: external_exports.string().uuid().nullable(),
|
|
5389
|
+
missingFactSlots: external_exports.array(companyColdStartFactSlotSchema),
|
|
5390
|
+
blockingItemIds: external_exports.array(external_exports.string().uuid())
|
|
5391
|
+
}).strict();
|
|
5392
|
+
|
|
5188
5393
|
// ../shared/src/amaster-runtime-command-outcome.ts
|
|
5189
5394
|
var AMASTER_RUNTIME_EXPECTED_DISPOSITION_VERSION = "mirrorx.expected-run-disposition/v1";
|
|
5190
5395
|
var AMASTER_RUNTIME_ORGANIZATION_MUTATION_AUTHORIZATION_PURPOSE = "runtime_action_authorization";
|
|
@@ -11666,7 +11871,8 @@ var GOVERNED_BUSINESS_TASK_ORIGIN_KINDS = [
|
|
|
11666
11871
|
"first_business_activation",
|
|
11667
11872
|
"ceo_periodic_discovery",
|
|
11668
11873
|
"operator_business_task",
|
|
11669
|
-
"company_strategy_first_wave"
|
|
11874
|
+
"company_strategy_first_wave",
|
|
11875
|
+
"company_strategy_cold_start"
|
|
11670
11876
|
];
|
|
11671
11877
|
var BUSINESS_TASK_ENROLLMENT_READ_STATES = [
|
|
11672
11878
|
"governed",
|
|
@@ -11738,6 +11944,18 @@ var governedBusinessTaskLineageSchema = external_exports.discriminatedUnion("kin
|
|
|
11738
11944
|
priorityOrder: external_exports.number().int().min(1).max(10),
|
|
11739
11945
|
dependencyItemClientKey: stableIdentitySchema2.nullable()
|
|
11740
11946
|
}).strict(),
|
|
11947
|
+
external_exports.object({
|
|
11948
|
+
kind: external_exports.literal("company_strategy_cold_start"),
|
|
11949
|
+
worksetId: external_exports.string().uuid(),
|
|
11950
|
+
initializationId: external_exports.string().uuid(),
|
|
11951
|
+
strategyIssueId: external_exports.string().uuid(),
|
|
11952
|
+
goalId: external_exports.string().uuid(),
|
|
11953
|
+
strategyDocumentRevisionId: external_exports.string().uuid(),
|
|
11954
|
+
organizationVersion: external_exports.number().int().nonnegative(),
|
|
11955
|
+
candidateRef: stableIdentitySchema2,
|
|
11956
|
+
priorityOrder: external_exports.number().int().min(1).max(100),
|
|
11957
|
+
dependencyCandidateRef: stableIdentitySchema2.nullable()
|
|
11958
|
+
}).strict(),
|
|
11741
11959
|
external_exports.object({
|
|
11742
11960
|
kind: external_exports.literal("ceo_periodic_discovery"),
|
|
11743
11961
|
observationId: external_exports.string().uuid(),
|
|
@@ -19131,6 +19349,34 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
19131
19349
|
const mode = statSync2(filePath).mode & 511;
|
|
19132
19350
|
if (mode !== 384) throw new Error(`pi_managed_mcp_permissions_failed: ${filePath} mode=${mode.toString(8)}`);
|
|
19133
19351
|
}
|
|
19352
|
+
function resolveSourceAcquisitionExtension(sharedPiHome, sourceAcquisition) {
|
|
19353
|
+
const expectedDigest = sourceAcquisition?.profile?.connectorAdmission?.sourceExtensionDigest;
|
|
19354
|
+
if (typeof expectedDigest !== "string" || !/^[a-f0-9]{64}$/i.test(expectedDigest)) {
|
|
19355
|
+
throw new Error("source_acquisition_extension_profile_digest_invalid");
|
|
19356
|
+
}
|
|
19357
|
+
const extensionPath = join5(sharedPiHome, "extensions", "amaster-source-acquisition.js");
|
|
19358
|
+
let extensionStat;
|
|
19359
|
+
try {
|
|
19360
|
+
extensionStat = lstatSync3(extensionPath);
|
|
19361
|
+
} catch (error) {
|
|
19362
|
+
if (error?.code === "ENOENT") throw new Error("source_acquisition_extension_missing");
|
|
19363
|
+
throw new Error("source_acquisition_extension_unsafe");
|
|
19364
|
+
}
|
|
19365
|
+
if (!extensionStat.isFile() || extensionStat.isSymbolicLink()) {
|
|
19366
|
+
throw new Error("source_acquisition_extension_unsafe");
|
|
19367
|
+
}
|
|
19368
|
+
let extensionBytes;
|
|
19369
|
+
try {
|
|
19370
|
+
extensionBytes = readFileSync5(extensionPath);
|
|
19371
|
+
} catch (error) {
|
|
19372
|
+
if (error?.code === "ENOENT") throw new Error("source_acquisition_extension_missing");
|
|
19373
|
+
throw new Error("source_acquisition_extension_unsafe");
|
|
19374
|
+
}
|
|
19375
|
+
if (sha2563(extensionBytes) !== expectedDigest.toLowerCase()) {
|
|
19376
|
+
throw new Error("source_acquisition_extension_digest_mismatch");
|
|
19377
|
+
}
|
|
19378
|
+
return extensionBytes;
|
|
19379
|
+
}
|
|
19134
19380
|
function copyPrivateFile(source, target) {
|
|
19135
19381
|
if (!existsSync4(source)) return false;
|
|
19136
19382
|
const sourceStat = lstatSync3(source);
|
|
@@ -20385,6 +20631,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
20385
20631
|
extensionArgs.push("--extension", extensionPath);
|
|
20386
20632
|
return extensionPath;
|
|
20387
20633
|
};
|
|
20634
|
+
const sourceAcquisitionExtension = input.sourceAcquisition ? resolveSourceAcquisitionExtension(sharedRuntime.home, input.sourceAcquisition) : null;
|
|
20388
20635
|
if (directCatalog) {
|
|
20389
20636
|
const adapterExtensionPath = join5(
|
|
20390
20637
|
sharedRuntime.home,
|
|
@@ -20402,11 +20649,15 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
20402
20649
|
}
|
|
20403
20650
|
extensionArgs.push("--extension", adapterExtensionPath);
|
|
20404
20651
|
}
|
|
20652
|
+
if (sourceAcquisitionExtension) {
|
|
20653
|
+
writeProfileExtension("amaster-source-acquisition.js", sourceAcquisitionExtension);
|
|
20654
|
+
}
|
|
20405
20655
|
if (mcpToolMode !== MANAGED_PI_DIRECT_TYPED_MCP_TOOL_MODE) {
|
|
20406
20656
|
writeProfileExtension(MANAGED_PI_MCP_ARGS_NORMALIZER_FILENAME, managedPiMcpArgsNormalizerExtensionSource());
|
|
20407
20657
|
}
|
|
20408
20658
|
const cachePath = join5(profileRoot, "mcp-cache.json");
|
|
20409
20659
|
let directAttestationInput = null;
|
|
20660
|
+
let effectiveToolsAttestorExtensionPath = null;
|
|
20410
20661
|
const sourceExecutionIdentity = input.sourceAcquisition && typeof input.sourceAcquisition.profile?.attemptId === "string" && Number.isSafeInteger(input.sourceAcquisition.profile?.epoch) ? {
|
|
20411
20662
|
commandId: input.commandId,
|
|
20412
20663
|
attemptId: input.sourceAcquisition.profile.attemptId,
|
|
@@ -20423,7 +20674,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
20423
20674
|
}
|
|
20424
20675
|
const adapterVersion = piMcpAdapterVersion(sharedRuntime.home);
|
|
20425
20676
|
if (directCatalog) {
|
|
20426
|
-
writeProfileExtension(
|
|
20677
|
+
effectiveToolsAttestorExtensionPath = writeProfileExtension(
|
|
20427
20678
|
MANAGED_PI_EFFECTIVE_TOOLS_ATTESTOR_FILENAME,
|
|
20428
20679
|
managedPiEffectiveToolsAttestorExtensionSource()
|
|
20429
20680
|
);
|
|
@@ -20571,6 +20822,14 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
20571
20822
|
enabledRoleSkillMetadataBytes = roleSkills.serializedMetadataBytes;
|
|
20572
20823
|
enabledRoleSkillMetadataSha256 = roleSkills.serializedMetadataSha256;
|
|
20573
20824
|
}
|
|
20825
|
+
if (input.sourceAcquisition && effectiveToolsAttestorExtensionPath) {
|
|
20826
|
+
const attestorPathIndex = extensionArgs.indexOf(effectiveToolsAttestorExtensionPath);
|
|
20827
|
+
if (attestorPathIndex < 1 || extensionArgs[attestorPathIndex - 1] !== "--extension") {
|
|
20828
|
+
throw new Error("pi_managed_mcp_attestor_extension_order_invalid");
|
|
20829
|
+
}
|
|
20830
|
+
extensionArgs.splice(attestorPathIndex - 1, 2);
|
|
20831
|
+
extensionArgs.push("--extension", effectiveToolsAttestorExtensionPath);
|
|
20832
|
+
}
|
|
20574
20833
|
const env = {
|
|
20575
20834
|
...sharedRuntime.settingsEnv,
|
|
20576
20835
|
...buildIsolatedEnvironment2(input.baseEnv, input.commandEnv),
|
|
@@ -21336,6 +21595,21 @@ function signalExecutorProcess(child, signal, processGroupId = processGroupIdFor
|
|
|
21336
21595
|
return false;
|
|
21337
21596
|
}
|
|
21338
21597
|
|
|
21598
|
+
// src/amaster-runtime-daemon/executor-stdin.mjs
|
|
21599
|
+
var BENIGN_EMPTY_STDIN_CLOSE_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
21600
|
+
"EPIPE",
|
|
21601
|
+
"ERR_STREAM_DESTROYED"
|
|
21602
|
+
]);
|
|
21603
|
+
function closeExecutorStdin(stdin, input, onDeliveryError) {
|
|
21604
|
+
const hasInput = Boolean(input);
|
|
21605
|
+
stdin.once("error", (error) => {
|
|
21606
|
+
if (!hasInput && BENIGN_EMPTY_STDIN_CLOSE_ERROR_CODES.has(error?.code)) return;
|
|
21607
|
+
onDeliveryError(error);
|
|
21608
|
+
});
|
|
21609
|
+
if (hasInput) stdin.end(input);
|
|
21610
|
+
else stdin.end();
|
|
21611
|
+
}
|
|
21612
|
+
|
|
21339
21613
|
// src/amaster-runtime-daemon/durability.mjs
|
|
21340
21614
|
function resultOutboxFileName(commandId, now = Date.now()) {
|
|
21341
21615
|
const safeCommandId = String(commandId ?? "command").replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
@@ -24080,7 +24354,9 @@ function agentInstructionDeliveryAudit(bundle, delivery) {
|
|
|
24080
24354
|
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync10, renameSync as renameSync7, rmSync as rmSync6, writeFileSync as writeFileSync8 } from "node:fs";
|
|
24081
24355
|
import { homedir as homedir2, hostname } from "node:os";
|
|
24082
24356
|
import { dirname as dirname7, join as join9 } from "node:path";
|
|
24083
|
-
|
|
24357
|
+
|
|
24358
|
+
// src/amaster-runtime-daemon/capability-registry.mjs
|
|
24359
|
+
var BUILD_SUPPORTED_CAPABILITIES = Object.freeze([
|
|
24084
24360
|
"remote_registration",
|
|
24085
24361
|
"heartbeat",
|
|
24086
24362
|
"executor_discovery",
|
|
@@ -24096,8 +24372,50 @@ var CAPABILITIES = [
|
|
|
24096
24372
|
"run_cancel",
|
|
24097
24373
|
"run_terminate",
|
|
24098
24374
|
"logs_cost_workspace_status",
|
|
24099
|
-
"source_acquisition_v1"
|
|
24100
|
-
|
|
24375
|
+
"source_acquisition_v1",
|
|
24376
|
+
"headed_browser_auth"
|
|
24377
|
+
]);
|
|
24378
|
+
var DYNAMIC_READINESS = Object.freeze({
|
|
24379
|
+
final_model_context_attestation_v1: {
|
|
24380
|
+
reasonCode: "managed_pi_executor_required",
|
|
24381
|
+
ready: (input) => input.runnerKind === "cloud_managed" && input.executors.some((executor) => executor.kind === "pi")
|
|
24382
|
+
},
|
|
24383
|
+
source_acquisition_v1: {
|
|
24384
|
+
reasonCode: "source_acquisition_not_ready",
|
|
24385
|
+
ready: (input) => input.sourceAcquisition?.ready === true
|
|
24386
|
+
},
|
|
24387
|
+
headed_browser_auth: {
|
|
24388
|
+
reasonCode: "headed_browser_runtime_not_ready",
|
|
24389
|
+
ready: (input) => input.browserSessionBroker?.ready === true
|
|
24390
|
+
}
|
|
24391
|
+
});
|
|
24392
|
+
function uniqueStrings2(values) {
|
|
24393
|
+
return Array.from(new Set((Array.isArray(values) ? values : []).map((value) => String(value ?? "").trim()).filter(Boolean)));
|
|
24394
|
+
}
|
|
24395
|
+
function buildRuntimeCapabilityReport(input) {
|
|
24396
|
+
const legacyConfiguredCapabilities = uniqueStrings2(input.legacyConfiguredCapabilities);
|
|
24397
|
+
const runtimeUnavailable = [];
|
|
24398
|
+
const advertised = BUILD_SUPPORTED_CAPABILITIES.filter((capability) => {
|
|
24399
|
+
const readiness = DYNAMIC_READINESS[capability];
|
|
24400
|
+
if (!readiness || readiness.ready(input)) return true;
|
|
24401
|
+
runtimeUnavailable.push({ capability, reasonCode: readiness.reasonCode });
|
|
24402
|
+
return false;
|
|
24403
|
+
});
|
|
24404
|
+
const buildSet = new Set(BUILD_SUPPORTED_CAPABILITIES);
|
|
24405
|
+
const legacySet = new Set(legacyConfiguredCapabilities);
|
|
24406
|
+
return {
|
|
24407
|
+
schemaVersion: "mirrorx.connector-capability-report/v1",
|
|
24408
|
+
source: "build_attested",
|
|
24409
|
+
buildSupported: [...BUILD_SUPPORTED_CAPABILITIES],
|
|
24410
|
+
runtimeUnavailable,
|
|
24411
|
+
advertised,
|
|
24412
|
+
deprecatedCapabilityOverridePresent: legacyConfiguredCapabilities.length > 0,
|
|
24413
|
+
legacyMissingFromBuildTruth: legacyConfiguredCapabilities.length > 0 ? BUILD_SUPPORTED_CAPABILITIES.filter((capability) => !legacySet.has(capability)) : [],
|
|
24414
|
+
legacyUnsupportedClaims: legacyConfiguredCapabilities.filter((capability) => !buildSet.has(capability))
|
|
24415
|
+
};
|
|
24416
|
+
}
|
|
24417
|
+
|
|
24418
|
+
// src/amaster-runtime-daemon/config-state.mjs
|
|
24101
24419
|
var RUNNER_KIND_CLOUD_MANAGED = "cloud_managed";
|
|
24102
24420
|
var RUNNER_KIND_DESKTOP_DELEGATED = "desktop_delegated";
|
|
24103
24421
|
function readEnum(value, allowed, fallback, label) {
|
|
@@ -24279,7 +24597,8 @@ function buildConfig(env = process.env, flags = {}) {
|
|
|
24279
24597
|
piExecutorUid,
|
|
24280
24598
|
piExecutorGid,
|
|
24281
24599
|
runnerKind,
|
|
24282
|
-
capabilities:
|
|
24600
|
+
capabilities: [...BUILD_SUPPORTED_CAPABILITIES],
|
|
24601
|
+
legacyConfiguredCapabilities: splitList(flags.capabilities ?? env.AMASTER_CAPABILITIES ?? ""),
|
|
24283
24602
|
pollIntervalSeconds: Number(flags.pollIntervalSeconds ?? env.AMASTER_POLL_INTERVAL_SECONDS ?? 10),
|
|
24284
24603
|
maxConcurrentCommands: Math.min(
|
|
24285
24604
|
parsePositiveInteger(flags.maxConcurrentCommands ?? env.AMASTER_MAX_CONCURRENT_COMMANDS, 1),
|
|
@@ -28670,7 +28989,7 @@ function createSourceCompletionStopPolicy({
|
|
|
28670
28989
|
}
|
|
28671
28990
|
|
|
28672
28991
|
// src/amaster-runtime-daemon.mjs
|
|
28673
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
28992
|
+
var CONNECTOR_VERSION = "0.1.1-beta.133";
|
|
28674
28993
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
28675
28994
|
var SOURCE_ACQUISITION_CAPABILITY2 = source_acquisition_compatibility_default.profileVersion;
|
|
28676
28995
|
var daemonRequire = createRequire(import.meta.url);
|
|
@@ -29333,12 +29652,19 @@ function browserSessionRuntimeStatus(config) {
|
|
|
29333
29652
|
return broker ? { ...readiness, ...broker.status() } : readiness;
|
|
29334
29653
|
}
|
|
29335
29654
|
function runtimeAdvertisedCapabilities(config, sourceAcquisition, browserSessionBroker) {
|
|
29336
|
-
return
|
|
29655
|
+
return buildRuntimeCapabilityReport({
|
|
29656
|
+
legacyConfiguredCapabilities: config.legacyConfiguredCapabilities,
|
|
29657
|
+
sourceAcquisition,
|
|
29658
|
+
browserSessionBroker,
|
|
29659
|
+
runnerKind: config.runnerKind,
|
|
29660
|
+
executors: config.executors
|
|
29661
|
+
});
|
|
29337
29662
|
}
|
|
29338
29663
|
function buildRegisterPayload(config) {
|
|
29339
29664
|
const buildCommit = readString(process.env.AMASTER_RUNTIME_BUILD_COMMIT ?? process.env.AMASTER_SOURCE_COMMIT);
|
|
29340
29665
|
const sourceAcquisition = sourceAcquisitionRuntimeReadiness(config);
|
|
29341
29666
|
const browserSessionBroker = browserSessionRuntimeReadiness(config);
|
|
29667
|
+
const capabilityReport = runtimeAdvertisedCapabilities(config, sourceAcquisition, browserSessionBroker);
|
|
29342
29668
|
return {
|
|
29343
29669
|
...config.companyId ? { companyId: config.companyId } : {},
|
|
29344
29670
|
connectorName: config.connectorName,
|
|
@@ -29346,7 +29672,7 @@ function buildRegisterPayload(config) {
|
|
|
29346
29672
|
workspaceBindings: config.workspaceBindings,
|
|
29347
29673
|
networkDomains: config.networkDomains,
|
|
29348
29674
|
executors: config.executors,
|
|
29349
|
-
capabilities:
|
|
29675
|
+
capabilities: capabilityReport.advertised,
|
|
29350
29676
|
contractVersion: CONNECTOR_CONTRACT_VERSION,
|
|
29351
29677
|
connectorVersion: CONNECTOR_VERSION,
|
|
29352
29678
|
...buildCommit ? { buildCommit } : {},
|
|
@@ -29359,7 +29685,12 @@ function buildRegisterPayload(config) {
|
|
|
29359
29685
|
authMode: config.token ? "bearer_token" : config.authHeader ? "custom_header" : "none",
|
|
29360
29686
|
platform: process.platform,
|
|
29361
29687
|
arch: process.arch,
|
|
29362
|
-
node: process.version
|
|
29688
|
+
node: process.version,
|
|
29689
|
+
capabilityReport: {
|
|
29690
|
+
...capabilityReport,
|
|
29691
|
+
connectorVersion: CONNECTOR_VERSION,
|
|
29692
|
+
...buildCommit ? { connectorDigest: `build:${buildCommit}` } : {}
|
|
29693
|
+
}
|
|
29363
29694
|
}
|
|
29364
29695
|
};
|
|
29365
29696
|
}
|
|
@@ -29393,6 +29724,7 @@ function buildHeartbeatPayload(config, options = {}) {
|
|
|
29393
29724
|
const executorReadiness = buildExecutorReadiness(config);
|
|
29394
29725
|
const sourceAcquisition = sourceAcquisitionRuntimeReadiness(config);
|
|
29395
29726
|
const browserSessionBroker = browserSessionRuntimeStatus(config);
|
|
29727
|
+
const capabilityReport = runtimeAdvertisedCapabilities(config, sourceAcquisition, browserSessionBroker);
|
|
29396
29728
|
const status = options.status === "offline" ? "offline" : "online";
|
|
29397
29729
|
const daemonStatus = status === "offline" ? "stopping" : "running";
|
|
29398
29730
|
return {
|
|
@@ -29400,7 +29732,7 @@ function buildHeartbeatPayload(config, options = {}) {
|
|
|
29400
29732
|
workspaceBindings: config.workspaceBindings,
|
|
29401
29733
|
networkDomains: config.networkDomains,
|
|
29402
29734
|
executors: config.executors,
|
|
29403
|
-
capabilities:
|
|
29735
|
+
capabilities: capabilityReport.advertised,
|
|
29404
29736
|
connectorVersion: CONNECTOR_VERSION,
|
|
29405
29737
|
...buildCommit ? { buildCommit } : {},
|
|
29406
29738
|
contractVersion: CONNECTOR_CONTRACT_VERSION,
|
|
@@ -29426,7 +29758,12 @@ function buildHeartbeatPayload(config, options = {}) {
|
|
|
29426
29758
|
...versionDrift.versionDrift || versionDrift.bundleDrift ? versionDrift : {}
|
|
29427
29759
|
},
|
|
29428
29760
|
metadata: {
|
|
29429
|
-
authMode: config.token ? "bearer_token" : config.authHeader ? "custom_header" : "none"
|
|
29761
|
+
authMode: config.token ? "bearer_token" : config.authHeader ? "custom_header" : "none",
|
|
29762
|
+
capabilityReport: {
|
|
29763
|
+
...capabilityReport,
|
|
29764
|
+
connectorVersion: CONNECTOR_VERSION,
|
|
29765
|
+
...buildCommit ? { connectorDigest: `build:${buildCommit}` } : {}
|
|
29766
|
+
}
|
|
29430
29767
|
}
|
|
29431
29768
|
};
|
|
29432
29769
|
}
|
|
@@ -29593,7 +29930,6 @@ AMASTER_CONNECTOR_NAME=${quoteShell(config.connectorName)}
|
|
|
29593
29930
|
AMASTER_MACHINE_ID=${quoteShell(config.machineId)}
|
|
29594
29931
|
AMASTER_WORKSPACE_ALLOWLIST=${quoteShell(config.workspaceBindings.join(","))}
|
|
29595
29932
|
AMASTER_EXECUTORS=${quoteShell(executorEnv)}
|
|
29596
|
-
AMASTER_CAPABILITIES=${quoteShell(config.capabilities.join(","))}
|
|
29597
29933
|
AMASTER_NETWORK_DOMAINS=${quoteShell(config.networkDomains.join(","))}
|
|
29598
29934
|
AMASTER_DAEMON_STATE_FILE=${quoteShell(join16(homedir3(), ".amaster-employee", "runtime-connector-state.json"))}
|
|
29599
29935
|
EOF
|
|
@@ -31702,8 +32038,12 @@ function runExecutor(command, args, options) {
|
|
|
31702
32038
|
closeSignal = signal;
|
|
31703
32039
|
maybeFinishQuiescent();
|
|
31704
32040
|
});
|
|
31705
|
-
|
|
31706
|
-
|
|
32041
|
+
closeExecutorStdin(child.stdin, options.stdin, (error) => {
|
|
32042
|
+
if (settled) return;
|
|
32043
|
+
spawnError = `executor_stdin_delivery_failed: ${error.message}`;
|
|
32044
|
+
spawnErrorCode = sourceAcquisitionSpawnErrno(error.code);
|
|
32045
|
+
requestStop("executor_stdin_delivery_failed");
|
|
32046
|
+
});
|
|
31707
32047
|
});
|
|
31708
32048
|
}
|
|
31709
32049
|
async function ingestLog(config, command, stream, level, message, payload = {}) {
|
|
@@ -33844,9 +34184,6 @@ async function executeRunCommand(config, command) {
|
|
|
33844
34184
|
if (executor.kind === "pi" && managedMcpProfile.toolAllowlist && !sourceAcquisition) {
|
|
33845
34185
|
invocation.args = applyManagedPiToolAllowlist(invocation.args, managedMcpProfile);
|
|
33846
34186
|
}
|
|
33847
|
-
if (executor.kind === "pi" && Array.isArray(managedMcpProfile.extensionArgs) && managedMcpProfile.extensionArgs.length > 0) {
|
|
33848
|
-
invocation.args = [...invocation.args, ...managedMcpProfile.extensionArgs];
|
|
33849
|
-
}
|
|
33850
34187
|
if (executor.kind === "pi") {
|
|
33851
34188
|
invocation.args = [
|
|
33852
34189
|
...invocation.args,
|
|
@@ -33856,6 +34193,9 @@ async function executeRunCommand(config, command) {
|
|
|
33856
34193
|
"--no-approve"
|
|
33857
34194
|
];
|
|
33858
34195
|
}
|
|
34196
|
+
if (executor.kind === "pi" && Array.isArray(managedMcpProfile.extensionArgs) && managedMcpProfile.extensionArgs.length > 0) {
|
|
34197
|
+
invocation.args = [...invocation.args, ...managedMcpProfile.extensionArgs];
|
|
34198
|
+
}
|
|
33859
34199
|
await ingestLog(config, command, "system", "info", desktopDelegatedRunnerEnabled(config) && executor.kind === "pi" ? "Prepared desktop delegated Pi runtime action bridge" : `Attested isolated ${executor.kind} managed MCP profile`, {
|
|
33860
34200
|
presentationKind: "managed_mcp_attestation",
|
|
33861
34201
|
...managedMcpProfile.attestation
|
|
@@ -34508,6 +34848,7 @@ async function executeRunCommand(config, command) {
|
|
|
34508
34848
|
parsed.errorMessage = null;
|
|
34509
34849
|
}
|
|
34510
34850
|
if (succeeded && managedMcpProfile && Array.isArray(command.requiredCapabilities) && command.requiredCapabilities.includes("runtime_actions_v2")) {
|
|
34851
|
+
const usesLivePathClosureContract = command.requiredCapabilities.includes("run_exit_live_path_closure_v1");
|
|
34511
34852
|
const productiveSuccessfulRun = outputTelemetry.meaningfulProgressEventCount > 0 || runtimeArtifacts.length > 0 || mcpToolResults.some((toolResult) => ["succeeded", "approval_required"].includes(readString(toolResult.status)));
|
|
34512
34853
|
let completionState = createRunCompletionState({
|
|
34513
34854
|
connectorId: requireConnectorId(config),
|
|
@@ -34540,13 +34881,13 @@ async function executeRunCommand(config, command) {
|
|
|
34540
34881
|
}
|
|
34541
34882
|
},
|
|
34542
34883
|
completionRequest: {
|
|
34543
|
-
contractVersion:
|
|
34884
|
+
contractVersion: usesLivePathClosureContract ? "amaster.runtime-connector.completion-check.v2" : "amaster.runtime-connector.completion-check.v1",
|
|
34544
34885
|
leaseId: command.leaseId,
|
|
34545
34886
|
proposedStatus: "succeeded",
|
|
34546
34887
|
resultSignals: {
|
|
34547
34888
|
productiveSuccessfulRun,
|
|
34548
34889
|
executorTurnCount: terminalTextRepairUsageBreakdown ? 2 : 1,
|
|
34549
|
-
...
|
|
34890
|
+
...usesLivePathClosureContract ? {
|
|
34550
34891
|
closureAttempts: {
|
|
34551
34892
|
workDisposition: 0,
|
|
34552
34893
|
livePath: 0,
|
|
@@ -34893,7 +35234,7 @@ Commands:
|
|
|
34893
35234
|
|
|
34894
35235
|
Key env:
|
|
34895
35236
|
AMASTER_EMPLOYEE_SERVER_URL, AMASTER_CONNECTOR_TOKEN or AMASTER_CONNECTOR_AUTH_HEADER,
|
|
34896
|
-
AMASTER_WORKSPACE_ALLOWLIST, AMASTER_EXECUTORS,
|
|
35237
|
+
AMASTER_WORKSPACE_ALLOWLIST, AMASTER_EXECUTORS,
|
|
34897
35238
|
AMASTER_NETWORK_DOMAINS, AMASTER_CONNECTOR_ID, AMASTER_DAEMON_STATE_FILE,
|
|
34898
35239
|
AMASTER_MAX_CONCURRENT_COMMANDS, AMASTER_EXECUTOR_MAX_RSS_MB (default 0, disabled),
|
|
34899
35240
|
AMASTER_RUNTIME_ORPHAN_REAPER_INTERVAL_SECONDS (default 300, set 0 to disable),
|
|
@@ -34903,6 +35244,11 @@ Key env:
|
|
|
34903
35244
|
async function main() {
|
|
34904
35245
|
const { command, flags } = parseArgs(process.argv.slice(2));
|
|
34905
35246
|
const config = buildConfig(process.env, flags);
|
|
35247
|
+
if (config.legacyConfiguredCapabilities.length > 0) {
|
|
35248
|
+
process.stderr.write(
|
|
35249
|
+
"Warning: AMASTER_CAPABILITIES/--capabilities is deprecated and ignored; use the Server capability allowlist for operator restrictions.\n"
|
|
35250
|
+
);
|
|
35251
|
+
}
|
|
34906
35252
|
switch (command) {
|
|
34907
35253
|
case "config-template":
|
|
34908
35254
|
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.133";
|
|
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
|
}
|