@amaster.ai/employee-runtime-connector 0.1.1 → 0.1.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.
package/README.md CHANGED
@@ -78,19 +78,38 @@ configure a connector-local capability list. Historical `AMASTER_CAPABILITIES` a
78
78
  but are ignored and reported as deprecated. They cannot add, remove, or authorize a
79
79
  capability.
80
80
 
81
- `browser_credential_auth_transaction_v1` is the fail-closed browser-password
82
- capability. It is advertised only when a Pi executor is present and the installed
83
- `@amaster.ai/pi-browser-use` entrypoint self-attests the sealed gate, private FD
84
- client, and atomic submit transaction in its package manifest. The connector does
85
- not infer readiness from a version number. The retired
86
- `browser_credential_ref_fill_v1` claim is retained only in shared decode vocabulary
87
- for historical rows and is never advertised or accepted as the new contract.
88
-
89
- Credential values travel only over dedicated inherited file descriptors after the
90
- browser extension validates the exact origin and form semantics. The extension
91
- atomically fills, submits, scrubs, rotates the document context, and returns
92
- metadata-only proof. Missing FD/client/gate/transaction/profile readiness fails
93
- closed; there is no ordinary fill fallback.
81
+ `browser_credential_env_read_v1` is the current managed-sandbox credential capability. It is
82
+ advertised only when a Pi executor runs under a separate non-root UID in a
83
+ `cloud_managed` Runner and the runner-owned
84
+ `browser-credential-env.mjs` extension is a regular file with the expected tool and
85
+ environment contract. For a credential-bearing command, the connector consumes
86
+ the Server-authorized refs after acknowledgement, writes fixed
87
+ `BROWSER_USERNAME` / `BROWSER_PASSWORD` keys to a private command-scoped `.env`
88
+ outside the model workspace, passes only its path to the Pi child, redacts the
89
+ values from connector logs/results, and removes the file at command cleanup.
90
+
91
+ This approved fallback is intentionally model-visible: `browser_read_credential`
92
+ returns a selected value to the model, which then uses ordinary browser fill/click
93
+ tools. It is not the former sealed transaction design and does not claim that the
94
+ value is hidden from the model. Origin mismatch, ambiguous credential sets,
95
+ missing extension readiness, and materialization failures fail closed. The saved
96
+ Server secret remains reusable by later authorized commands, so the user does not
97
+ need to provide the password again.
98
+
99
+ The private path and file mode are lifecycle and cross-process hygiene, not a
100
+ confidentiality boundary against the Pi child: the model can intentionally obtain
101
+ each authorized value through `browser_read_credential`. Desktop-delegated,
102
+ same-UID, and non-Pi runners must not advertise or execute this capability.
103
+
104
+ `browser_credential_auth_transaction_v1` remains build/runtime vocabulary for the
105
+ older private-FD prototype and is advertised only if its complete Pi browser TCB
106
+ is present. New browser-credential dispatches require
107
+ `browser_credential_env_read_v1`; they never treat the older capability as
108
+ equivalent. The retired `browser_credential_ref_fill_v1` claim is decode-only.
109
+ Commands carrying credential refs are routed only by their exact required
110
+ capability: the current capability selects the `.env` path, the legacy capability
111
+ selects the private-FD consumer, both together are rejected, and neither is not
112
+ silently upgraded.
94
113
 
95
114
  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.
96
115
 
@@ -98,7 +117,7 @@ The publish workflow verifies that npm records the publishing commit as the pack
98
117
 
99
118
  ## Pi plugin ownership boundary
100
119
 
101
- `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 version/digest/config admission checks to connector registration, heartbeat, or ordinary command dispatch. The one security-boundary exception is the manifest capability/entrypoint attestation for `browser_credential_auth_transaction_v1`; a half-installed or older browser extension must make that capability absent before dispatch. Other plugin failures remain task execution evidence, not connector admission decisions.
120
+ `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 version/digest/config admission checks to connector registration, heartbeat, or ordinary command dispatch. Credential capabilities are the narrow exceptions: the legacy private transaction attests its package manifest and TCB, while `browser_credential_env_read_v1` attests the runner-owned extension entrypoint. An absent or unexpected extension must remove the corresponding capability before dispatch. Other plugin failures remain task execution evidence, not connector admission decisions.
102
121
 
103
122
  - `dist/amaster-runtime.mjs`: configuration, pairing, workspace, diagnostics, and daemon lifecycle CLI.
104
123
  - `dist/amaster-runtime-daemon.mjs`: standalone daemon bundle for connector registration, heartbeat, command execution, and result ingestion.
@@ -18,6 +18,7 @@ export const BUILD_SUPPORTED_CAPABILITIES = Object.freeze([
18
18
  "run_terminate",
19
19
  "logs_cost_workspace_status",
20
20
  "browser_credential_auth_transaction_v1",
21
+ "browser_credential_env_read_v1",
21
22
  "execution_lanes_v1",
22
23
  "mirrorx_initialization_context_v1",
23
24
  "mirrorx_initialization_completion_v1",
@@ -25,6 +26,18 @@ export const BUILD_SUPPORTED_CAPABILITIES = Object.freeze([
25
26
  ]);
26
27
 
27
28
  const DYNAMIC_READINESS = Object.freeze({
29
+ browser_credential_env_read_v1: {
30
+ reasonCode: "browser_credential_env_runtime_incomplete",
31
+ ready: (input) => input.executors.some((executor) => executor.kind === "pi")
32
+ && input.browserCredentialEnv?.extension === true
33
+ && input.runnerKind === "cloud_managed"
34
+ && Number.isSafeInteger(input.piExecutorUid)
35
+ && Number.isSafeInteger(input.piExecutorGid)
36
+ && input.piExecutorUid > 0
37
+ && input.piExecutorGid > 0
38
+ && Number.isSafeInteger(input.connectorUid)
39
+ && input.piExecutorUid !== input.connectorUid,
40
+ },
28
41
  browser_credential_auth_transaction_v1: {
29
42
  reasonCode: "browser_credential_auth_runtime_incomplete",
30
43
  ready: (input) => {