twzrd-x402-gate 0.9.7 → 0.9.9
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/QUICKSTART.md +35 -8
- package/README.md +13 -10
- package/bin/twzrd-cold-start.js +69 -0
- package/dist/cold-start.d.ts +115 -0
- package/dist/cold-start.d.ts.map +1 -0
- package/dist/cold-start.js +461 -0
- package/dist/cold-start.js.map +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/evaluate.d.ts +8 -0
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +10 -1
- package/dist/evaluate.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/merchant-card.d.ts +36 -2
- package/dist/merchant-card.d.ts.map +1 -1
- package/dist/merchant-card.js +52 -12
- package/dist/merchant-card.js.map +1 -1
- package/dist/network.d.ts +25 -6
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +45 -7
- package/dist/network.js.map +1 -1
- package/dist/payment-decision.d.ts +16 -22
- package/dist/payment-decision.d.ts.map +1 -1
- package/dist/payment-decision.js +31 -17
- package/dist/payment-decision.js.map +1 -1
- package/dist/policy.d.ts +10 -0
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +98 -6
- package/dist/policy.js.map +1 -1
- package/dist/resource-bind-tx.js +3 -3
- package/dist/resource-bind-tx.js.map +1 -1
- package/dist/resource-bind.d.ts +17 -3
- package/dist/resource-bind.d.ts.map +1 -1
- package/dist/resource-bind.js +75 -15
- package/dist/resource-bind.js.map +1 -1
- package/dist/spend-control.d.ts +11 -0
- package/dist/spend-control.d.ts.map +1 -1
- package/dist/spend-control.js +14 -2
- package/dist/spend-control.js.map +1 -1
- package/dist/types.d.ts +25 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/x402-client-hook.d.ts +7 -1
- package/dist/x402-client-hook.d.ts.map +1 -1
- package/dist/x402-client-hook.js +6 -0
- package/dist/x402-client-hook.js.map +1 -1
- package/package.json +12 -8
package/QUICKSTART.md
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Refuses payment to a wash-flagged merchant **before your wallet signs**. Free intel, no
|
|
4
4
|
API key, no signup, no config — every `TWZRD_*` env var is an optional override. If intel
|
|
5
|
-
is unreachable the gate never *invents* a wash flag
|
|
6
|
-
|
|
5
|
+
is unreachable the gate never *invents* a wash flag. A failed preflight, or a merchant_card
|
|
6
|
+
outage on a scored path, blocks by default (`TWZRD_FAIL_OPEN=true` to allow). A reachable
|
|
7
|
+
card with no wash signal still proceeds.
|
|
7
8
|
|
|
8
|
-
**Pin:** `twzrd-x402-gate@0.9.
|
|
9
|
+
**Pin:** `twzrd-x402-gate@0.9.8` + stock PayAI client `x402-solana@3.0.0` (official
|
|
9
10
|
`beforePayment` seat). `@x402/core` Path E remains supported; refuse script is fallback.
|
|
10
11
|
|
|
11
12
|
## 1. Stock PayAI client (default seat — copy-paste)
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
|
-
npm install twzrd-x402-gate@0.9.
|
|
15
|
+
npm install twzrd-x402-gate@0.9.8 x402-solana@3.0.0
|
|
15
16
|
```
|
|
16
17
|
|
|
17
18
|
> **ESM-only.** The package ships `import` conditions only — a CommonJS
|
|
@@ -36,7 +37,7 @@ Then: `await client.fetch("https://merchant.example/paid");`
|
|
|
36
37
|
## 1b. Official `@x402/core` client (Path E)
|
|
37
38
|
|
|
38
39
|
```bash
|
|
39
|
-
npm install twzrd-x402-gate@0.9.
|
|
40
|
+
npm install twzrd-x402-gate@0.9.8 @x402/core @x402/fetch @x402/svm
|
|
40
41
|
```
|
|
41
42
|
|
|
42
43
|
```typescript
|
|
@@ -76,12 +77,38 @@ The factory itself does not read `TWZRD_AUTO_GATE`; use the AutoGate seat if you
|
|
|
76
77
|
want the env kill switch re-read per call. You cannot `installTwzrdAutoGate(client)`
|
|
77
78
|
after `createPayKitClient` — PayKit only accepts the hook at construction.
|
|
78
79
|
|
|
80
|
+
## 1d. Cold-start a foreign diet (0 USDC)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx twzrd-cold-start
|
|
84
|
+
# policy.json: default-deny allowlist of foreign 402 hosts
|
|
85
|
+
# signer_invocation_count: 0, usdc_spent: 0
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Probes a pinned foreign GET 402 diet (not `*.twzrd`), scores each `payTo` with
|
|
89
|
+
`evaluate_x402_resource` (wash refuse), writes `policy.json`, hops once from
|
|
90
|
+
the resource join. Does not spend. `--spend` is refused. Seat AutoGate on the
|
|
91
|
+
payer with
|
|
92
|
+
`beforePayment: installTwzrdAutoGate("x402-solana", { refuseWashFlagged: true })`
|
|
93
|
+
using that policy as the host allowlist. Live proof (needs egress):
|
|
94
|
+
`npm run cold-start-live`.
|
|
95
|
+
|
|
79
96
|
## 2. Prove it blocked something (spends nothing)
|
|
80
97
|
|
|
98
|
+
Hello-world that closes from this package (needs a prior **repo-root** `npm ci`
|
|
99
|
+
and `npm run build`; do not `npm ci` in this directory):
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run gate-eval-refuse
|
|
103
|
+
# signer_invocation_count: 0, usdc_spent: 0
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Optional seat proofs (live intel; the clean-fixture leg can exit 2 when
|
|
107
|
+
`CLEAN_PAYTO` is wash-flagged — that is not the first demo):
|
|
108
|
+
|
|
81
109
|
```bash
|
|
82
|
-
# Stock-client seat proof (beforePayment
|
|
83
|
-
#
|
|
84
|
-
# clear closure (its negative arm counts a would-be sign)
|
|
110
|
+
# Stock-client seat proof (beforePayment). Needs x402-solana@3.0.0.
|
|
111
|
+
# Harness fallback runs without it but does not clear closure.
|
|
85
112
|
npm run x402-solana-before-payment-proof
|
|
86
113
|
# writes block-proof-<run_id>.json — hook: beforePayment
|
|
87
114
|
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ transfer on-chain. Wash/sybil edges are primarily discounted in TWZRD scoring, n
|
|
|
80
80
|
revenue refusal.
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
npm install twzrd-x402-gate@0.9.
|
|
83
|
+
npm install twzrd-x402-gate@0.9.8
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
@@ -125,7 +125,7 @@ Fixture-backed SVM extract tests live in `test/seller-hook.test.ts` +
|
|
|
125
125
|
Install the published gate and run against wash fixtures:
|
|
126
126
|
|
|
127
127
|
```bash
|
|
128
|
-
npm install twzrd-x402-gate@0.9.
|
|
128
|
+
npm install twzrd-x402-gate@0.9.8
|
|
129
129
|
# from package root after install, or from a checkout:
|
|
130
130
|
npm run wash-dogfood
|
|
131
131
|
```
|
|
@@ -273,8 +273,10 @@ Canonical path for every agent that spends USDC on Solana x402:
|
|
|
273
273
|
| 4 | Pay (or refuse) | resource price | Only if steps 1–2 approved (and any opt-in paid escalate did not block). |
|
|
274
274
|
|
|
275
275
|
**Fail-open (no invent):**
|
|
276
|
-
- Preflight HTTP/network error → default fail-closed
|
|
277
|
-
- Merchant card
|
|
276
|
+
- Preflight HTTP/network error → default fail-closed (`TWZRD_FAIL_OPEN=true` restores legacy allow-on-outage).
|
|
277
|
+
- Merchant card **outage** on a reputation-scored path (5xx, 429, thrown fetch, non-JSON 200) → same `failOpen` switch; default refuses with `twzrd_card_unreachable_fail_closed`. This is tighten-only: an already-blocked payment keeps its more specific reason.
|
|
278
|
+
- Merchant card **reachable** with no `wash_flagged` (including 4xx, or 200 + `insufficient_evidence`) → `washFlagged=null` → **do not refuse on wash**.
|
|
279
|
+
- Unscored-network `observe`: a card outage keeps the observe allow; `wash_flagged: true` still refuses.
|
|
278
280
|
- Only a successful card with `wash_flagged: true` triggers wash refuse or soft cap.
|
|
279
281
|
|
|
280
282
|
**Wash policy (exact):**
|
|
@@ -295,7 +297,7 @@ Dogfood (one public live proof path):
|
|
|
295
297
|
## Install
|
|
296
298
|
|
|
297
299
|
```bash
|
|
298
|
-
npm install twzrd-x402-gate@0.9.
|
|
300
|
+
npm install twzrd-x402-gate@0.9.8
|
|
299
301
|
```
|
|
300
302
|
|
|
301
303
|
Do not hardcode a version in this doc — every past pin here (**0.5.4**, **0.7.1**, **0.8.5**,
|
|
@@ -561,7 +563,7 @@ Default **ON**. Disable with `TWZRD_AUTO_GATE=0` (env, deploy-time kill switch)
|
|
|
561
563
|
What happens on every HTTP 402 the raw fetch returns:
|
|
562
564
|
1. Reads the Solana-network entry from `accepts[]` (falls back to first entry) to get the seller wallet.
|
|
563
565
|
2. Calls `POST /v1/intel/preflight` — free, no auth. `decision=block` (or score floor) throws — `payWrap`'s client never signs.
|
|
564
|
-
3. Calls `GET /v1/intel/merchant_card/{payTo}` — free, no auth. `wash_flagged: true` refuses by default (only tightens step 2
|
|
566
|
+
3. Calls `GET /v1/intel/merchant_card/{payTo}` — free, no auth. `wash_flagged: true` refuses by default (only tightens step 2). A reachable card with no wash signal fails open (no invent). A card outage on the scored path honours `failOpen` (default fail-closed).
|
|
565
567
|
4. Otherwise returns the 402 to `payWrap`'s client, which pays normally.
|
|
566
568
|
|
|
567
569
|
Non-402 responses pass through unchanged.
|
|
@@ -656,7 +658,8 @@ What the guard does on HTTP 402:
|
|
|
656
658
|
1. Reads the Solana-network entry from `accepts[]` (falls back to first entry) to get the seller wallet.
|
|
657
659
|
2. Free `POST /v1/intel/preflight` — `decision=block` / score floor deny.
|
|
658
660
|
3. Free `GET /v1/intel/merchant_card/{payTo}` — `wash_flagged:true` **refuses by default**
|
|
659
|
-
(`reason: twzrd_wash_flagged`).
|
|
661
|
+
(`reason: twzrd_wash_flagged`). Reachable + no signal fails open (no invent). A card
|
|
662
|
+
outage on the scored path honours `failOpen` (default fail-closed).
|
|
660
663
|
4. If approved: returns the original 402 for the x402 client to pay.
|
|
661
664
|
|
|
662
665
|
Opt out of wash refuse: `withTwzrdGuard(fetch, { refuseWashFlagged: false })` or
|
|
@@ -672,14 +675,14 @@ const safeFetch = withTwzrdGuard(x402Fetch, {
|
|
|
672
675
|
autoReceipt: true, // on warn or allow, auto-buy the $0.05 TWZRD trust receipt
|
|
673
676
|
x402Fetch, // the paying fetch — TWZRD earns the fee on-chain
|
|
674
677
|
onReceipt: (receipt, tx) => {
|
|
675
|
-
// receipt is a twzrd_receipt (
|
|
678
|
+
// receipt is a twzrd_receipt (V7 + ERC-8004 reputation_credential)
|
|
676
679
|
console.log("Trust receipt captured:", tx);
|
|
677
680
|
},
|
|
678
681
|
});
|
|
679
682
|
```
|
|
680
683
|
|
|
681
684
|
`autoReceipt` is **off by default** — it spends the **buyer's** USDC, so you opt in. When on,
|
|
682
|
-
every warn/allow verdict settles $0.05 USDC to TWZRD and returns a signed
|
|
685
|
+
every warn/allow verdict settles $0.05 USDC to TWZRD and returns a signed V7 trust credential
|
|
683
686
|
for the counterparty before you pay the resource.
|
|
684
687
|
|
|
685
688
|
**`x402Fetch` is yours to supply** (this package is dependency-free). Wire the proven
|
|
@@ -698,7 +701,7 @@ is the next step.
|
|
|
698
701
|
### Quick tier ($0.001) — cheap paid qualify
|
|
699
702
|
|
|
700
703
|
The reputation ladder has three rungs: **free** preflight (`allow/warn/block`), **$0.001**
|
|
701
|
-
`quickCheck` (tier + score, no receipt), **$0.05** `autoReceipt` (full intel + signed
|
|
704
|
+
`quickCheck` (tier + score, no receipt), **$0.05** `autoReceipt` (full intel + signed V7
|
|
702
705
|
receipt). When the free preflight is inconclusive (`warn` / unknown seller) and you want a
|
|
703
706
|
cheap *paid* confirmation before committing — without paying 50× for the portable receipt —
|
|
704
707
|
use `quickCheck`:
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Cold-start buyer loop — zero spend.
|
|
4
|
+
*
|
|
5
|
+
* Probe a pinned foreign x402 diet, run AutoGate (refuse wash) before any
|
|
6
|
+
* signer, write default-deny policy.json, hop once from the resource join.
|
|
7
|
+
* Nothing here signs or spends. Self-serve transcript, not EXTERNAL_RUN.
|
|
8
|
+
*
|
|
9
|
+
* Usage (after npm run build, or from the published package):
|
|
10
|
+
* npx twzrd-cold-start
|
|
11
|
+
* node node_modules/twzrd-x402-gate/bin/twzrd-cold-start.js --no-hop
|
|
12
|
+
*/
|
|
13
|
+
import { dirname, join } from "node:path";
|
|
14
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
|
+
|
|
17
|
+
const pkgRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
18
|
+
|
|
19
|
+
async function loadCli() {
|
|
20
|
+
const dist = join(pkgRoot, "dist", "cold-start.js");
|
|
21
|
+
if (existsSync(dist)) return import(pathToFileURL(dist).href);
|
|
22
|
+
console.error(
|
|
23
|
+
"twzrd-cold-start: run `npm run build` in twzrd-x402-gate or install the published package",
|
|
24
|
+
);
|
|
25
|
+
process.exit(2);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function main() {
|
|
29
|
+
const { parseArgs, runColdStart, USAGE, HelpError } = await loadCli();
|
|
30
|
+
let args;
|
|
31
|
+
try {
|
|
32
|
+
args = parseArgs(process.argv.slice(2));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
if (e instanceof HelpError || (e instanceof Error && e.name === "HelpError")) {
|
|
35
|
+
console.log(e.message);
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
console.error(`twzrd-cold-start: ${e instanceof Error ? e.message : e}`);
|
|
39
|
+
console.error(USAGE);
|
|
40
|
+
process.exit(2);
|
|
41
|
+
}
|
|
42
|
+
const { log, info } = console;
|
|
43
|
+
console.log = (...a) => console.error(...a);
|
|
44
|
+
console.info = (...a) => console.error(...a);
|
|
45
|
+
let run;
|
|
46
|
+
try {
|
|
47
|
+
run = await runColdStart(args);
|
|
48
|
+
} finally {
|
|
49
|
+
console.log = log;
|
|
50
|
+
console.info = info;
|
|
51
|
+
}
|
|
52
|
+
const { transcript, exitCode } = run;
|
|
53
|
+
console.log(JSON.stringify(transcript, null, 2));
|
|
54
|
+
if (transcript.ok) {
|
|
55
|
+
console.error(
|
|
56
|
+
`OK: cold-start ${transcript.allowlisted_count} allowlisted, signer_invocation_count=0, usdc_spent=0 — self-serve, not EXTERNAL_RUN`,
|
|
57
|
+
);
|
|
58
|
+
} else {
|
|
59
|
+
console.error(
|
|
60
|
+
"FAIL: no diet host scored a 402 (signer_invocation_count=0, usdc_spent=0) — self-serve, not EXTERNAL_RUN",
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
process.exit(exitCode);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
main().catch((e) => {
|
|
67
|
+
console.error("twzrd-cold-start FAILED", e instanceof Error ? e.message : e);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cold-start buyer loop — no spend.
|
|
3
|
+
*
|
|
4
|
+
* Probe a pinned foreign x402 diet, score each payTo with evaluate_x402_resource
|
|
5
|
+
* (same policy AutoGate uses), write a default-deny policy.json, hop once from
|
|
6
|
+
* the resource join. Never pays. Never lists a TWZRD-operated seller as diet.
|
|
7
|
+
* Seat AutoGate on the real payer with the snippet on the transcript.
|
|
8
|
+
*/
|
|
9
|
+
import { type GateAdoptionLineage } from "./adoption-proof.js";
|
|
10
|
+
export declare const COLD_START_TRANSCRIPT_SCHEMA: "twzrd.cold_start_transcript.v1";
|
|
11
|
+
export declare const COLD_START_POLICY_SCHEMA: "twzrd.cold_start_policy.v1";
|
|
12
|
+
/** Owned refuse dogfood — never a diet/hop target. */
|
|
13
|
+
export declare const REFUSE_FIXTURE_PAYTO = "CnTmHDXVEafkc8sFSzNky9w5zwk63Bk2mHZZodorjhvR";
|
|
14
|
+
/**
|
|
15
|
+
* Pinned foreign GET 402s. Independently controlled sellers, not `*.twzrd`.
|
|
16
|
+
* Live drift is recorded as a probe miss; it does not invent a catalog.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DEFAULT_COLD_START_DIET: readonly string[];
|
|
19
|
+
export declare const DEFAULT_MAX_PER_CALL_USDC = 0.05;
|
|
20
|
+
export declare const DEFAULT_MAX_PER_DAY_USDC = 0.5;
|
|
21
|
+
export declare const AUTOGATE_INSTALL_SNIPPET = "beforePayment: installTwzrdAutoGate(\"x402-solana\", { refuseWashFlagged: true })";
|
|
22
|
+
export declare const USAGE = "usage: twzrd-cold-start [--diet-url <https url>]... [--no-hop]\n [--integration <id>] [--run-id <uuid>] [--policy-out policy.json] [--out transcript.json]\n [--intel-base https://intel.twzrd.xyz] [--max-per-call-usdc 0.05] [--max-per-day-usdc 0.50]\n\n Probe a pinned foreign x402 diet (not *.twzrd), score each payTo with\n evaluate_x402_resource (wash refuse), write a default-deny policy.json, then hop\n once from GET /v1/intel/resources. Default is no spend. --spend is refused.\n Seat AutoGate on the payer with the snippet on the transcript.\n\n Exit 0: at least one diet host scored (allowlisted|refused|over_cap).\n Exit 1: no diet host scored a 402. Exit 2: bad invocation.\n Self-serve is dogfood, not EXTERNAL_RUN.";
|
|
23
|
+
export type ColdStartHostStatus = "allowlisted" | "refused" | "over_cap" | "not_402" | "no_payto" | "forbidden" | "probe_error" | "no_eligible_hop" | "directory_error";
|
|
24
|
+
export type ColdStartHostRow = {
|
|
25
|
+
role: "diet" | "hop";
|
|
26
|
+
resource_url: string;
|
|
27
|
+
host: string | null;
|
|
28
|
+
pay_to: string | null;
|
|
29
|
+
network: string | null;
|
|
30
|
+
price_usdc: number | null;
|
|
31
|
+
http_status: number | null;
|
|
32
|
+
decision: string | null;
|
|
33
|
+
approved: boolean;
|
|
34
|
+
reason: string;
|
|
35
|
+
wash_flagged: boolean | null;
|
|
36
|
+
status: ColdStartHostStatus;
|
|
37
|
+
abort: boolean;
|
|
38
|
+
};
|
|
39
|
+
export type ColdStartPolicyHost = {
|
|
40
|
+
host: string;
|
|
41
|
+
resource_url: string;
|
|
42
|
+
pay_to: string;
|
|
43
|
+
network: string | null;
|
|
44
|
+
price_usdc: number | null;
|
|
45
|
+
};
|
|
46
|
+
export type ColdStartPolicy = {
|
|
47
|
+
schema: typeof COLD_START_POLICY_SCHEMA;
|
|
48
|
+
mode: "default_deny";
|
|
49
|
+
refuse_wash_flagged: true;
|
|
50
|
+
max_per_call_usdc: number;
|
|
51
|
+
/** Advisory for the payer; this CLI does not enforce a daily cap. */
|
|
52
|
+
max_per_day_usdc: number;
|
|
53
|
+
autogate: {
|
|
54
|
+
refuseWashFlagged: true;
|
|
55
|
+
install: string;
|
|
56
|
+
};
|
|
57
|
+
hosts: ColdStartPolicyHost[];
|
|
58
|
+
};
|
|
59
|
+
export type ColdStartTranscript = {
|
|
60
|
+
schema: typeof COLD_START_TRANSCRIPT_SCHEMA;
|
|
61
|
+
package: "twzrd-x402-gate";
|
|
62
|
+
packageVersion: string;
|
|
63
|
+
mode: "no_spend";
|
|
64
|
+
integration: string;
|
|
65
|
+
runId: string;
|
|
66
|
+
lineage: GateAdoptionLineage;
|
|
67
|
+
clientHeader: string;
|
|
68
|
+
autogate: {
|
|
69
|
+
refuseWashFlagged: true;
|
|
70
|
+
install: string;
|
|
71
|
+
};
|
|
72
|
+
signer_invocation_count: 0;
|
|
73
|
+
payment_retry_count: 0;
|
|
74
|
+
usdc_spent: 0;
|
|
75
|
+
diet_urls: string[];
|
|
76
|
+
hop: boolean;
|
|
77
|
+
hosts: ColdStartHostRow[];
|
|
78
|
+
allowlisted_count: number;
|
|
79
|
+
policy: ColdStartPolicy;
|
|
80
|
+
policy_path: string | null;
|
|
81
|
+
exportedAt: string;
|
|
82
|
+
notExternalRunProof: string[];
|
|
83
|
+
/** True when at least one diet host was scored (allowlisted|refused|over_cap). */
|
|
84
|
+
ok: boolean;
|
|
85
|
+
};
|
|
86
|
+
export type ColdStartArgs = {
|
|
87
|
+
dietUrls: string[];
|
|
88
|
+
hop: boolean;
|
|
89
|
+
integration: string;
|
|
90
|
+
runId: string;
|
|
91
|
+
policyOut: string;
|
|
92
|
+
out: string | null;
|
|
93
|
+
intelBase: string;
|
|
94
|
+
maxPerCallUsdc: number;
|
|
95
|
+
maxPerDayUsdc: number;
|
|
96
|
+
};
|
|
97
|
+
export declare function hostnameOf(url: string): string | null;
|
|
98
|
+
export declare function isForbiddenHost(host: string | null): boolean;
|
|
99
|
+
export declare function isForbiddenUrl(url: string): boolean;
|
|
100
|
+
export declare function isForbiddenPayTo(payTo: string | null | undefined): boolean;
|
|
101
|
+
export declare function parseArgs(argv: string[]): ColdStartArgs;
|
|
102
|
+
export declare class HelpError extends Error {
|
|
103
|
+
constructor(message: string);
|
|
104
|
+
}
|
|
105
|
+
export declare function buildPolicy(input: {
|
|
106
|
+
maxPerCallUsdc: number;
|
|
107
|
+
maxPerDayUsdc: number;
|
|
108
|
+
hosts: ColdStartHostRow[];
|
|
109
|
+
}): ColdStartPolicy;
|
|
110
|
+
export declare function runColdStart(args: ColdStartArgs): Promise<{
|
|
111
|
+
transcript: ColdStartTranscript;
|
|
112
|
+
policy: ColdStartPolicy;
|
|
113
|
+
exitCode: 0 | 1;
|
|
114
|
+
}>;
|
|
115
|
+
//# sourceMappingURL=cold-start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cold-start.d.ts","sourceRoot":"","sources":["../src/cold-start.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAY/E,eAAO,MAAM,4BAA4B,EAAG,gCAAyC,CAAC;AACtF,eAAO,MAAM,wBAAwB,EAAG,4BAAqC,CAAC;AAE9E,sDAAsD;AACtD,eAAO,MAAM,oBAAoB,iDAAiD,CAAC;AAEnF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAIpD,CAAC;AAEF,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,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