@absol-labs/agent 0.9.1 → 0.10.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.
Files changed (199) hide show
  1. package/README.md +77 -3
  2. package/dist/cli/amounts.d.ts +26 -0
  3. package/dist/cli/amounts.d.ts.map +1 -0
  4. package/dist/cli/amounts.js +71 -0
  5. package/dist/cli/amounts.js.map +1 -0
  6. package/dist/cli/args.d.ts +32 -0
  7. package/dist/cli/args.d.ts.map +1 -0
  8. package/dist/cli/args.js +119 -0
  9. package/dist/cli/args.js.map +1 -0
  10. package/dist/cli/attesters.d.ts +51 -0
  11. package/dist/cli/attesters.d.ts.map +1 -0
  12. package/dist/cli/attesters.js +58 -0
  13. package/dist/cli/attesters.js.map +1 -0
  14. package/dist/cli/bin.d.ts +3 -0
  15. package/dist/cli/bin.d.ts.map +1 -0
  16. package/dist/cli/bin.js +5 -0
  17. package/dist/cli/bin.js.map +1 -0
  18. package/dist/cli/commands/claim.d.ts +13 -0
  19. package/dist/cli/commands/claim.d.ts.map +1 -0
  20. package/dist/cli/commands/claim.js +86 -0
  21. package/dist/cli/commands/claim.js.map +1 -0
  22. package/dist/cli/commands/close.d.ts +3 -0
  23. package/dist/cli/commands/close.d.ts.map +1 -0
  24. package/dist/cli/commands/close.js +43 -0
  25. package/dist/cli/commands/close.js.map +1 -0
  26. package/dist/cli/commands/discover.d.ts +3 -0
  27. package/dist/cli/commands/discover.d.ts.map +1 -0
  28. package/dist/cli/commands/discover.js +183 -0
  29. package/dist/cli/commands/discover.js.map +1 -0
  30. package/dist/cli/commands/invoke.d.ts +3 -0
  31. package/dist/cli/commands/invoke.d.ts.map +1 -0
  32. package/dist/cli/commands/invoke.js +141 -0
  33. package/dist/cli/commands/invoke.js.map +1 -0
  34. package/dist/cli/commands/mcp.d.ts +3 -0
  35. package/dist/cli/commands/mcp.d.ts.map +1 -0
  36. package/dist/cli/commands/mcp.js +113 -0
  37. package/dist/cli/commands/mcp.js.map +1 -0
  38. package/dist/cli/commands/open.d.ts +3 -0
  39. package/dist/cli/commands/open.d.ts.map +1 -0
  40. package/dist/cli/commands/open.js +279 -0
  41. package/dist/cli/commands/open.js.map +1 -0
  42. package/dist/cli/commands/reclaim-unverified.d.ts +3 -0
  43. package/dist/cli/commands/reclaim-unverified.d.ts.map +1 -0
  44. package/dist/cli/commands/reclaim-unverified.js +164 -0
  45. package/dist/cli/commands/reclaim-unverified.js.map +1 -0
  46. package/dist/cli/commands/reclaim.d.ts +33 -0
  47. package/dist/cli/commands/reclaim.d.ts.map +1 -0
  48. package/dist/cli/commands/reclaim.js +297 -0
  49. package/dist/cli/commands/reclaim.js.map +1 -0
  50. package/dist/cli/commands/status.d.ts +3 -0
  51. package/dist/cli/commands/status.d.ts.map +1 -0
  52. package/dist/cli/commands/status.js +43 -0
  53. package/dist/cli/commands/status.js.map +1 -0
  54. package/dist/cli/commands/streams.d.ts +3 -0
  55. package/dist/cli/commands/streams.d.ts.map +1 -0
  56. package/dist/cli/commands/streams.js +257 -0
  57. package/dist/cli/commands/streams.js.map +1 -0
  58. package/dist/cli/commands/watch.d.ts +3 -0
  59. package/dist/cli/commands/watch.d.ts.map +1 -0
  60. package/dist/cli/commands/watch.js +55 -0
  61. package/dist/cli/commands/watch.js.map +1 -0
  62. package/dist/cli/config.d.ts +61 -0
  63. package/dist/cli/config.d.ts.map +1 -0
  64. package/dist/cli/config.js +140 -0
  65. package/dist/cli/config.js.map +1 -0
  66. package/dist/cli/context.d.ts +29 -0
  67. package/dist/cli/context.d.ts.map +1 -0
  68. package/dist/cli/context.js +2 -0
  69. package/dist/cli/context.js.map +1 -0
  70. package/dist/cli/deps.d.ts +145 -0
  71. package/dist/cli/deps.d.ts.map +1 -0
  72. package/dist/cli/deps.js +227 -0
  73. package/dist/cli/deps.js.map +1 -0
  74. package/dist/cli/descriptor.d.ts +61 -0
  75. package/dist/cli/descriptor.d.ts.map +1 -0
  76. package/dist/cli/descriptor.js +78 -0
  77. package/dist/cli/descriptor.js.map +1 -0
  78. package/dist/cli/errors.d.ts +48 -0
  79. package/dist/cli/errors.d.ts.map +1 -0
  80. package/dist/cli/errors.js +129 -0
  81. package/dist/cli/errors.js.map +1 -0
  82. package/dist/cli/escape-hatch.d.ts +50 -0
  83. package/dist/cli/escape-hatch.d.ts.map +1 -0
  84. package/dist/cli/escape-hatch.js +45 -0
  85. package/dist/cli/escape-hatch.js.map +1 -0
  86. package/dist/cli/index.d.ts +8 -0
  87. package/dist/cli/index.d.ts.map +1 -0
  88. package/dist/cli/index.js +7 -0
  89. package/dist/cli/index.js.map +1 -0
  90. package/dist/cli/listings.d.ts +15 -0
  91. package/dist/cli/listings.d.ts.map +1 -0
  92. package/dist/cli/listings.js +56 -0
  93. package/dist/cli/listings.js.map +1 -0
  94. package/dist/cli/mandate.d.ts +66 -0
  95. package/dist/cli/mandate.d.ts.map +1 -0
  96. package/dist/cli/mandate.js +61 -0
  97. package/dist/cli/mandate.js.map +1 -0
  98. package/dist/cli/output.d.ts +33 -0
  99. package/dist/cli/output.d.ts.map +1 -0
  100. package/dist/cli/output.js +34 -0
  101. package/dist/cli/output.js.map +1 -0
  102. package/dist/cli/preflight.d.ts +38 -0
  103. package/dist/cli/preflight.d.ts.map +1 -0
  104. package/dist/cli/preflight.js +72 -0
  105. package/dist/cli/preflight.js.map +1 -0
  106. package/dist/cli/progress.d.ts +36 -0
  107. package/dist/cli/progress.d.ts.map +1 -0
  108. package/dist/cli/progress.js +40 -0
  109. package/dist/cli/progress.js.map +1 -0
  110. package/dist/cli/run.d.ts +25 -0
  111. package/dist/cli/run.d.ts.map +1 -0
  112. package/dist/cli/run.js +173 -0
  113. package/dist/cli/run.js.map +1 -0
  114. package/dist/cli/scan-range.d.ts +55 -0
  115. package/dist/cli/scan-range.d.ts.map +1 -0
  116. package/dist/cli/scan-range.js +57 -0
  117. package/dist/cli/scan-range.js.map +1 -0
  118. package/dist/cli/status.d.ts +90 -0
  119. package/dist/cli/status.d.ts.map +1 -0
  120. package/dist/cli/status.js +252 -0
  121. package/dist/cli/status.js.map +1 -0
  122. package/dist/cli/timeout.d.ts +30 -0
  123. package/dist/cli/timeout.d.ts.map +1 -0
  124. package/dist/cli/timeout.js +55 -0
  125. package/dist/cli/timeout.js.map +1 -0
  126. package/dist/cli/version.d.ts +12 -0
  127. package/dist/cli/version.d.ts.map +1 -0
  128. package/dist/cli/version.js +22 -0
  129. package/dist/cli/version.js.map +1 -0
  130. package/dist/cli/wallet.d.ts +95 -0
  131. package/dist/cli/wallet.d.ts.map +1 -0
  132. package/dist/cli/wallet.js +169 -0
  133. package/dist/cli/wallet.js.map +1 -0
  134. package/dist/frameworks/crewai.d.ts +10 -0
  135. package/dist/frameworks/crewai.d.ts.map +1 -1
  136. package/dist/frameworks/crewai.js +12 -2
  137. package/dist/frameworks/crewai.js.map +1 -1
  138. package/dist/gateway/server-entry.d.ts +1 -0
  139. package/dist/gateway/server-entry.js +1 -0
  140. package/dist/gateway/server-entry.js.map +1 -1
  141. package/dist/mcp/http-server.d.ts +1 -0
  142. package/dist/mcp/http-server.js +1 -0
  143. package/dist/mcp/http-server.js.map +1 -1
  144. package/dist/mcp/server.d.ts.map +1 -1
  145. package/dist/mcp/server.js +20 -1
  146. package/dist/mcp/server.js.map +1 -1
  147. package/dist/mcp/stdio.d.ts +1 -0
  148. package/dist/mcp/stdio.js +1 -0
  149. package/dist/mcp/stdio.js.map +1 -1
  150. package/dist/sdk/client.d.ts +25 -1
  151. package/dist/sdk/client.d.ts.map +1 -1
  152. package/dist/sdk/client.js +20 -1
  153. package/dist/sdk/client.js.map +1 -1
  154. package/docs/agent-layer.md +2 -1
  155. package/docs/cli.md +569 -0
  156. package/docs/crewai.md +6 -2
  157. package/docs/eliza.md +6 -1
  158. package/docs/mcp-hosted.md +3 -2
  159. package/docs/quickstart.md +18 -5
  160. package/package.json +17 -5
  161. package/src/cli/amounts.ts +102 -0
  162. package/src/cli/args.ts +150 -0
  163. package/src/cli/attesters.ts +86 -0
  164. package/src/cli/bin.ts +5 -0
  165. package/src/cli/commands/claim.ts +100 -0
  166. package/src/cli/commands/close.ts +53 -0
  167. package/src/cli/commands/discover.ts +228 -0
  168. package/src/cli/commands/invoke.ts +177 -0
  169. package/src/cli/commands/mcp.ts +135 -0
  170. package/src/cli/commands/open.ts +331 -0
  171. package/src/cli/commands/reclaim-unverified.ts +206 -0
  172. package/src/cli/commands/reclaim.ts +360 -0
  173. package/src/cli/commands/status.ts +56 -0
  174. package/src/cli/commands/streams.ts +344 -0
  175. package/src/cli/commands/watch.ts +70 -0
  176. package/src/cli/config.ts +208 -0
  177. package/src/cli/context.ts +30 -0
  178. package/src/cli/deps.ts +437 -0
  179. package/src/cli/descriptor.ts +133 -0
  180. package/src/cli/errors.ts +162 -0
  181. package/src/cli/escape-hatch.ts +92 -0
  182. package/src/cli/index.ts +27 -0
  183. package/src/cli/listings.ts +77 -0
  184. package/src/cli/mandate.ts +126 -0
  185. package/src/cli/output.ts +63 -0
  186. package/src/cli/preflight.ts +88 -0
  187. package/src/cli/progress.ts +75 -0
  188. package/src/cli/run.ts +209 -0
  189. package/src/cli/scan-range.ts +76 -0
  190. package/src/cli/status.ts +381 -0
  191. package/src/cli/timeout.ts +64 -0
  192. package/src/cli/version.ts +21 -0
  193. package/src/cli/wallet.ts +241 -0
  194. package/src/frameworks/crewai.ts +13 -2
  195. package/src/gateway/server-entry.ts +1 -0
  196. package/src/mcp/http-server.ts +1 -0
  197. package/src/mcp/server.ts +25 -1
  198. package/src/mcp/stdio.ts +1 -0
  199. package/src/sdk/client.ts +33 -1
@@ -0,0 +1,227 @@
1
+ import { streamEscrowV2Abi } from "@absol-labs/shared";
2
+ import { MetrikClient, } from "@absol-labs/sdk";
3
+ import { erc20Abi, getAbiItem, http } from "viem";
4
+ import { discoverServicesDetailed, } from "../discovery/registry.js";
5
+ import { invoke as sdkInvoke, } from "../sdk/invoke.js";
6
+ import { VerifiedStreamAgentClient, } from "../sdk/client.js";
7
+ import { RPC_RETRY_COUNT, RPC_TIMEOUT_MS, withReadTimeout } from "./timeout.js";
8
+ /**
9
+ * The `StreamOpened` ABI entry, resolved once. Taken from the shared V2 ABI
10
+ * rather than re-declared: a hand-written copy that drifted by one indexed
11
+ * argument would silently match nothing.
12
+ */
13
+ const STREAM_OPENED_EVENT = getAbiItem({
14
+ abi: streamEscrowV2Abi,
15
+ name: "StreamOpened",
16
+ });
17
+ /**
18
+ * The RPC transport, with an explicit per-call budget.
19
+ *
20
+ * viem's defaults leave a single `eth_call` able to hang for a long time behind
21
+ * three backing-off retries, which is how a `status` run reached two minutes
22
+ * with nothing on screen. Bounding it here bounds every read and every
23
+ * simulation the SDK performs, in one place.
24
+ */
25
+ function rpcTransport(config) {
26
+ return http(config.rpcUrl, {
27
+ timeout: RPC_TIMEOUT_MS,
28
+ retryCount: RPC_RETRY_COUNT,
29
+ });
30
+ }
31
+ /** Shared `MetrikClient` construction: one escrow, declared as V2 on both keys. */
32
+ function createMetrikClient(config, account) {
33
+ return new MetrikClient({
34
+ chain: config.chain,
35
+ transport: rpcTransport(config),
36
+ escrow: config.escrow,
37
+ // Declared on BOTH keys: without `escrowV2` the SDK routes reads and
38
+ // settlement through the legacy V1 ABI, which reverts against
39
+ // StreamEscrowV2 (its one-argument views were replaced by proof-carrying
40
+ // ones, and `reclaim` becomes `reclaimWithProof`).
41
+ escrowV2: config.escrow,
42
+ usdc: config.usdc,
43
+ oracleBaseUrl: config.oracleBaseUrl,
44
+ settlementTarget: { chainId: config.chainId, escrow: config.escrow },
45
+ ...(account === undefined ? {} : { account }),
46
+ });
47
+ }
48
+ export const defaultCliDependencies = {
49
+ createReadClient(config) {
50
+ const metrik = createMetrikClient(config);
51
+ return {
52
+ async getChainId() {
53
+ return await metrik.publicClient.getChainId();
54
+ },
55
+ async getStreamV2(streamId) {
56
+ return await metrik.getStreamV2(streamId);
57
+ },
58
+ async checkpointProof(streamId) {
59
+ // Not an RPC call: this is an HTTP fetch against the oracle, so the
60
+ // transport budget above does not cover it.
61
+ return await withReadTimeout(async () => await metrik.checkpointProof(streamId), `the oracle at ${config.oracleBaseUrl}`);
62
+ },
63
+ async claimableForV2(streamId, cumulativeAmount) {
64
+ return await metrik.claimableForV2(streamId, cumulativeAmount);
65
+ },
66
+ async reclaimableForV2(streamId, cumulativeAmount) {
67
+ return await metrik.reclaimableForV2(streamId, cumulativeAmount);
68
+ },
69
+ async nativeBalance(address) {
70
+ return await metrik.publicClient.getBalance({ address });
71
+ },
72
+ async usdcBalance(address) {
73
+ return await metrik.publicClient.readContract({
74
+ address: config.usdc,
75
+ abi: erc20Abi,
76
+ functionName: "balanceOf",
77
+ args: [address],
78
+ });
79
+ },
80
+ async blockNumber() {
81
+ return await metrik.publicClient.getBlockNumber();
82
+ },
83
+ async streamOpenedLogs({ role, address, fromBlock, toBlock }) {
84
+ const logs = await metrik.publicClient.getLogs({
85
+ address: config.escrow,
86
+ event: STREAM_OPENED_EVENT,
87
+ args: { [role]: address },
88
+ fromBlock,
89
+ toBlock,
90
+ });
91
+ // Returned as-is: the topic filter is evaluated by the node, so
92
+ // re-checking `log.args.buyer === address` here would imply the filter
93
+ // is decorative and would hide a mis-built filter behind a second pass.
94
+ // A wrong filter should produce a visibly wrong result, not a quietly
95
+ // correct one.
96
+ return logs.flatMap((log) => log.args.streamId === undefined ||
97
+ log.args.buyer === undefined ||
98
+ log.args.operator === undefined ||
99
+ log.args.serviceRef === undefined ||
100
+ log.args.deposit === undefined ||
101
+ log.args.ratePerSecond === undefined ||
102
+ log.args.expiresAt === undefined
103
+ ? []
104
+ : [
105
+ {
106
+ streamId: log.args.streamId,
107
+ buyer: log.args.buyer,
108
+ operator: log.args.operator,
109
+ serviceRef: log.args.serviceRef,
110
+ deposit: log.args.deposit,
111
+ ratePerSecond: log.args.ratePerSecond,
112
+ expiresAt: Number(log.args.expiresAt),
113
+ blockNumber: log.blockNumber ?? 0n,
114
+ },
115
+ ]);
116
+ },
117
+ async escrowLogCountAt(block) {
118
+ const logs = await metrik.publicClient.getLogs({
119
+ address: config.escrow,
120
+ fromBlock: block,
121
+ toBlock: block,
122
+ });
123
+ return logs.length;
124
+ },
125
+ async protocolFeeBps() {
126
+ const bps = await metrik.publicClient.readContract({
127
+ address: config.escrow,
128
+ abi: streamEscrowV2Abi,
129
+ functionName: "protocolFeeBps",
130
+ });
131
+ return Number(bps);
132
+ },
133
+ async escapeGraceSeconds() {
134
+ const seconds = await metrik.publicClient.readContract({
135
+ address: config.escrow,
136
+ abi: streamEscrowV2Abi,
137
+ functionName: "escapeGraceSeconds",
138
+ });
139
+ return Number(seconds);
140
+ },
141
+ async latestCheckpointCheckedAt() {
142
+ const checkedAt = await metrik.publicClient.readContract({
143
+ address: config.escrow,
144
+ abi: streamEscrowV2Abi,
145
+ functionName: "latestCheckpointCheckedAt",
146
+ });
147
+ return Number(checkedAt);
148
+ },
149
+ async latestBlockTimestamp() {
150
+ const block = await metrik.publicClient.getBlock();
151
+ return Number(block.timestamp);
152
+ },
153
+ async oracleSigners() {
154
+ return await metrik.publicClient.readContract({
155
+ address: config.escrow,
156
+ abi: streamEscrowV2Abi,
157
+ functionName: "getOracleSigners",
158
+ });
159
+ },
160
+ };
161
+ },
162
+ createWriteClient(config, account) {
163
+ const clientConfig = {
164
+ chain: config.chain,
165
+ transport: rpcTransport(config),
166
+ escrow: config.escrow,
167
+ escrowV2: config.escrow,
168
+ usdc: config.usdc,
169
+ oracleBaseUrl: config.oracleBaseUrl,
170
+ settlementTarget: { chainId: config.chainId, escrow: config.escrow },
171
+ ...(account === null ? {} : { account }),
172
+ };
173
+ // The mandate-gated agent client owns every fund-moving call; the raw SDK
174
+ // client is used only for the build-only `--dry-run` preview, which
175
+ // broadcasts nothing.
176
+ const agentClient = new VerifiedStreamAgentClient(clientConfig);
177
+ const metrik = createMetrikClient(config, ...(account === null ? [] : [account]));
178
+ return {
179
+ async buildHireTx(input) {
180
+ return await metrik.buildHireTx(input);
181
+ },
182
+ async openVerifiedStream(input) {
183
+ return await agentClient.openVerifiedStream(input);
184
+ },
185
+ async closeStream(input) {
186
+ return await agentClient.closeStream(input);
187
+ },
188
+ async reclaimStream(input) {
189
+ return await agentClient.reclaimStream(input);
190
+ },
191
+ async reclaimUnverifiedStream(input) {
192
+ return await agentClient.reclaimUnverifiedStream(input);
193
+ },
194
+ async claimStream(input) {
195
+ return await agentClient.claimStream(input);
196
+ },
197
+ };
198
+ },
199
+ async discover(options) {
200
+ return await discoverServicesDetailed(options);
201
+ },
202
+ async invoke(streamId, request, options) {
203
+ return await sdkInvoke(streamId, request, options);
204
+ },
205
+ createInvokeStreamReader(config) {
206
+ const metrik = createMetrikClient(config);
207
+ return {
208
+ async getStreamV2(streamId) {
209
+ const stream = await metrik.getStreamV2(streamId);
210
+ return {
211
+ buyer: stream.buyer,
212
+ operator: stream.operator,
213
+ serviceRef: stream.serviceRef,
214
+ status: stream.status,
215
+ expiresAt: stream.expiresAt,
216
+ };
217
+ },
218
+ };
219
+ },
220
+ nowSeconds() {
221
+ return Math.floor(Date.now() / 1000);
222
+ },
223
+ async sleep(ms) {
224
+ await new Promise((resolve) => setTimeout(resolve, ms));
225
+ },
226
+ };
227
+ //# sourceMappingURL=deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deps.js","sourceRoot":"","sources":["../../src/cli/deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,YAAY,GAOb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAqB,MAAM,MAAM,CAAC;AAErE,OAAO,EACL,wBAAwB,GAIzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,MAAM,IAAI,SAAS,GAKpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,yBAAyB,GAK1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc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EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;CACF,CAAC"}
@@ -0,0 +1,61 @@
1
+ import type { SignedServiceBinding, SignedServiceDescriptor } from "@absol-labs/shared";
2
+ import type { DiscoveredService } from "../discovery/registry.js";
3
+ /**
4
+ * What a listing's SIGNED descriptor already tells a newcomer — surfaced rather
5
+ * than discarded.
6
+ *
7
+ * The registry's signed records carry the callable endpoints, one worked example
8
+ * call, and the operator's accepted rate band. `metrik discover` used to project
9
+ * them away, so the CLI could show a `serviceRef` but never what the service
10
+ * DOES, what path to call, or what `--rate` the operator will accept. Everything
11
+ * here is read from the record whose signature was already recovered and
12
+ * matched, so nothing unsigned is ever presented as fact.
13
+ */
14
+ export interface ListingEndpoint {
15
+ readonly name: string;
16
+ readonly path: string;
17
+ readonly method: string;
18
+ readonly description: string | null;
19
+ }
20
+ export interface ListingExample {
21
+ readonly endpoint: string;
22
+ readonly description: string | null;
23
+ readonly request: unknown;
24
+ readonly response: unknown;
25
+ }
26
+ export interface ListingRates {
27
+ /** USDC base units per second, as signed (decimal strings, never floats). */
28
+ readonly minRatePerSecond: string | null;
29
+ readonly maxRatePerSecond: string | null;
30
+ readonly currency: string | null;
31
+ readonly slaDescription: string | null;
32
+ readonly refundPolicy: string | null;
33
+ }
34
+ export interface ListingDetail {
35
+ readonly endpoints: readonly ListingEndpoint[];
36
+ readonly example: ListingExample | null;
37
+ readonly rates: ListingRates | null;
38
+ readonly authModel: string | null;
39
+ }
40
+ /**
41
+ * Project the signed record onto the presentable detail. A legacy binding (which
42
+ * carries no interface at all) yields empty detail rather than an invented one.
43
+ */
44
+ export declare function listingDetail(signed: SignedServiceBinding | SignedServiceDescriptor | undefined): ListingDetail;
45
+ /**
46
+ * How much verification a listing actually declares. Used to order `discover`
47
+ * strongest-first so `--limit 1` returns the best-attested listing rather than
48
+ * whatever the registry happened to serve first — which is how a newcomer's very
49
+ * first result ended up being a deliberately-failing test fixture.
50
+ *
51
+ * This ranks the DECLARED verification spec, which is the only thing the signed
52
+ * record can tell us. It is a presentation order, not a trust score.
53
+ */
54
+ export declare function verificationStrength(service: DiscoveredService): number;
55
+ /**
56
+ * Deterministic, strongest-verification-first order. Ties break on `serviceRef`
57
+ * so the same registry always renders in the same order and `--limit N` is
58
+ * reproducible between runs.
59
+ */
60
+ export declare function orderListings<T extends DiscoveredService>(services: readonly T[]): T[];
61
+ //# sourceMappingURL=descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AASD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,oBAAoB,GAAG,uBAAuB,GAAG,SAAS,GACjE,aAAa,CAmCf;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CASvE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,iBAAiB,EACvD,QAAQ,EAAE,SAAS,CAAC,EAAE,GACrB,CAAC,EAAE,CAOL"}
@@ -0,0 +1,78 @@
1
+ const EMPTY_DETAIL = {
2
+ endpoints: [],
3
+ example: null,
4
+ rates: null,
5
+ authModel: null,
6
+ };
7
+ /**
8
+ * Project the signed record onto the presentable detail. A legacy binding (which
9
+ * carries no interface at all) yields empty detail rather than an invented one.
10
+ */
11
+ export function listingDetail(signed) {
12
+ const descriptor = signed
13
+ ?.descriptor;
14
+ if (descriptor === undefined)
15
+ return EMPTY_DETAIL;
16
+ const iface = descriptor.interface;
17
+ const commercial = descriptor.commercial;
18
+ return {
19
+ endpoints: (iface?.endpoints ?? []).map((endpoint) => ({
20
+ name: endpoint.name,
21
+ path: endpoint.path,
22
+ method: endpoint.method,
23
+ description: endpoint.description ?? null,
24
+ })),
25
+ example: iface?.example === undefined
26
+ ? null
27
+ : {
28
+ endpoint: iface.example.endpoint,
29
+ description: iface.example.description ?? null,
30
+ request: iface.example.request ?? null,
31
+ response: iface.example.response ?? null,
32
+ },
33
+ rates: commercial === undefined
34
+ ? null
35
+ : {
36
+ minRatePerSecond: commercial.minRatePerSecond ?? null,
37
+ maxRatePerSecond: commercial.maxRatePerSecond ?? null,
38
+ currency: commercial.currency ?? null,
39
+ slaDescription: commercial.slaDescription ?? null,
40
+ refundPolicy: commercial.refundPolicy ?? null,
41
+ },
42
+ authModel: iface?.authModel ?? null,
43
+ };
44
+ }
45
+ /**
46
+ * How much verification a listing actually declares. Used to order `discover`
47
+ * strongest-first so `--limit 1` returns the best-attested listing rather than
48
+ * whatever the registry happened to serve first — which is how a newcomer's very
49
+ * first result ended up being a deliberately-failing test fixture.
50
+ *
51
+ * This ranks the DECLARED verification spec, which is the only thing the signed
52
+ * record can tell us. It is a presentation order, not a trust score.
53
+ */
54
+ export function verificationStrength(service) {
55
+ const summary = service.verification;
56
+ if (summary === null)
57
+ return 0;
58
+ return ((summary.hasReexec ? 8 : 0) +
59
+ (summary.hasSchema ? 4 : 0) +
60
+ (summary.hasSla ? 2 : 0) +
61
+ Math.min(summary.canaries, 1));
62
+ }
63
+ /**
64
+ * Deterministic, strongest-verification-first order. Ties break on `serviceRef`
65
+ * so the same registry always renders in the same order and `--limit N` is
66
+ * reproducible between runs.
67
+ */
68
+ export function orderListings(services) {
69
+ return [...services].sort((left, right) => {
70
+ if (left.tier !== right.tier)
71
+ return right.tier - left.tier;
72
+ const strength = verificationStrength(right) - verificationStrength(left);
73
+ if (strength !== 0)
74
+ return strength;
75
+ return left.serviceRef.localeCompare(right.serviceRef);
76
+ });
77
+ }
78
+ //# sourceMappingURL=descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor.js","sourceRoot":"","sources":["../../src/cli/descriptor.ts"],"names":[],"mappings":"AAgDA,MAAM,YAAY,GAAkB;IAClC,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAkE;IAElE,MAAM,UAAU,GA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;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA0B;IAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IACrC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,CACL,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAC9B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAsB;IAEtB,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACxC,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;YAAE,OAAO,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC5D,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC1E,IAAI,QAAQ,KAAK,CAAC;YAAE,OAAO,QAAQ,CAAC;QACpC,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * CLI error taxonomy. Every expected failure surfaces as a `CliError` so the
3
+ * runner can print one actionable line instead of a viem/zod stack dump, and so
4
+ * a script can branch on the exit code.
5
+ */
6
+ export type CliExitCode =
7
+ /** Bad flags, missing arguments, unparseable amounts. */
8
+ 2
9
+ /** Configuration refused: wrong chain, missing key, mainnet target. */
10
+ | 3
11
+ /** The operation itself failed (RPC, registry, escrow revert, HTTP). */
12
+ | 4;
13
+ export declare class CliError extends Error {
14
+ readonly exitCode: CliExitCode;
15
+ /** Optional next step printed under the message in human mode. */
16
+ readonly hint: string | undefined;
17
+ constructor(message: string, options?: {
18
+ readonly exitCode?: CliExitCode;
19
+ readonly hint?: string;
20
+ readonly cause?: unknown;
21
+ });
22
+ }
23
+ /** Usage error: the caller typed something the CLI cannot act on. */
24
+ export declare function usageError(message: string, hint?: string): CliError;
25
+ /** Configuration error: the environment/flags describe a target we refuse. */
26
+ export declare function configError(message: string, hint?: string): CliError;
27
+ /**
28
+ * Unwrap the most useful message from an arbitrary thrown value.
29
+ *
30
+ * Boilerplate links are dropped once something in the chain has already named
31
+ * the revert; when nothing has, ONE is kept, because "it reverted" is then the
32
+ * only fact available and losing it would leave a bare "close failed".
33
+ */
34
+ export declare function describeError(error: unknown): string;
35
+ /** Exported for the test that pins the shape of the chain, not the wording. */
36
+ export declare function stripRedundantBoilerplate(chain: readonly string[]): readonly string[];
37
+ /**
38
+ * Tidy one message line for display.
39
+ *
40
+ * viem renders an undecodable revert payload as `Execution reverted with
41
+ * reason: <the raw bytes as text>`, which arrives as mojibake glued to the end
42
+ * of an otherwise excellent error ("… Execution reverted with reason: ׃.x."). A
43
+ * revert reason that is not printable ASCII carries no information for a reader,
44
+ * so the unreadable tail is dropped and the useful prefix kept. Legitimate
45
+ * reasons — which are ASCII strings the contract author wrote — are untouched.
46
+ */
47
+ export declare function presentMessage(raw: string): string;
48
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/cli/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW;AACrB,yDAAyD;AACvD,CAAC;AACH,uEAAuE;GACrE,CAAC;AACH,wEAAwE;GACtE,CAAC,CAAC;AAEN,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;gBAGhC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACP,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;KACrB;CAOT;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAKnE;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAKpE;AAmCD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAcpD;AAED,+EAA+E;AAC/E,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,SAAS,MAAM,EAAE,CAenB;AAaD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAelD"}
@@ -0,0 +1,129 @@
1
+ export class CliError extends Error {
2
+ exitCode;
3
+ /** Optional next step printed under the message in human mode. */
4
+ hint;
5
+ constructor(message, options = {}) {
6
+ super(message, options.cause === undefined ? {} : { cause: options.cause });
7
+ this.name = "CliError";
8
+ this.exitCode = options.exitCode ?? 4;
9
+ this.hint = options.hint;
10
+ }
11
+ }
12
+ /** Usage error: the caller typed something the CLI cannot act on. */
13
+ export function usageError(message, hint) {
14
+ return new CliError(message, {
15
+ exitCode: 2,
16
+ ...(hint === undefined ? {} : { hint }),
17
+ });
18
+ }
19
+ /** Configuration error: the environment/flags describe a target we refuse. */
20
+ export function configError(message, hint) {
21
+ return new CliError(message, {
22
+ exitCode: 3,
23
+ ...(hint === undefined ? {} : { hint }),
24
+ });
25
+ }
26
+ /**
27
+ * viem's generic tail. Each of these is true and each carries zero information
28
+ * once an outer link has already named the revert:
29
+ *
30
+ * NothingToReclaim() — …this will not change on retry:
31
+ * The contract function "reclaim" reverted.:
32
+ * Execution reverted for an unknown reason.
33
+ *
34
+ * The message names the reason and then says the reason is unknown. Matched
35
+ * against a WHOLE link, so a message that merely contains one of these phrases
36
+ * alongside real detail is never dropped.
37
+ */
38
+ const VIEM_BOILERPLATE = [
39
+ /^The contract function "[^"]*" reverted\.?$/,
40
+ /^Execution reverted for an unknown reason\.?$/,
41
+ /^Execution reverted\.?$/,
42
+ /^Execution reverted\.? \(the revert payload is not a readable reason string\)$/,
43
+ /^An unknown RPC error occurred\.?$/,
44
+ ];
45
+ /** Does this link name a concrete revert — a custom error, reason or panic? */
46
+ function namesTheRevert(line) {
47
+ return (/\b[A-Z][A-Za-z0-9]*\([^)]*\)/.test(line) ||
48
+ /\breverted:/.test(line) ||
49
+ /\bpanicked with code\b/.test(line));
50
+ }
51
+ function isBoilerplate(line) {
52
+ return VIEM_BOILERPLATE.some((pattern) => pattern.test(line));
53
+ }
54
+ /**
55
+ * Unwrap the most useful message from an arbitrary thrown value.
56
+ *
57
+ * Boilerplate links are dropped once something in the chain has already named
58
+ * the revert; when nothing has, ONE is kept, because "it reverted" is then the
59
+ * only fact available and losing it would leave a bare "close failed".
60
+ */
61
+ export function describeError(error) {
62
+ if (error instanceof Error) {
63
+ const chain = [];
64
+ for (let current = error, depth = 0; depth < 4; depth++) {
65
+ if (!(current instanceof Error))
66
+ break;
67
+ const line = presentMessage(current.message.split("\n")[0] ?? "");
68
+ if (line.length > 0 && !chain.includes(line)) {
69
+ chain.push(line);
70
+ }
71
+ current = current.cause;
72
+ }
73
+ return stripRedundantBoilerplate(chain).join(": ");
74
+ }
75
+ return presentMessage(String(error));
76
+ }
77
+ /** Exported for the test that pins the shape of the chain, not the wording. */
78
+ export function stripRedundantBoilerplate(chain) {
79
+ const decoded = chain.some((line) => namesTheRevert(line) && !isBoilerplate(line));
80
+ let keptBoilerplate = false;
81
+ const kept = chain.filter((line, index) => {
82
+ if (!isBoilerplate(line))
83
+ return true;
84
+ // The first link is the thrown error's own message: never dropped, or a
85
+ // failure whose entire message is boilerplate would print as nothing.
86
+ if (index === 0)
87
+ return true;
88
+ if (decoded || keptBoilerplate)
89
+ return false;
90
+ keptBoilerplate = true;
91
+ return true;
92
+ });
93
+ return kept.length > 0 ? kept : chain;
94
+ }
95
+ /**
96
+ * Internal SDK method names that mean nothing to someone running a CLI. The
97
+ * message is otherwise good, so the name is rewritten rather than the whole line
98
+ * discarded. `getStreamV2` in particular is an SDK METHOD, not a contract
99
+ * function — printing it invites a reader to go looking for it on the escrow.
100
+ */
101
+ const INTERNAL_NAMES = [
102
+ [/\bgetStreamV2 failed for stream\b/g, "could not read stream"],
103
+ [/\bgetStream failed for stream\b/g, "could not read stream"],
104
+ ];
105
+ /**
106
+ * Tidy one message line for display.
107
+ *
108
+ * viem renders an undecodable revert payload as `Execution reverted with
109
+ * reason: <the raw bytes as text>`, which arrives as mojibake glued to the end
110
+ * of an otherwise excellent error ("… Execution reverted with reason: ׃.x."). A
111
+ * revert reason that is not printable ASCII carries no information for a reader,
112
+ * so the unreadable tail is dropped and the useful prefix kept. Legitimate
113
+ * reasons — which are ASCII strings the contract author wrote — are untouched.
114
+ */
115
+ export function presentMessage(raw) {
116
+ let message = raw.trim();
117
+ for (const [pattern, replacement] of INTERNAL_NAMES) {
118
+ message = message.replace(pattern, replacement);
119
+ }
120
+ message = message.replace(/(Execution reverted with reason:)\s*(.*)$/, (whole, prefix, reason) => {
121
+ const trimmed = reason.trim();
122
+ if (trimmed.length >= 3 && /^[\x20-\x7e]+$/.test(trimmed))
123
+ return whole;
124
+ return `${prefix.replace(/ with reason:$/, ".")} (the revert payload is not a readable reason string)`;
125
+ });
126
+ // Strip control characters wherever they survived: they corrupt a terminal.
127
+ return message.replace(/[\u0000-\u001f\u007f-\u009f]/g, "").trim();
128
+ }
129
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/cli/errors.ts"],"names":[],"mappings":"AAaA,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,QAAQ,CAAc;IAC/B,kEAAkE;IACzD,IAAI,CAAqB;IAElC,YACE,OAAe,EACf,UAII,EAAE;QAEN,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;CACF;AAED,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,IAAa;IACvD,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;QAC3B,QAAQ,EAAE,CAAC;QACX,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;KACxC,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,IAAa;IACxD,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;QAC3B,QAAQ,EAAE,CAAC;QACX,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;KACxC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,gBAAgB,GAAsB;IAC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EAAE,MAAc,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QACxE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,uDAAuD,CAAC;IACzG,CAAC,CACF,CAAC;IACF,4EAA4E;IAC5E,OAAO,OAAO,CAAC,OAAO,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACrE,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { StreamV2 } from "@absol-labs/sdk";
2
+ import type { CliReadClient } from "./deps.js";
3
+ /**
4
+ * The buyer's no-proof escape hatch, as the CLI reasons about it.
5
+ *
6
+ * Every OTHER route the CLI has to a buyer's money goes through
7
+ * `reclaimWithProof`, which needs a Merkle proof fetched from the oracle. So the
8
+ * whole proof-based path is only as available as the oracle is.
9
+ * `StreamEscrowV2.reclaimUnverified` is the path that is not: buyer-only, no
10
+ * proof, no signer quorum, no guardian. It is gated on one thing —
11
+ *
12
+ * block.timestamp >= expiresAt + escapeGraceSeconds
13
+ *
14
+ * — and `escapeGraceSeconds` is a public immutable on the escrow, so readiness
15
+ * is fully computable before a single wei of gas is spent.
16
+ *
17
+ * Note which timestamp the escrow uses: `expiresAt`, NEVER `closedAt`. Closing a
18
+ * stream early does not bring the escape hatch forward, and the CLI must not
19
+ * imply that it does.
20
+ */
21
+ export interface EscapeHatchWindow {
22
+ /** `escapeGraceSeconds` as read from the escrow. */
23
+ readonly graceSeconds: number;
24
+ /** The exact unix second at which `reclaimUnverified` stops reverting. */
25
+ readonly readyAt: number;
26
+ readonly ready: boolean;
27
+ /** Seconds left until `readyAt`; `0` once the window is open. */
28
+ readonly secondsRemaining: number;
29
+ }
30
+ export declare function escapeHatchWindow(stream: Pick<StreamV2, "expiresAt">, graceSeconds: number, nowSeconds: number): EscapeHatchWindow;
31
+ /** `2026-09-17T09:15:00.000Z (1789…)`, or `-` for an unset timestamp. */
32
+ export declare function formatTimestamp(seconds: number): string;
33
+ /** One line describing where the escape hatch stands, for humans. */
34
+ export declare function describeEscapeHatch(window: EscapeHatchWindow): string;
35
+ export interface ChainNow {
36
+ readonly seconds: number;
37
+ /** `local` means the chain would not answer and the caller's clock was used. */
38
+ readonly source: "chain" | "local";
39
+ }
40
+ /**
41
+ * The time the ESCROW will compare against, not the time this machine thinks it
42
+ * is. `reclaimUnverified` reverts on `block.timestamp`, so a readiness answer
43
+ * computed from a skewed laptop clock could tell a buyer to spend gas on a
44
+ * guaranteed revert — or tell them to wait when the hatch is already open.
45
+ *
46
+ * A failed read is not fatal: the caller's clock is the fallback, and the
47
+ * `source` field is reported so the difference is never hidden.
48
+ */
49
+ export declare function readChainNow(read: Pick<CliReadClient, "latestBlockTimestamp">, fallbackSeconds: number): Promise<ChainNow>;
50
+ //# sourceMappingURL=escape-hatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escape-hatch.d.ts","sourceRoot":"","sources":["../../src/cli/escape-hatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,EACnC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,iBAAiB,CASnB;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAMrE;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,sBAAsB,CAAC,EACjD,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,QAAQ,CAAC,CAUnB"}