@envarai/connect 2026.1107.1 → 2026.1107.2

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.
@@ -0,0 +1,9 @@
1
+ # Contributing
2
+
3
+ Use Node.js 22.14+ (24 recommended). Run `npm ci --ignore-scripts`, `npm test`, and verify a packed tarball with `node scripts/verify-package.mjs ARTIFACT_DIRECTORY`.
4
+
5
+ Keep task identities, durable recovery, owner-scoped authorization and local credentials intact. Native models/tools remain owned by the native runtime. Add adapter and recovery tests with isolated profiles; never use real user credentials in fixtures. Describe the reproduced behavior and tests in your PR. Changes are MIT licensed; preserve upstream notices.
6
+
7
+ Start with the [code map and adapter contract](docs/adapter-development.md), then pick a [scoped contribution brief](docs/contribution-tasks.md). Include a reproduction, file locations, expected original-task behavior and acceptance commands. Public tests use isolated fixtures and need no production account.
8
+
9
+ Package and website versions have separate release owners; see [compatibility](docs/compatibility.md). The normal test suite checks current install examples against package.json.
package/README.md CHANGED
@@ -14,10 +14,21 @@ This repository does not include a self-hosted copy of that platform. Installing
14
14
  Connect grants no account access or spending authority; approve each Agent
15
15
  connection and any spending grant separately.
16
16
 
17
+ ## Choose your starting point
18
+
19
+ | Goal | Start |
20
+ | --- | --- |
21
+ | Connect an existing Hermes/OpenClaw to Envar | [Native setup](docs/native-connector.md) |
22
+ | Develop or inspect the Connector without cloud credentials | [Adapter development and local contract tests](docs/adapter-development.md) |
23
+ | Understand package, website and bundled Pay versions | [Compatibility](docs/compatibility.md) |
24
+ | Make a first contribution | [Concrete task briefs](docs/contribution-tasks.md) |
25
+
26
+ For the independent seller-side developer path, start with [EnvarPay](https://github.com/EnvarAI/EnvarPay). Connect itself is the client and native adapter; a compatible enrollment/WorkService server is still required for a live connection.
27
+
17
28
  ## Install
18
29
 
19
30
  ```sh
20
- npm install --global --ignore-scripts @envarai/connect@2026.1029.1
31
+ npm install --global --ignore-scripts @envarai/connect@2026.1107.2
21
32
  envar-connect --version
22
33
  ```
23
34
 
package/SECURITY.md ADDED
@@ -0,0 +1,9 @@
1
+ # Security policy
2
+
3
+ EnvarConnect runs beside a user-owned Agent and holds its scoped Envar credential, A2A access tokens, model-key references, encrypted balance claims, and local Task ledger. Keep its state directory owner-only and separate from untrusted Skill code.
4
+
5
+ Paid execution must wait for a captured claim that matches the original Envar order, seller, service revision, quote, amount, input digest, and Task ID. A timeout is an unknown original operation; never create another charge to recover it. The platform Wallet remains gated until real funding, refunds, and seller settlement are accepted.
6
+
7
+ Report a vulnerability using [GitHub private vulnerability reporting](https://github.com/EnvarAI/EnvarConnect/security/advisories/new). Include the affected version and a synthetic reproduction. Do not post Agent tokens, model keys, claim tokens, state databases, customer input, or active exploits in public issues.
8
+
9
+ The latest stable calendar release is the maintenance target. There is no promised response SLA or production security certification.
@@ -0,0 +1,60 @@
1
+ # Build and verify a runtime adapter
2
+
3
+ Start with the existing interfaces, rather than inventing another task protocol:
4
+
5
+ | Code | Responsibility |
6
+ | --- | --- |
7
+ | `src/adapters/types.ts` | RuntimeAdapter, capabilities, observation and original execution reference |
8
+ | `src/adapters/a2a-runtime.ts` | Existing Hermes/OpenClaw A2A implementation |
9
+ | `src/adapters/native-a2a.ts` | Native Card and endpoint validation, SendMessage/GetTask transport |
10
+ | `src/connector/loop.ts` | Claim, admission, heartbeat, dispatch, pending reports and recovery |
11
+ | `src/connector/state.ts` | Durable journal and original runtime binding |
12
+ | `contracts/agent-work/v1/schema.json` | Public work/report contract |
13
+
14
+ ## Adapter contract
15
+
16
+ - `probe()` reports the runtime and capabilities it can actually demonstrate.
17
+ - `start(work, executionKey)` receives the original work ID after durable admission.
18
+ Call the native operation once. Do not retry an uncertain POST.
19
+ - `observe(reference)` only reads the original Task/session handle. The reference
20
+ must bind the original runtime and must contain no credential.
21
+ - `provideInput` and `cancel` must distinguish a request from a confirmed native
22
+ action. An unsupported capability is not a successful cancellation.
23
+ - `close()` releases the adapter's client resources; the runtime lifecycle belongs
24
+ to its operator.
25
+
26
+ Do not reuse display names as authorization, move model/provider credentials
27
+ into the platform, or create a substitute execution when the original is unknown.
28
+
29
+ ## Work locally without a production account
30
+
31
+ ```sh
32
+ npm ci --ignore-scripts
33
+ npm test
34
+ # Focused iteration:
35
+ node --test test/connector-adapters.test.mjs test/connector-loop.test.mjs
36
+ ```
37
+
38
+ These tests run actual local transports and journals against isolated fixtures.
39
+ They require no Envar account or model payment. They are protocol tests, not a
40
+ claim that a public WorkService server or a real model ran.
41
+
42
+ Use the current fixtures in those files as the reference for a new adapter.
43
+ An implementation should show:
44
+
45
+ 1. One native dispatch for an admitted original task.
46
+ 2. Restart reads the same saved handle and replays the same pending event.
47
+ 3. A lost send response remains unknown, without another SendMessage.
48
+ 4. A changed Card/origin/reference cannot redirect the native credential.
49
+ 5. Result delivery persists before acknowledgement.
50
+ 6. Unsupported input/cancel is reported honestly.
51
+
52
+ For a real native integration, use an isolated profile you own and document its
53
+ exact version. Keep keys, prompts, private files and personal profiles out of the
54
+ PR. Include sanitized original IDs and observed state transitions, not secrets.
55
+
56
+ ## First contributions
57
+
58
+ The maintained task briefs are in [contribution tasks](contribution-tasks.md).
59
+ Discuss a new runtime or incompatible schema change before building it. Contract
60
+ tests can be reviewed publicly; access to production credentials is not needed.
@@ -0,0 +1,61 @@
1
+ # Versions and compatibility
2
+
3
+ Install the release documented by this checkout:
4
+
5
+ ```sh
6
+ npm install --global --ignore-scripts @envarai/connect@2026.1107.2
7
+ envar-connect --version
8
+ ```
9
+
10
+ The version above comes from package.json. `npm run version:date` updates it and
11
+ the other current installation examples; the normal test suite rejects stale
12
+ commands. Historical migration examples keep their original versions.
13
+
14
+ ## Which version controls what?
15
+
16
+ | Component | Source of truth | Upgrade behavior |
17
+ | --- | --- | --- |
18
+ | Standalone Connector | This package's package.json / npm release | Upgrade the package, preserve the original directory, and restart its receiver and native MCP process as instructed. |
19
+ | Envar's browser-generated command | The deployed server/web release's fixed package and SHA-512 manifest | The website may deliberately pin a reviewed version. It is not automatically npm latest. |
20
+ | Legacy `envarpay connector` | The Connect dependency bundled in that installed Pay package | Updating standalone Connect does not replace the version inside Pay. Use standalone Connect for a new native connection. |
21
+ | Agent Work protocol | [v1 schema](../contracts/agent-work/v1/schema.json) | Package calendar versions do not change the protocol version. Incompatible changes require a new protocol version. |
22
+ | Native runtime | The existing Hermes/OpenClaw installation | Installing Connect does not upgrade the runtime, change its model, or grant tool permissions. |
23
+
24
+ Keep only one receiver for a journal. The website and Pay dependency should be
25
+ promoted only after that consumer's contract and installation checks pass.
26
+ A newer package release alone does not establish that an existing receiver was
27
+ upgraded or that every supported runtime was retested.
28
+
29
+ ## Runtime scope
30
+
31
+ Node.js 22.14+ is required; Node 24 is recommended. CI runs the minimum 22.14.0
32
+ and current Node 22/24 lines. Linux process locks require util-linux `flock`;
33
+ the managed container includes it. Preserve the journal on a filesystem that
34
+ supports the locks.
35
+
36
+ The last recorded native setup baseline is Hermes 2026.9.24 and OpenClaw
37
+ 2026.10.4. The local adapter tests cover the protocol and recovery boundaries;
38
+ they do not call a model or prove acceptance on every later native version.
39
+ Report your exact native version with any compatibility issue.
40
+
41
+ Both native adapters currently observe original Tasks, but do not advertise
42
+ input continuation or confirmed cancellation. A gateway restart may lose its
43
+ in-memory Task. Keep that operation unknown and inspect it; never create a
44
+ replacement simply because observation timed out.
45
+
46
+ ## Another Envar origin
47
+
48
+ The Connector accepts an explicitly selected HTTPS origin:
49
+
50
+ ```sh
51
+ envar-connect connect --origin https://your-envar.example --agent AGENT_UUID --framework hermes
52
+ ```
53
+
54
+ The origin must implement the same enrollment and Agent Work contract. This
55
+ package does not contain that server. Loopback HTTP is a deliberate development
56
+ option, not a way to send credentials to arbitrary HTTP hosts. The original
57
+ journal binds the origin, connection, Agent and native adapter; do not edit those
58
+ fields to reuse another connection's task or spending authority.
59
+
60
+ Read [native setup](native-connector.md), [migration](migration.md), and
61
+ [adapter development](adapter-development.md) before changing an installation.
@@ -0,0 +1,34 @@
1
+ # Contribution tasks
2
+
3
+ These are scoped contribution briefs, not promises that every runtime is
4
+ supported. Open an issue describing the brief and your proposed work before
5
+ starting a large change; maintainers can confirm whether someone is already
6
+ working on it.
7
+
8
+ | Brief | Reproduce / inspect | Files | Acceptance |
9
+ | --- | --- | --- | --- |
10
+ | C1 — Document one additional native version | Use an isolated profile with the [native guide](native-connector.md); record installation, probe, then an explicitly authorized free task separately. | `docs/native-connector.md`, `docs/compatibility.md` | Exact OS/Node/runtime versions, sanitized failure or real result; no “all versions supported” claim. A model call is optional and its own operator's responsibility. |
11
+ | C2 — Multi-byte result boundary coverage | The adapter limits text by UTF-8 bytes and rejects empty completion. Add a case straddling that limit with multi-byte text. | `src/adapters/a2a-runtime.ts`, `test/connector-adapters.test.mjs` | The oversized original result fails clearly without a second native send; valid boundary text is preserved. |
12
+ | C3 — Actionable missing-runtime diagnostics | Reproduce missing executable, ambiguous OpenClaw profile or missing Linux flock in an isolated setup. Improve only a demonstrated unclear error. | `src/adapters/configure-native.ts`, `src/connector/state.ts`, `test/connector-setup.test.mjs` | The error identifies the operator action; it does not select another profile, remove an active lock, or print a credential. |
13
+ | C4 — Consumer compatibility recipe | Build a small consumer using the public EnvarWorkClient/RuntimeAdapter contracts against a local test fixture. | `src/index.ts`, `src/adapters/types.ts`, `contracts/agent-work/v1/` | Document inputs, exact IDs and replay behavior; distinguish fixture execution from native acceptance, and use no cloud secret. |
14
+
15
+ Every PR should state the problem, before/after behavior, tests, and compatibility
16
+ impact. Run `npm test`; focused file tests help iteration but do not replace the
17
+ normal CI discovery command.
18
+
19
+ ## Maintenance and feedback
20
+
21
+ GitHub Issues is the public support and design entry. Maintainers aim to give
22
+ an initial response within two business days and a substantive review or an
23
+ explicit next step within five business days. This is a best-effort maintenance
24
+ target, not a service-level agreement; availability and scope should be stated
25
+ on the issue when a response takes longer.
26
+
27
+ Issues are triaged as reproducible bug, documentation, compatible enhancement,
28
+ design discussion, or outside current scope. A decision to defer is useful when
29
+ it includes the reason and the supported alternative. Security reports follow
30
+ [SECURITY.md](../SECURITY.md), not a public issue with credentials.
31
+
32
+ Current focus: reproducible setup, compatibility, original-operation recovery,
33
+ and useful adapters. Hosted models, implicit spending permissions and automatic
34
+ resubmission of unknown work are outside this Connector's responsibility.
@@ -0,0 +1,10 @@
1
+ # Moving from EnvarPay Connector
2
+
3
+ EnvarConnect is extracted from the MIT EnvarPay Connector at `2a9e03ebfd0beb9a167ad57473ead56ec5dd9bf5`. It retains the v1 protocol and SQLite journal layout.
4
+
5
+ 1. Keep the original state directory and its owner-only permissions. Stop the old receiver before starting the new one; do not remove its journal or binding files.
6
+ 2. Install the reviewed `@envarai/connect` version. `envar-connect run --agent ID` reads the existing `~/.envarpay/connectors/ID` binding. A custom installation uses the original `--directory PATH`.
7
+ 3. Run `envar-connect connect` with the same Agent/framework/profile to update the native MCP entry. It preserves the active connection and native peer credential. Restart the existing native gateway when requested, then start one receiver.
8
+ 4. Read the original task/order after restart. Reuse persisted request IDs; never buy again to recover a delayed result.
9
+
10
+ Rollback uses the prior EnvarPay package against the same state directory, after stopping the new receiver. Both implementations understand the same journal. Rerun its original connect command if its native MCP command needs restoring. Connection permissions and spending grants are unchanged.
@@ -0,0 +1,79 @@
1
+ # Native Agent Connector
2
+
3
+ Requires the matching Envar native enrollment/WorkService deployment. A package install or authenticated Agent Card is not a real task acceptance test.
4
+
5
+ ## 1. Open the correct terminal
6
+
7
+ Use the same OS user and profile as the native Agent. It must already have a working model and Node.js 22.14+ (24 recommended).
8
+
9
+ | Runtime | Terminal in an official container |
10
+ | --- | --- |
11
+ | Hermes | `docker exec --user hermes -e HOME=/opt/data -it CONTAINER sh` |
12
+ | OpenClaw | `docker exec --user node -e HOME=/home/node -it CONTAINER sh` |
13
+
14
+ Replace `CONTAINER` with your container name. Run `node --version` there. On a local install, use the terminal where the native Agent normally runs. Do not install the Connector under root while the gateway runs as another user.
15
+
16
+ ## 2. Connect and approve
17
+
18
+ Create a private Envar Agent and copy its connection command. The command installs a fixed, bundled package through Envar and selects that exact Agent ID. The official npm package is also available:
19
+
20
+ ```sh
21
+ npm install --prefix "$HOME/.envarpay/cli" --ignore-scripts --no-audit --no-fund @envarai/connect@2026.1107.2
22
+ "$HOME/.envarpay/cli/node_modules/.bin/envar-connect" connect --agent AGENT_UUID --framework hermes
23
+ ```
24
+
25
+ For OpenClaw choose `--framework openclaw`. The command prints a short code and an Envar approval link. Sign in as the owner, verify the Agent and code, and approve. A private polling secret is stored locally and never included in the URL. The request expires in ten minutes. The connection credential lasts up to 30 days and is limited to one Agent.
26
+
27
+ Optional free outgoing permission does not permit spending. The receiving owner must also permit each caller under **Free task permissions**.
28
+
29
+ For multiple OpenClaw Agents, select `--native-agent ID`. Use `--home PATH` for a secondary profile. Hermes honors `HERMES_HOME`; OpenClaw honors `OPENCLAW_STATE_DIR` and `OPENCLAW_CONFIG_PATH`. Setup changes only the managed peer, routing and MCP entry, preserving existing credentials, tools and private configuration backups.
30
+
31
+ ### Managed Ace Data Cloud instances
32
+
33
+ Reuse an existing instance when its subscription and model configuration are
34
+ valid. Keep the existing EnvarPay seller profile and ledger; a new private Envar
35
+ Agent must have its own Connector directory. A seller Agent Card is not a native
36
+ Connector pairing.
37
+
38
+ If Hermes reports that A2A peers are supplied by the deployment environment,
39
+ finish the setup through that deployment's peer configuration. Editing `.env`
40
+ alone cannot override those values. Preserve existing peers, use the generated
41
+ private `native.token` for this Connector only, and never paste it into Envar or
42
+ logs. Have the deployment supervisor run the receiver against its durable
43
+ original directory; an interactive terminal alone does not survive replacement
44
+ of the container.
45
+
46
+ ## 3. Start receiving
47
+
48
+ When setup says a restart is needed, restart the existing native gateway using its normal service/container controls. In Docker, restart the container from the host, then reopen the same user shell. Do not start a second gateway alongside an already supervised one.
49
+
50
+ ```sh
51
+ "$HOME/.envarpay/cli/node_modules/.bin/envar-connect" run --agent AGENT_UUID
52
+ ```
53
+
54
+ Keep this process and the gateway running. For persistent deployment, have your existing supervisor launch this command with the same user, HOME and durable state volume. It uses outbound HTTPS; no public A2A tunnel is required.
55
+
56
+ ## 4. Verify the actual result
57
+
58
+ Send the free connection test from the Agent page. Wait for the exact returned result. `doctor` checks authenticated native A2A and connection status without invoking the model; it cannot establish model/task success.
59
+
60
+ After enabling free outgoing tasks and the recipient's permission, ask the native Agent to use `list_peers`, `send_message`, then `wait_work`/`get_work`. Preserve the same request ID after any lost response. Native MCP also exposes original input/cancel requests and received results. Incoming claims and reports belong to the Connector, not a second model loop.
61
+
62
+ ## Recovery and disconnection
63
+
64
+ - Restart the Connector using its original directory. Its private SQLite journal restores pending reports and original native handles before taking new work.
65
+ - Both currently tested native A2A servers hold Tasks in memory. A native gateway restart may lose the original Task. That state stays **unknown** and is never resubmitted automatically.
66
+ - A lost response after a native send also stays unknown when no original handle can be recovered. Do not replace it with a new paid order.
67
+ - Native input continuation and cancellation are not advertised in this release. A cancellation request after execution starts must wait for the original outcome.
68
+ - `envar-connect disconnect --agent AGENT_UUID` revokes this credential and preserves journals. To reconnect after a website disconnection, stop the old receiver, rerun the original connection command with `--new-pairing`, then approve the new code. A fresh connection cannot recover another connection's admitted work.
69
+ - Expired credentials need owner reauthorization. Inspect unresolved work before disconnecting; do not delete its journal to silence an error.
70
+
71
+ ## Verified versions and remaining acceptance
72
+
73
+ Fresh-container preflight uses OpenClaw `2026.10.4` and the Hermes `2026.9.24` CLI. It verifies installation, dedicated native A2A authorization and native MCP tool discovery. Real inference, six directed Agent exchanges and balance orders are separate release acceptance gates. Unsupported native versions should fail with a concrete setup/protocol error rather than trigger a different runtime.
74
+
75
+ ## Service discovery and budgeted purchases
76
+
77
+ With the companion Envar commerce release, the native Agent can use `list_services`, `quote_service`, `confirm_order`, `get_order`, `wait_order`, `list_orders` and `recover_order`. The owner separately creates a spending grant for one Agent and one immutable service revision, with per-order/total limits and expiry. The connection's optional sending permission is not a spending grant. Without an eligible grant, the confirmation response points to the same original Envar order for owner approval.
78
+
79
+ The Connector persists quote request identities before its network call. Retries preserve the request and original quote; financial POSTs are never retried invisibly. A package upgrade prompts a reload of the native MCP process, preserving the existing journals and runtime credentials.
@@ -0,0 +1,19 @@
1
+ # Stable releases
2
+
3
+ Versions use `YEAR.MONTHDAY.SEQUENCE` in Asia/Shanghai, matching EnvarPay. Run `npm run version:date` when package or image contents change; commit package.json, package-lock.json and the updated current install examples together. The version command synchronizes README/native/compatibility commands; `node scripts/sync-doc-versions.mjs --check` is also covered by `npm test`.
4
+
5
+ Pushes to main that change runtime/package/container files run `publish-npm.yml`. The workflow tests Node 22 and 24, packs once per Node version, installs the actual tarball offline with an empty cache, and builds/runs containers on amd64 and arm64. After those checks it publishes `ghcr.io/envarai/connect:VERSION`, verifies its source/version labels, publishes the tested Node 24 tarball to npm with provenance, verifies version and integrity, updates image latest, and attaches the tarball to GitHub release `vVERSION`.
6
+
7
+ A retry reuses the same npm artifact and source commit. Changed tarballs cannot overwrite published versions; latest cannot move backwards. Rerun failed jobs on the original run. Workflow-only changes do not publish automatically.
8
+
9
+ ## One-time npm setup
10
+
11
+ Configure the npm Trusted Publisher for `@envarai/connect`: GitHub owner `EnvarAI`, repository `EnvarConnect`, workflow `publish-npm.yml`, environment `npm`. The GitHub environment is restricted to main. npm must grant the initial package publication/Trusted Publisher binding to an authorized maintainer; the workflow has no long-lived npm token. Package publication is complete only after the public registry readback succeeds.
12
+
13
+ ## Contracts
14
+
15
+ `contracts/agent-work/v1/schema.json` is the source. Run `node scripts/generate-work-contract.mjs` after editing it. Commit generated types. Publish compatible contracts before updating EnvarAI's pinned copy; incompatible v1 changes require a new contract version. Runtime code never downloads a schema.
16
+
17
+ ## Promote consumers after publication
18
+
19
+ Read the public npm version and SHA-512 integrity before updating the website download manifest or Pay's pinned/bundled Connect dependency. Test each consumer and preserve the original state directory. A website pin may lag a package release deliberately; record that reason in its release/compatibility notes. No receiver is upgraded merely by publishing npm latest.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envarai/connect",
3
- "version": "2026.1107.1",
3
+ "version": "2026.1107.2",
4
4
  "description": "Connect your own Agent to Envar: tasks, native adapters and recovery",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,7 +31,10 @@
31
31
  "dist",
32
32
  "contracts",
33
33
  "README.md",
34
- "LICENSE"
34
+ "LICENSE",
35
+ "docs",
36
+ "CONTRIBUTING.md",
37
+ "SECURITY.md"
35
38
  ],
36
39
  "repository": {
37
40
  "type": "git",
@@ -73,5 +76,15 @@
73
76
  "json5",
74
77
  "yaml",
75
78
  "zod"
79
+ ],
80
+ "homepage": "https://github.com/EnvarAI/EnvarConnect#readme",
81
+ "keywords": [
82
+ "ai-agents",
83
+ "a2a",
84
+ "mcp",
85
+ "agent-work",
86
+ "hermes",
87
+ "openclaw",
88
+ "typescript"
76
89
  ]
77
90
  }