@amaster.ai/employee-runtime-connector 0.1.1-beta.21 → 0.1.1-beta.210
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 +52 -5
- package/dist/amaster-runtime-daemon/capability-registry.mjs +90 -0
- package/dist/amaster-runtime-daemon.mjs +27793 -8181
- package/dist/amaster-runtime.mjs +15 -20
- package/dist/templates/.mirrorx-preset-templates.json +130 -0
- package/dist/templates/CEO/347/273/217/350/220/245/347/256/200/346/212/245/346/250/241/346/235/277.md +87 -0
- package/dist/templates//344/272/247/345/223/201/347/274/272/351/231/267/346/270/205/345/215/225/346/250/241/346/235/277.md +83 -0
- package/dist/templates//344/274/201/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277V0.1 /345/211/257/346/234/254.md" +470 -0
- package/dist/templates//344/275/216/347/251/272/347/273/217/346/265/216/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +470 -0
- package/dist/templates//345/205/203/345/256/207/345/256/231/344/270/216/346/225/260/345/255/227/345/206/205/345/256/271/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +306 -0
- package/dist/templates//345/206/205/351/203/250/344/275/277/347/224/250/346/212/245/345/221/212/346/250/241/346/235/277.md +141 -0
- package/dist/templates//345/206/234/344/270/232/344/270/216/351/243/237/345/223/201/346/267/261/345/212/240/345/267/245/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +466 -0
- package/dist/templates//345/214/273/347/226/227/345/201/245/345/272/267/344/270/216/347/224/237/345/221/275/347/247/221/345/255/246/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +474 -0
- package/dist/templates//345/220/210/346/210/220/347/224/237/347/211/251/345/255/246/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +298 -0
- package/dist/templates//345/225/206/344/270/232/350/210/252/345/244/251/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +389 -0
- package/dist/templates//345/272/224/346/224/266/350/264/246/346/254/276/350/264/246/351/276/204/345/210/206/346/236/220/350/241/250/346/250/241/346/235/277.xlsx +0 -0
- package/dist/templates//345/273/272/347/255/221/344/270/216/346/210/277/345/234/260/344/272/247/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +458 -0
- package/dist/templates//346/226/207/346/227/205/344/270/216/346/226/207/344/275/223/346/225/231/350/202/262/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +464 -0
- package/dist/templates//346/234/210/345/272/246/347/250/216/345/212/241/347/224/263/346/212/245/345/207/206/345/244/207/346/270/205/345/215/225/346/250/241/346/235/277.xlsx +0 -0
- package/dist/templates//346/234/210/345/272/246/347/273/223/350/264/246/346/270/205/345/215/225/346/250/241/346/235/277.xlsx +0 -0
- package/dist/templates//346/257/217/345/221/250/347/216/260/351/207/221/345/277/253/347/205/247/346/250/241/346/235/277.xlsx +0 -0
- package/dist/templates//346/263/225/345/256/232/350/264/242/345/212/241/346/212/245/350/241/250/346/250/241/346/235/277.xlsx +0 -0
- package/dist/templates//346/266/210/350/264/271/344/270/216/351/233/266/345/224/256/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +456 -0
- package/dist/templates//347/211/251/346/265/201/344/270/216/344/276/233/345/272/224/351/223/276/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +452 -0
- package/dist/templates//347/247/221/346/212/200/344/270/216/344/272/222/350/201/224/347/275/221/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +432 -0
- package/dist/templates//350/203/275/346/272/220/344/270/216/347/216/257/344/277/235/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +446 -0
- package/dist/templates//351/207/221/350/236/215/344/270/216/344/270/223/344/270/232/346/234/215/345/212/241/350/241/214/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +436 -0
- package/dist/templates//351/223/266/350/241/214/345/255/230/346/254/276/344/275/231/351/242/235/350/260/203/350/212/202/350/241/250/346/250/241/346/235/277.xlsx +0 -0
- package/dist/templates//351/227/255/347/216/257/346/265/201/347/250/213/350/257/264/346/230/216/344/270/216/345/256/241/350/256/241/350/257/201/346/215/256/346/240/267/344/276/213/346/250/241/346/235/277.md +125 -0
- package/dist/templates//351/253/230/347/253/257/344/270/216/345/205/210/350/277/233/345/210/266/351/200/240/344/270/232/346/210/230/347/225/245/350/247/204/345/210/222/346/250/241/346/235/277.md +466 -0
- package/package.json +5 -2
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,model_call,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,17 +20,60 @@ 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
|
|
|
24
|
-
|
|
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
|
+
|
|
32
|
+
`browser_credential_ref_fill_v1` is a narrow private command capability. It can
|
|
33
|
+
consume only a Server-issued credential ref for the exact command and writes the
|
|
34
|
+
resolved value to a dedicated inherited file descriptor; it does not expose the
|
|
35
|
+
value through prompt, argv, environment, workspace, logs, or result JSON. Normal
|
|
36
|
+
navigation, snapshots, form submission, waits, and challenges remain ordinary Pi
|
|
37
|
+
browser/task behavior.
|
|
38
|
+
|
|
39
|
+
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 package path is unchanged between them. 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
40
|
|
|
26
41
|
## Package Contents
|
|
27
42
|
|
|
43
|
+
## Pi plugin ownership boundary
|
|
44
|
+
|
|
45
|
+
`pi-cli-runtime` owns Pi plugin installation, versions, package resolution, and configuration. The connector must only start Pi, deliver a command, manage its process lifecycle, and return its result. Do not add Pi-plugin package/version/digest/schema/config checks to connector registration, heartbeat, capability advertisement, or command dispatch. A plugin failure is task execution evidence, not a connector admission decision.
|
|
46
|
+
|
|
28
47
|
- `dist/amaster-runtime.mjs`: configuration, pairing, workspace, diagnostics, and daemon lifecycle CLI.
|
|
29
48
|
- `dist/amaster-runtime-daemon.mjs`: standalone daemon bundle for connector registration, heartbeat, command execution, and result ingestion.
|
|
30
|
-
|
|
31
49
|
The source of truth lives under this package's `src/` directory. The package build copies the CLI and bundles the daemon modules into publishable output; do not edit generated files under `dist/`.
|
|
32
50
|
|
|
33
51
|
Runtime code belongs in the container image. Persist only connector state, the result outbox, and workspaces under the configured state directory.
|
|
34
52
|
|
|
53
|
+
## Enabled context-governance admission
|
|
54
|
+
|
|
55
|
+
The Server requires `final_model_context_attestation_v1` for governed Pi runs because that path disables ambient context discovery and injects a run-owned compiled instruction bundle. This is a Pi delivery contract, not a connector-wide requirement: an explicitly selected self-hosted Codex runtime continues through its own Runtime Actions V2 and native-session contracts and cannot borrow the Pi attestation claim. Adding the same final-context guarantee to another executor requires executor-specific proof for scoped project-instruction semantics, the normalized final active tool schemas, the selected model's context window, automatically visible skill metadata, and resumed-session history.
|
|
56
|
+
|
|
57
|
+
For admitted Pi runs, the daemon compiles source-repository `AGENTS.md` and `AGENTS.override.md` topology into one root `AGENTS.md` with explicit relative scopes, same-scope override semantics, and a higher-authority MirrorX platform block. Governed Pi preserves operator-configured user extensions and tools, disables ambient skill and context-file discovery, and injects that exact compiled file through a run-owned final-system-prompt extension. `pi-mcp-adapter` normally merges the operator's user-level `mcp.json` with the run-owned workspace `.pi/mcp.json`; the workspace definition wins on a same-name server, and only environment placeholders referenced by preserved user MCP definitions are granted to the child. Governed MCP tools remain fail-closed: the daemon requires their exact catalog and schemas while accepting additional Pi-native or user-extension tools, including the adapter proxy when a user MCP needs it. Run-exit closure applies the same rule to its two required MirrorX tools as a schema-bound subset instead of rejecting the ambient user tool surface. When the operator-owned Pi settings declare `@amaster.ai/pi-telemetry`, the daemon verifies that package's immutable identity and preserves the authoritative runtime run id for trace correlation while Pi loads it normally from the shared settings. A last-ordered `before_provider_request` hook then validates every provider call, including later calls after tool results: exactly one system message contains the compiled instructions, visible role-skill metadata and the attested active tool contract match their prior attestations, and the complete serialized input fits the context window. It does not override the active model's output limit or inject provider `max_tokens`, `max_completion_tokens`, or `max_output_tokens`; no `modelMaxOutputTokens` substitute exists. Each call appends metadata-only hashes and sizes to a bounded chained receipt; a missing, broken, or oversized chain fails the run.
|
|
58
|
+
|
|
59
|
+
Pi 0.80.10's internal compaction summarizer calls the provider outside `before_provider_request`. The Enabled profile therefore records and cancels every `session_before_compact` attempt and fails immediately if `session_compact` is nevertheless observed. No model-generated compaction summary is accepted until that provider path has equivalent final-context attestation. The Server also enumerates Pi and Codex as the only supported governed executors at configuration and heartbeat dispatch boundaries; missing or unknown executor kinds fail closed.
|
|
60
|
+
|
|
61
|
+
This is an intentional compatibility break for the not-yet-public context-governance contract. There is no historical command migration, dual-read, or fallback from a new Server-issued envelope to an unproved executor path.
|
|
62
|
+
|
|
63
|
+
## Contracted Pi model calls
|
|
64
|
+
|
|
65
|
+
Pi `model_call` commands with `model_call_output_contract_v1` keep provider and
|
|
66
|
+
model selection paired with the output ceiling. Command target fields have the
|
|
67
|
+
highest precedence, followed by `AMASTER_PI_PROVIDER` / `AMASTER_PI_MODEL`, then
|
|
68
|
+
the Pi profile's `defaultProvider` / `defaultModel`. Each selected precedence
|
|
69
|
+
layer must be a complete provider/model pair: a partial command or runtime
|
|
70
|
+
override fails closed instead of silently falling through to a lower-precedence
|
|
71
|
+
default. The daemon copies only the normalized default pair into the isolated
|
|
72
|
+
one-shot profile, validates that the resolved model exists, applies
|
|
73
|
+
`maxOutputTokens` to that exact model, and records the resolved target and source
|
|
74
|
+
in command-result diagnostics. Missing or unknown targets also fail closed
|
|
75
|
+
before Pi is spawned.
|
|
76
|
+
|
|
35
77
|
## Pi tool-argument transport guard
|
|
36
78
|
|
|
37
79
|
`AMASTER_PI_TOOL_ARGUMENT_GUARD_MODE` defaults to `shadow`; supported values are
|
|
@@ -51,6 +93,11 @@ An enforced stop returns `pi_tool_argument_stream_amplification` with
|
|
|
51
93
|
byte counts, ratios, event/tool identity, thresholds, and near-miss distances;
|
|
52
94
|
it omits the inline argument body.
|
|
53
95
|
|
|
96
|
+
The same governed workspace-file action supports both modes: omit
|
|
97
|
+
`documentId`, `baseRevisionId`, and `issueId` for the current Issue's initial
|
|
98
|
+
document, or provide `documentId` and `baseRevisionId` together for an exact
|
|
99
|
+
CAS revision. Both modes use the same ownership manifest and byte-ingest path.
|
|
100
|
+
|
|
54
101
|
Pi JSON mode can also repeat a cumulative `message` snapshot beside each
|
|
55
102
|
incremental `message_update`. The daemon compacts only that redundant snapshot
|
|
56
103
|
from its retained parse/result buffer while preserving the delta, terminal
|
|
@@ -67,7 +114,7 @@ Pi execution uses three separate evidence layers:
|
|
|
67
114
|
2. a durable, inspectable Runtime Action receipt or finalized Runtime Artifact;
|
|
68
115
|
3. process cleanup disposition.
|
|
69
116
|
|
|
70
|
-
An exact process-kill `EPERM` error emitted only after the first two layers have completed may be isolated as a failed `cleanupDisposition` warning without changing the command's successful business result. Both accepted shapes require `kill` and `EPERM`; generic filesystem/process permission text such as `EPERM: operation not permitted, unlink ...` is a business error. Durable evidence is limited to a completed Runtime Action
|
|
117
|
+
An exact process-kill `EPERM` error emitted only after the first two layers have completed may be isolated as a failed `cleanupDisposition` warning without changing the command's successful business result. Both accepted shapes require `kill` and `EPERM`; generic filesystem/process permission text such as `EPERM: operation not permitted, unlink ...` is a business error. Durable evidence is limited to a completed Runtime Action or a finalized Runtime Artifact. A `runtime_action.status` readback is evidence only when its call/plan ref matches an earlier submit/commit receipt in the same transcript. The diagnostic and durable evidence reference remain in the result. Text-only or action-only-without-assistant-output streams, standalone governed reads, non-effect Runtime Action tools, rejected or pending effects, pre-terminal errors, provider failures, timeout, cancellation, resource limits, any signal, live residue, and uncertain ownership remain failures.
|
|
71
118
|
|
|
72
119
|
This isolation does not schedule a retry or a second business continuation. Command result delivery and the result outbox remain the sole idempotency boundary.
|
|
73
120
|
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
"artifact_template_catalog_v1",
|
|
10
|
+
"final_model_context_attestation_v1",
|
|
11
|
+
"runtime_actions_v2",
|
|
12
|
+
"continue_task_v1",
|
|
13
|
+
"run_exit_live_path_closure_v1",
|
|
14
|
+
"model_call",
|
|
15
|
+
"model_call_output_contract_v1",
|
|
16
|
+
"run_cancel",
|
|
17
|
+
"run_terminate",
|
|
18
|
+
"logs_cost_workspace_status",
|
|
19
|
+
"browser_credential_ref_fill_v1",
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const DYNAMIC_READINESS = Object.freeze({
|
|
23
|
+
artifact_template_catalog_v1: {
|
|
24
|
+
reasonCode: "artifact_template_catalog_not_ready",
|
|
25
|
+
ready: (input) => {
|
|
26
|
+
const catalog = input.templateCatalog;
|
|
27
|
+
return catalog?.status === "ready"
|
|
28
|
+
&& catalog.bundleAttested === true
|
|
29
|
+
&& catalog.materialized === true
|
|
30
|
+
&& catalog.readable === true
|
|
31
|
+
&& catalog.executorReadable === true
|
|
32
|
+
&& Number.isSafeInteger(catalog.fileCount)
|
|
33
|
+
&& catalog.fileCount > 0
|
|
34
|
+
&& typeof catalog.manifestSha256 === "string"
|
|
35
|
+
&& /^[a-f0-9]{64}$/u.test(catalog.manifestSha256)
|
|
36
|
+
&& typeof catalog.targetDir === "string"
|
|
37
|
+
&& catalog.targetDir === input.runtimeTemplatesRoot;
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
final_model_context_attestation_v1: {
|
|
41
|
+
reasonCode: (input) => input.runnerKind === "desktop_delegated"
|
|
42
|
+
&& input.executors.some((executor) => executor.kind === "pi")
|
|
43
|
+
? input.piFinalContextAttestation?.reasonCode ?? "desktop_pi_attestation_runtime_not_ready"
|
|
44
|
+
: "attested_pi_executor_required",
|
|
45
|
+
ready: (input) => input.executors.some((executor) => executor.kind === "pi")
|
|
46
|
+
&& (
|
|
47
|
+
input.runnerKind === "cloud_managed"
|
|
48
|
+
|| (
|
|
49
|
+
input.runnerKind === "desktop_delegated"
|
|
50
|
+
&& input.piFinalContextAttestation?.ready === true
|
|
51
|
+
)
|
|
52
|
+
),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
function uniqueStrings(values) {
|
|
57
|
+
return Array.from(new Set((Array.isArray(values) ? values : [])
|
|
58
|
+
.map((value) => String(value ?? "").trim())
|
|
59
|
+
.filter(Boolean)));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function buildRuntimeCapabilityReport(input) {
|
|
63
|
+
const legacyConfiguredCapabilities = uniqueStrings(input.legacyConfiguredCapabilities);
|
|
64
|
+
const runtimeUnavailable = [];
|
|
65
|
+
const advertised = BUILD_SUPPORTED_CAPABILITIES.filter((capability) => {
|
|
66
|
+
const readiness = DYNAMIC_READINESS[capability];
|
|
67
|
+
if (!readiness || readiness.ready(input)) return true;
|
|
68
|
+
runtimeUnavailable.push({
|
|
69
|
+
capability,
|
|
70
|
+
reasonCode: typeof readiness.reasonCode === "function"
|
|
71
|
+
? readiness.reasonCode(input)
|
|
72
|
+
: readiness.reasonCode,
|
|
73
|
+
});
|
|
74
|
+
return false;
|
|
75
|
+
});
|
|
76
|
+
const buildSet = new Set(BUILD_SUPPORTED_CAPABILITIES);
|
|
77
|
+
const legacySet = new Set(legacyConfiguredCapabilities);
|
|
78
|
+
return {
|
|
79
|
+
schemaVersion: "mirrorx.connector-capability-report/v1",
|
|
80
|
+
source: "build_attested",
|
|
81
|
+
buildSupported: [...BUILD_SUPPORTED_CAPABILITIES],
|
|
82
|
+
runtimeUnavailable,
|
|
83
|
+
advertised,
|
|
84
|
+
deprecatedCapabilityOverridePresent: legacyConfiguredCapabilities.length > 0,
|
|
85
|
+
legacyMissingFromBuildTruth: legacyConfiguredCapabilities.length > 0
|
|
86
|
+
? BUILD_SUPPORTED_CAPABILITIES.filter((capability) => !legacySet.has(capability))
|
|
87
|
+
: [],
|
|
88
|
+
legacyUnsupportedClaims: legacyConfiguredCapabilities.filter((capability) => !buildSet.has(capability)),
|
|
89
|
+
};
|
|
90
|
+
}
|