wardpass-edge 0.1.0
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/CONSENT.md +18 -0
- package/LICENSE +17 -0
- package/README.md +115 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +65 -0
- package/package.json +46 -0
package/CONSENT.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Trust Network consent (free hosted tier)
|
|
2
|
+
|
|
3
|
+
The free WardPass control plane is a **blunt trade**: you get hosting; the bureau gets density.
|
|
4
|
+
|
|
5
|
+
WardPass’s free hosted control-plane tier requires **Trust Network** membership.
|
|
6
|
+
|
|
7
|
+
By joining, you agree that WardPass may:
|
|
8
|
+
|
|
9
|
+
1. Use **aggregated or de-identified** fleet and payment-path signals from your operators/agents to power receiving-side **`POST /v1/screen`** decisions for merchants and facilitators.
|
|
10
|
+
2. Share **aggregated or de-identified** payment-path and screen telemetry with **selected insurance, certification, or underwriting evaluation partners**, solely for risk-model diligence and partnership evaluation — not as a lead list of identifiable operators.
|
|
11
|
+
|
|
12
|
+
At low participant counts, aggregated signals may still be attributable to specific operators.
|
|
13
|
+
|
|
14
|
+
You can leave Trust Network at any time. Leaving **stops new contribution**; membership/audit timestamps may be retained. Leaving also ends eligibility for the **free** hosted tier (you may still use this OSS edge against your own DIY settle path without WardPass hosting). Extra agent seats are a later upsell; they are not part of the free TN-backed control plane.
|
|
15
|
+
|
|
16
|
+
**Trust Network membership is not a trust seal.** `/v1/screen` allow still requires a known agent, valid passport where applicable, and **live** operator oversight. Confidence is never `high` in v0; `insufficient_data` is a first-class outcome, not a silent allow.
|
|
17
|
+
|
|
18
|
+
This file is product copy for the signup wall. It is not a substitute for a formal DPA or terms of service once the company is incorporated.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 WardPass / splinterone
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# wardpass-edge
|
|
2
|
+
|
|
3
|
+
**WardPass** gives builders a hosted policy gateway for agent payments — **free** for one seat:
|
|
4
|
+
|
|
5
|
+
- Operator account and **1 agent seat**
|
|
6
|
+
- **Policy Passports** for scoped spend
|
|
7
|
+
- **Reserve / settle** through *your* facilitator(s)
|
|
8
|
+
- Oversight heartbeat (“I’m watching”) — a **dead-man’s switch** on new spend
|
|
9
|
+
- **Clearance network**: when you are on the Trust Network *and* oversight is live, receivers can `POST /v1/screen` before irreversible settle
|
|
10
|
+
|
|
11
|
+
This repo is the thin open-source **phone-home client**. Clone it, point `WARDPASS_URL` at the live staging gateway, and you are on the bureau.
|
|
12
|
+
|
|
13
|
+
It is **not** a self-hosted gateway. It is **not** the AgentBound monorepo. The control plane, ledger, Trust Network, and `/v1/screen` bureau stay on **WardPass hosted**.
|
|
14
|
+
|
|
15
|
+
## Why this exists
|
|
16
|
+
|
|
17
|
+
Receivers take the irreversible-settle risk. Screening only works if enough operators are live, consented, and visible. This client is how you plug in in minutes — densifying the clearance bureau for everyone who screens before they settle.
|
|
18
|
+
|
|
19
|
+
v0 is honest: `/v1/screen` never returns `confidence: high`. `insufficient_data` is first-class, not a silent allow.
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
### 1. Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git clone https://github.com/splinterone/wardpass-edge.git
|
|
27
|
+
cd wardpass-edge
|
|
28
|
+
npm install
|
|
29
|
+
npm run build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
When published: `npm install wardpass-edge`.
|
|
33
|
+
|
|
34
|
+
### 2. Configure
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
export WARDPASS_URL=https://wardpass-gateway-staging.fly.dev
|
|
38
|
+
export WARDPASS_KEY=wpk_… # operator key (phone-home)
|
|
39
|
+
export WARDPASS_RECEIVER_KEY=abrk_… # receiver key for /v1/screen
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
That host is **staging** (`*.fly.dev`), not a production custom domain. `curl "$WARDPASS_URL/health"` should return `{"status":"ok","mode":"gateway"}`. Free tier = one seat; extra seats are a later upsell.
|
|
43
|
+
|
|
44
|
+
### 3. Phone home (operators)
|
|
45
|
+
|
|
46
|
+
Use your operator key against the hosted control plane. This package authenticates; it does not reimplement passports, reserve/settle, or the heartbeat.
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import { WardPassClient } from "wardpass-edge";
|
|
50
|
+
|
|
51
|
+
const wp = new WardPassClient({
|
|
52
|
+
baseUrl: process.env.WARDPASS_URL || "https://wardpass-gateway-staging.fly.dev",
|
|
53
|
+
apiKey: process.env.WARDPASS_KEY,
|
|
54
|
+
});
|
|
55
|
+
// Ready: Policy Passports, reserve/settle, and oversight heartbeat
|
|
56
|
+
// are hosted routes. Call them with this client’s credentials — don’t fork a gateway.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 4. Screen before settle (receivers)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
node examples/screen-before-settle.mjs
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Or in your settle path:
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
import { WardPassClient } from "wardpass-edge";
|
|
69
|
+
|
|
70
|
+
const out = await WardPassClient.screenBeforeSettle({
|
|
71
|
+
baseUrl: process.env.WARDPASS_URL || "https://wardpass-gateway-staging.fly.dev",
|
|
72
|
+
receiverApiKey: process.env.WARDPASS_RECEIVER_KEY, // abrk_…
|
|
73
|
+
body: { agentId, amount, asset, payTo, network },
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
WardPassClient.assertScreenAllow(out); // throws on review | deny | insufficient_data
|
|
77
|
+
// … then call your facilitator settle …
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`allow` still requires a known agent, a valid passport where applicable, and **live** oversight. Trust Network membership is not a trust seal.
|
|
81
|
+
|
|
82
|
+
## Free tier trade
|
|
83
|
+
|
|
84
|
+
Free control plane ↔ **mandatory Trust Network** membership. That is the blunt deal: you get hosting; the bureau gets density.
|
|
85
|
+
|
|
86
|
+
- Aggregated / de-identified signals feed receiving-side **`/v1/screen`**
|
|
87
|
+
- The same class of telemetry may be shared with **selected insurance / certification / underwriting evaluation partners**
|
|
88
|
+
- At low participant counts, aggregated signals may still be attributable to specific operators
|
|
89
|
+
- Leave TN → stop new contribution **and** lose free hosted eligibility
|
|
90
|
+
|
|
91
|
+
Full text: [CONSENT.md](./CONSENT.md).
|
|
92
|
+
|
|
93
|
+
## Not a full gateway
|
|
94
|
+
|
|
95
|
+
| This OSS repo | WardPass hosted (private product) |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| Thin TypeScript client + screen helper | Control plane, hash-chained ledger, Trust Network, `POST /v1/screen` bureau |
|
|
98
|
+
| Apache-2.0 phone-home | Operator seats, Policy Passports, reserve/settle, oversight heartbeat |
|
|
99
|
+
| Clone and run | **Not** the AgentBound monorepo — that stays private |
|
|
100
|
+
|
|
101
|
+
You can point this client at your own DIY settle path without WardPass hosting. You just will not get the free control plane.
|
|
102
|
+
|
|
103
|
+
## Names
|
|
104
|
+
|
|
105
|
+
| Name | Role |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| **WardPass** | Company + public product (gateway for operators + `/screen` for receivers) |
|
|
108
|
+
| **AgentBound** | Private engineering monorepo / interim codename |
|
|
109
|
+
| **wardpass-edge** | This public OSS client |
|
|
110
|
+
|
|
111
|
+
## Status
|
|
112
|
+
|
|
113
|
+
Staging gateway is live at `https://wardpass-gateway-staging.fly.dev` (Fly.dev hostname, not a production custom domain). Point `WARDPASS_URL` at it. npm publish of this package is still pending — clone and `npm run build` until then.
|
|
114
|
+
|
|
115
|
+
Apache-2.0. Product backend remains proprietary.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wardpass-edge — thin phone-home client for WardPass hosted.
|
|
3
|
+
* Plug into the free control plane (passports, reserve/settle, oversight, /v1/screen).
|
|
4
|
+
* Does not implement the full gateway. Not a self-host of AgentBound.
|
|
5
|
+
*/
|
|
6
|
+
export type ScreenDecision = "allow" | "review" | "deny" | "insufficient_data";
|
|
7
|
+
export type ScreenResult = {
|
|
8
|
+
decision: ScreenDecision;
|
|
9
|
+
confidence?: string;
|
|
10
|
+
score?: number;
|
|
11
|
+
screenId?: string;
|
|
12
|
+
factors?: Record<string, unknown>;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
export type WardPassClientOptions = {
|
|
16
|
+
/** Hosted API base, e.g. https://wardpass-gateway-staging.fly.dev (staging, not production) */
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
/** Per-operator API key from free-tier signup (TN consent required). */
|
|
19
|
+
apiKey: string;
|
|
20
|
+
/** Optional operator id header. */
|
|
21
|
+
operatorId?: string;
|
|
22
|
+
fetch?: typeof fetch;
|
|
23
|
+
};
|
|
24
|
+
export declare class WardPassClient {
|
|
25
|
+
readonly baseUrl: string;
|
|
26
|
+
readonly apiKey: string;
|
|
27
|
+
readonly operatorId?: string;
|
|
28
|
+
private readonly fetchImpl;
|
|
29
|
+
constructor(opts: WardPassClientOptions);
|
|
30
|
+
private headers;
|
|
31
|
+
/**
|
|
32
|
+
* Receiver-side helper: call hosted POST /v1/screen before irreversible settle.
|
|
33
|
+
* Uses a **receiver** API key (abrk_…), not an operator key.
|
|
34
|
+
*/
|
|
35
|
+
static screenBeforeSettle(opts: {
|
|
36
|
+
baseUrl: string;
|
|
37
|
+
receiverApiKey: string;
|
|
38
|
+
body: Record<string, unknown>;
|
|
39
|
+
fetch?: typeof fetch;
|
|
40
|
+
}): Promise<ScreenResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Enforce screen decision: allow continues; everything else throws.
|
|
43
|
+
* insufficient_data is not a silent allow.
|
|
44
|
+
*/
|
|
45
|
+
static assertScreenAllow(out: ScreenResult): void;
|
|
46
|
+
}
|
|
47
|
+
export declare const TRUST_NETWORK_CONSENT_SUMMARY = "Free WardPass hosting is a blunt trade: Trust Network membership. Aggregated/de-identified signals feed /v1/screen and may go to selected underwriting evaluation partners. At low participant counts, aggregated signals may still be attributable to specific operators. TN is not a trust seal.";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wardpass-edge — thin phone-home client for WardPass hosted.
|
|
3
|
+
* Plug into the free control plane (passports, reserve/settle, oversight, /v1/screen).
|
|
4
|
+
* Does not implement the full gateway. Not a self-host of AgentBound.
|
|
5
|
+
*/
|
|
6
|
+
export class WardPassClient {
|
|
7
|
+
baseUrl;
|
|
8
|
+
apiKey;
|
|
9
|
+
operatorId;
|
|
10
|
+
fetchImpl;
|
|
11
|
+
constructor(opts) {
|
|
12
|
+
if (!opts.baseUrl)
|
|
13
|
+
throw new Error("baseUrl required");
|
|
14
|
+
if (!opts.apiKey)
|
|
15
|
+
throw new Error("apiKey required — complete hosted signup + Trust Network consent first");
|
|
16
|
+
this.baseUrl = opts.baseUrl.replace(/\/$/, "");
|
|
17
|
+
this.apiKey = opts.apiKey;
|
|
18
|
+
this.operatorId = opts.operatorId;
|
|
19
|
+
this.fetchImpl = opts.fetch ?? fetch;
|
|
20
|
+
}
|
|
21
|
+
headers(extra) {
|
|
22
|
+
const h = {
|
|
23
|
+
authorization: `Bearer ${this.apiKey}`,
|
|
24
|
+
"content-type": "application/json",
|
|
25
|
+
...extra,
|
|
26
|
+
};
|
|
27
|
+
if (this.operatorId)
|
|
28
|
+
h["x-operator-id"] = this.operatorId;
|
|
29
|
+
return h;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Receiver-side helper: call hosted POST /v1/screen before irreversible settle.
|
|
33
|
+
* Uses a **receiver** API key (abrk_…), not an operator key.
|
|
34
|
+
*/
|
|
35
|
+
static async screenBeforeSettle(opts) {
|
|
36
|
+
const fetchImpl = opts.fetch ?? fetch;
|
|
37
|
+
const base = opts.baseUrl.replace(/\/$/, "");
|
|
38
|
+
const res = await fetchImpl(`${base}/v1/screen`, {
|
|
39
|
+
method: "POST",
|
|
40
|
+
headers: {
|
|
41
|
+
authorization: `Bearer ${opts.receiverApiKey}`,
|
|
42
|
+
"content-type": "application/json",
|
|
43
|
+
},
|
|
44
|
+
body: JSON.stringify(opts.body),
|
|
45
|
+
});
|
|
46
|
+
const out = (await res.json());
|
|
47
|
+
if (!res.ok)
|
|
48
|
+
throw new Error(out.error || `screen_http_${res.status}`);
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Enforce screen decision: allow continues; everything else throws.
|
|
53
|
+
* insufficient_data is not a silent allow.
|
|
54
|
+
*/
|
|
55
|
+
static assertScreenAllow(out) {
|
|
56
|
+
if (out.decision === "allow")
|
|
57
|
+
return;
|
|
58
|
+
if (out.decision === "review")
|
|
59
|
+
throw new Error("screen_review");
|
|
60
|
+
if (out.decision === "deny")
|
|
61
|
+
throw new Error("screen_deny");
|
|
62
|
+
throw new Error("screen_insufficient_data");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export const TRUST_NETWORK_CONSENT_SUMMARY = "Free WardPass hosting is a blunt trade: Trust Network membership. Aggregated/de-identified signals feed /v1/screen and may go to selected underwriting evaluation partners. At low participant counts, aggregated signals may still be attributable to specific operators. TN is not a trust seal.";
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wardpass-edge",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Thin OSS client for WardPass — plug into the free hosted policy gateway, Policy Passports, and pre-settle /v1/screen. Not a full gateway self-host.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"CONSENT.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"test": "node --test test/*.test.js",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/splinterone/wardpass-edge.git"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"wardpass",
|
|
35
|
+
"x402",
|
|
36
|
+
"agent-payments",
|
|
37
|
+
"policy-passport",
|
|
38
|
+
"pre-settle",
|
|
39
|
+
"clearance",
|
|
40
|
+
"trust-network",
|
|
41
|
+
"screen"
|
|
42
|
+
],
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"typescript": "^5.6.0"
|
|
45
|
+
}
|
|
46
|
+
}
|