402mob-runtime 0.3.2 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +38 -3
  2. package/dist/runtime/cli.js +1181 -613
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -7,14 +7,14 @@ An owner-controlled Base USDC signer, delegated buyer and text-statistics seller
7
7
  Use Node.js 24+ on Linux or macOS. Check https://evidence.contact/agent-runtime-release.json for this version's publication status. Use the npm commands below only when it reports `npmPublished: true`; otherwise use the standalone download described below.
8
8
 
9
9
  ```sh
10
- npm exec --yes --package=402mob-runtime@0.3.2 -- 402mob-runtime wallet web \
10
+ npm exec --yes --package=402mob-runtime@0.3.3 -- 402mob-runtime wallet web \
11
11
  --dir "$HOME/.local/share/402mob/runtime-owner"
12
12
  ```
13
13
 
14
14
  For a persistent CLI, install into your own prefix:
15
15
 
16
16
  ```sh
17
- npm install --prefix "$HOME/.local/share/402mob/runtime-cli" --ignore-scripts 402mob-runtime@0.3.2
17
+ npm install --prefix "$HOME/.local/share/402mob/runtime-cli" --ignore-scripts 402mob-runtime@0.3.3
18
18
  export PATH="$HOME/.local/share/402mob/runtime-cli/node_modules/.bin:$PATH"
19
19
  ```
20
20
 
@@ -66,8 +66,43 @@ Run `402mob-runtime --help` for all commands. Full guides: https://evidence.cont
66
66
 
67
67
  `local_port_in_use` means another process already owns the named local port. If it is your signer, press Enter in its original terminal for a new pairing link, or stop it with Ctrl+C and restart with the same `--dir`. Do not start a second signer for the same wallet on different ports. The CLI preserves wallet state and closes any listener opened during a failed startup. Version 0.2.0 reported this condition as `adapter_failure`.
68
68
 
69
- If the local console page returns `adapter_failure` while the hosted console works, upgrade from 0.2.0 or 0.2.1 to 0.3.2. Those versions incorrectly blocked page assets beneath hidden installation directories such as `.npm` and `.local`. Stop the old signer, restart the upgraded version with the same wallet `--dir`, and use its new pairing link.
69
+ If the local console page returns `adapter_failure` while the hosted console works, upgrade from 0.2.0 or 0.2.1 to 0.3.3. Those versions incorrectly blocked page assets beneath hidden installation directories such as `.npm` and `.local`. Stop the old signer, restart the upgraded version with the same wallet `--dir`, and use its new pairing link.
70
70
 
71
71
  ## Recovery and custody
72
72
 
73
73
  Retain original private directories, credential and request IDs. Do not copy a wallet ledger for concurrent spending or restore an old snapshot to clear reservations. Revocation stops new authorizations; existing signed payments may still settle. Delegation is enforced by the local owner process, not by USDC's smart contract. Creation and delegation do not fund the wallet. Direct purchases do not provide automatic refunds or certify subjective quality.
74
+
75
+ ## Execute accepted text-statistics terms
76
+
77
+ Runtime 0.3.3 can consume an already accepted negotiation for `text-statistics-v1`. Both participants must enroll first; the buyer enrollment wallet must be the runtime wallet. Negotiate through HTTP or MCP: the runtime does not poll conversations or propose terms.
78
+
79
+ Agree `direct_prepayment`, `application/json`, the seller's configured price, and exactly this deliverable:
80
+
81
+ ```text
82
+ text-statistics-v1: SHA-256, UTF-8 bytes, Unicode code points, whitespace-delimited words and LF lines; no normalization
83
+ ```
84
+
85
+ The acceptance criteria must contain exactly one string: `Result equals text-statistics-v1 for the exact signed input.` Other criteria and capabilities are not executable by this adapter; the Integration Diagnosis worker also does not consume negotiated tickets.
86
+
87
+ After acceptance, copy `executionReference` from the authenticated handoff into the fresh-work task's `negotiation` field:
88
+
89
+ ```json
90
+ {
91
+ "id": "<new saved task UUID>",
92
+ "merchantId": "<accepted seller UUID>",
93
+ "input": {"text": "Text to measure"},
94
+ "maxPriceUSDC": "0.02",
95
+ "expiresInSeconds": 600,
96
+ "negotiation": {
97
+ "negotiationId": "<accepted inquiry UUID>",
98
+ "acceptedRevision": 3,
99
+ "termsHash": "<exact accepted terms SHA-256>"
100
+ }
101
+ }
102
+ ```
103
+
104
+ Use the exact agreed price as `maxPriceUSDC`. Choose `expiresInSeconds` (60–86400, default 3600) within both the remaining negotiation lifetime and agreed delivery duration. Submit through the existing fresh-work task API using the same persisted task UUID on retries.
105
+
106
+ The runtime signs the linked grant, saves the ticket ID, reads private Transaction Evidence, checks the accepted reference and supported terms, and verifies the quote before authorizing payment. The seller checks the same terms and waits for confirmed funding before computing. The buyer independently recomputes the result and records its receipt. Unsupported criteria stop with `needs_attention` before payment; a ticket may already exist, so retain its ID and original directories. No escrow or refund rule is added. Negotiated runtime tests use mocked settlement; existing live runtime records cover earlier unlinked flows.
107
+
108
+ During negotiation binding, transport failures and HTTP 429/5xx responses from the private evidence reader retry automatically, with at most four attempts before `needs_attention`. Retries keep the original task and ticket; no payment is authorized during this step. Invalid evidence or mismatched terms stop immediately. Retain the same directories and use the existing owner retry command after resolving a persistent failure.