otto-intel-mcp 0.1.2 → 0.1.4
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/README.md +76 -18
- package/dist/account-userop-policy-definition.d.ts +14 -0
- package/dist/account-userop-policy-definition.js +12 -0
- package/dist/account-userop-policy-relation.d.ts +371 -0
- package/dist/account-userop-policy-relation.js +87 -0
- package/dist/adapter/cdp-signer.d.ts +76 -9
- package/dist/adapter/cdp-signer.js +274 -33
- package/dist/adapter/evm-call-failure.d.ts +29 -0
- package/dist/adapter/evm-call-failure.js +109 -0
- package/dist/adapter/refusal.d.ts +1 -1
- package/dist/adapter/refusal.js +13 -0
- package/dist/adapter/route-simulator.d.ts +91 -0
- package/dist/adapter/route-simulator.js +143 -0
- package/dist/adapter-cdp-index.d.ts +1 -1
- package/dist/executable-equities.d.ts +55 -0
- package/dist/executable-equities.js +116 -0
- package/dist/executable-yield-markets.d.ts +261 -0
- package/dist/executable-yield-markets.js +154 -0
- package/dist/execution-account-gas-quote.d.ts +141 -0
- package/dist/execution-account-gas-quote.js +443 -0
- package/dist/execution-account-gas-review.d.ts +123 -0
- package/dist/execution-account-gas-review.js +104 -0
- package/dist/execution-account-gas-runtime.d.ts +33 -0
- package/dist/execution-account-gas-runtime.js +131 -0
- package/dist/execution-account-gas-view.d.ts +936 -0
- package/dist/execution-account-gas-view.js +56 -0
- package/dist/execution-config.d.ts +3 -0
- package/dist/execution-config.js +4 -0
- package/dist/execution-delegated-definition.d.ts +7 -6
- package/dist/execution-delegated-definition.js +13 -2
- package/dist/execution-delegation-admin-definition.d.ts +127 -5
- package/dist/execution-delegation-admin-definition.js +155 -5
- package/dist/execution-delegation-admin.d.ts +48 -2
- package/dist/execution-delegation-admin.js +422 -12
- package/dist/execution-delegation-cap-store.d.ts +386 -0
- package/dist/execution-delegation-cap-store.js +1150 -0
- package/dist/execution-delegation-exit-definition.d.ts +309 -0
- package/dist/execution-delegation-exit-definition.js +204 -0
- package/dist/execution-delegation-exit-store.d.ts +114 -0
- package/dist/execution-delegation-exit-store.js +671 -0
- package/dist/execution-delegation-exit.d.ts +4 -0
- package/dist/execution-delegation-exit.js +614 -0
- package/dist/execution-delegation-finality.d.ts +22 -0
- package/dist/execution-delegation-finality.js +90 -0
- package/dist/execution-delegation-operation-store.d.ts +129 -0
- package/dist/execution-delegation-operation-store.js +1107 -0
- package/dist/execution-delegation-operations-definition.d.ts +282 -0
- package/dist/execution-delegation-operations-definition.js +117 -0
- package/dist/execution-delegation-operations.d.ts +6 -0
- package/dist/execution-delegation-operations.js +282 -0
- package/dist/execution-delegation-policy.d.ts +154 -8
- package/dist/execution-delegation-policy.js +273 -40
- package/dist/execution-delegation.d.ts +51 -0
- package/dist/execution-delegation.js +441 -31
- package/dist/execution-errors.d.ts +1 -1
- package/dist/execution-errors.js +122 -0
- package/dist/execution-index.d.ts +7 -2
- package/dist/execution-index.js +7 -2
- package/dist/execution-journal-schema.d.ts +96 -0
- package/dist/execution-journal-schema.js +368 -0
- package/dist/execution-journal-tables.d.ts +14 -0
- package/dist/execution-journal-tables.js +227 -0
- package/dist/execution-policy-compatibility.d.ts +34 -0
- package/dist/execution-policy-compatibility.js +76 -0
- package/dist/execution-registration.d.ts +54 -2
- package/dist/execution-registration.js +151 -5
- package/dist/execution-sponsored-account-profile.d.ts +32 -0
- package/dist/execution-sponsored-account-profile.js +59 -0
- package/dist/execution-sponsored-account.d.ts +1519 -0
- package/dist/execution-sponsored-account.js +222 -0
- package/dist/execution-sponsored-definition.d.ts +1713 -0
- package/dist/execution-sponsored-definition.js +185 -0
- package/dist/execution-sponsored-gas-policy.d.ts +27 -0
- package/dist/execution-sponsored-gas-policy.js +110 -0
- package/dist/execution-sponsored-hosted.d.ts +3 -0
- package/dist/execution-sponsored-hosted.js +71 -0
- package/dist/execution-sponsored-index.d.ts +1322 -0
- package/dist/execution-sponsored-index.js +102 -0
- package/dist/execution-sponsored-mcp-definition.d.ts +1662 -0
- package/dist/execution-sponsored-mcp-definition.js +94 -0
- package/dist/execution-sponsored-receipt.d.ts +47 -0
- package/dist/execution-sponsored-receipt.js +74 -0
- package/dist/execution-sponsored-registration.d.ts +14 -0
- package/dist/execution-sponsored-registration.js +77 -0
- package/dist/execution-sponsored-runtime.d.ts +84 -0
- package/dist/execution-sponsored-runtime.js +149 -0
- package/dist/execution-sponsored-settlement.d.ts +15 -0
- package/dist/execution-sponsored-settlement.js +88 -0
- package/dist/execution-sponsored-store.d.ts +67 -0
- package/dist/execution-sponsored-store.js +517 -0
- package/dist/execution-sponsored-transport.d.ts +90 -0
- package/dist/execution-sponsored-transport.js +180 -0
- package/dist/execution-tool-definitions.d.ts +21 -21
- package/dist/execution-tool-definitions.js +0 -7
- package/dist/execution-tools.d.ts +53 -1
- package/dist/execution-tools.js +171 -13
- package/dist/execution-worker-guard.d.ts +28 -0
- package/dist/execution-worker-guard.js +124 -0
- package/dist/hybrid-yield-index.d.ts +10 -0
- package/dist/hybrid-yield-index.js +11 -0
- package/dist/hybrid-yield-markets.d.ts +96 -0
- package/dist/hybrid-yield-markets.js +124 -0
- package/dist/hybrid-yield.d.ts +411 -0
- package/dist/hybrid-yield.js +155 -0
- package/dist/hyperliquid-order-builder.js +4 -0
- package/dist/lifi-execution-client.d.ts +6 -0
- package/dist/lifi-execution-client.js +3 -0
- package/dist/lp-userop-account.d.ts +461 -0
- package/dist/lp-userop-account.js +417 -0
- package/dist/lp-userop-authority.d.ts +49 -0
- package/dist/lp-userop-authority.js +211 -0
- package/dist/lp-userop-definition.d.ts +233 -0
- package/dist/lp-userop-definition.js +85 -0
- package/dist/lp-userop-hosted.d.ts +3 -0
- package/dist/lp-userop-hosted.js +73 -0
- package/dist/lp-userop-index.d.ts +1569 -0
- package/dist/lp-userop-index.js +112 -0
- package/dist/lp-userop-mcp-definition.d.ts +1220 -0
- package/dist/lp-userop-mcp-definition.js +46 -0
- package/dist/lp-userop-operation.d.ts +1230 -0
- package/dist/lp-userop-operation.js +140 -0
- package/dist/lp-userop-registration.d.ts +14 -0
- package/dist/lp-userop-registration.js +70 -0
- package/dist/lp-userop-settlement.d.ts +89 -0
- package/dist/lp-userop-settlement.js +184 -0
- package/dist/lp-userop.d.ts +643 -0
- package/dist/lp-userop.js +343 -0
- package/dist/native-yield-account-definition.d.ts +1192 -0
- package/dist/native-yield-account-definition.js +232 -0
- package/dist/native-yield-account-gas.d.ts +58 -0
- package/dist/native-yield-account-gas.js +228 -0
- package/dist/native-yield-account-index.d.ts +23 -0
- package/dist/native-yield-account-index.js +28 -0
- package/dist/native-yield-account-policy.d.ts +168 -0
- package/dist/native-yield-account-policy.js +525 -0
- package/dist/native-yield-account-rpc.d.ts +8 -0
- package/dist/native-yield-account-rpc.js +128 -0
- package/dist/native-yield-account-runtime.d.ts +71 -0
- package/dist/native-yield-account-runtime.js +125 -0
- package/dist/native-yield-account-store.d.ts +40 -0
- package/dist/native-yield-account-store.js +307 -0
- package/dist/native-yield-account.d.ts +662 -0
- package/dist/native-yield-account.js +371 -0
- package/dist/native-yield-consent-store.d.ts +20 -0
- package/dist/native-yield-consent-store.js +317 -0
- package/dist/native-yield-definition.d.ts +288 -0
- package/dist/native-yield-definition.js +105 -0
- package/dist/native-yield-reader.d.ts +4 -0
- package/dist/native-yield-reader.js +137 -0
- package/dist/native-yield-settlement.d.ts +48 -0
- package/dist/native-yield-settlement.js +167 -0
- package/dist/native-yield-simulation.d.ts +18 -0
- package/dist/native-yield-simulation.js +45 -0
- package/dist/native-yield-userop-account.d.ts +675 -0
- package/dist/native-yield-userop-account.js +357 -0
- package/dist/native-yield-userop-authority.d.ts +214 -0
- package/dist/native-yield-userop-authority.js +296 -0
- package/dist/native-yield-userop-definition.d.ts +331 -0
- package/dist/native-yield-userop-definition.js +105 -0
- package/dist/native-yield-userop-hosted.d.ts +3 -0
- package/dist/native-yield-userop-hosted.js +71 -0
- package/dist/native-yield-userop-index.d.ts +1522 -0
- package/dist/native-yield-userop-index.js +142 -0
- package/dist/native-yield-userop-mcp-definition.d.ts +1356 -0
- package/dist/native-yield-userop-mcp-definition.js +50 -0
- package/dist/native-yield-userop-operation.d.ts +845 -0
- package/dist/native-yield-userop-operation.js +127 -0
- package/dist/native-yield-userop-policy.d.ts +23 -0
- package/dist/native-yield-userop-policy.js +25 -0
- package/dist/native-yield-userop-registration.d.ts +17 -0
- package/dist/native-yield-userop-registration.js +76 -0
- package/dist/native-yield-userop-settlement.d.ts +8 -0
- package/dist/native-yield-userop-settlement.js +79 -0
- package/dist/native-yield-userop-simulation.d.ts +18 -0
- package/dist/native-yield-userop-simulation.js +34 -0
- package/dist/native-yield-userop.d.ts +35 -0
- package/dist/native-yield-userop.js +156 -0
- package/dist/native-yield-verify.d.ts +30 -0
- package/dist/native-yield-verify.js +141 -0
- package/dist/native-yield.d.ts +17 -0
- package/dist/native-yield.js +119 -0
- package/dist/stdio-main.js +0 -0
- package/dist/stock-buy-definition.d.ts +338 -0
- package/dist/stock-buy-definition.js +127 -0
- package/dist/stock-buy-oracle.d.ts +8 -0
- package/dist/stock-buy-oracle.js +22 -0
- package/dist/stock-buy.d.ts +17 -0
- package/dist/stock-buy.js +164 -0
- package/dist/tool-definitions.d.ts +3 -1
- package/dist/tool-definitions.js +55 -2
- package/dist/vendor/lp-v3/lp-v3-atomic-contract.d.ts +445 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-contract.js +90 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-evidence.d.ts +14 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-evidence.js +82 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-index.d.ts +80 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-index.js +19 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-plan.d.ts +43 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-plan.js +112 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-contract.d.ts +312 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-contract.js +41 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-index.d.ts +3 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-index.js +3 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-rpc.d.ts +49 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-rpc.js +88 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read.d.ts +17 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read.js +232 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-settlement.d.ts +105 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-settlement.js +162 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-contract.d.ts +606 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-contract.js +59 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-index.d.ts +168 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-index.js +23 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-observation.d.ts +32 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-observation.js +228 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-plan.d.ts +11 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-plan.js +91 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.d.ts +9 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.js +124 -0
- package/dist/vendor/lp-v3/lp-v3-contract.d.ts +538 -0
- package/dist/vendor/lp-v3/lp-v3-contract.js +137 -0
- package/dist/vendor/lp-v3/lp-v3-evidence.d.ts +25 -0
- package/dist/vendor/lp-v3/lp-v3-evidence.js +168 -0
- package/dist/vendor/lp-v3/lp-v3-plan.d.ts +22 -0
- package/dist/vendor/lp-v3/lp-v3-plan.js +135 -0
- package/dist/vendor/lp-v3/types.d.ts +131 -0
- package/dist/vendor/lp-v3/types.js +6 -0
- package/dist/vendor/lp-v3/v4-math.d.ts +18 -0
- package/dist/vendor/lp-v3/v4-math.js +90 -0
- package/dist/yield-deposit-definition.d.ts +374 -0
- package/dist/yield-deposit-definition.js +123 -0
- package/dist/yield-deposit.d.ts +16 -0
- package/dist/yield-deposit.js +149 -0
- package/dist/yield-route-semantics.d.ts +27 -0
- package/dist/yield-route-semantics.js +71 -0
- package/dist/yield-withdraw-definition.d.ts +357 -0
- package/dist/yield-withdraw-definition.js +90 -0
- package/dist/yield-withdraw.d.ts +11 -0
- package/dist/yield-withdraw.js +122 -0
- package/package.json +239 -7
package/dist/execution-errors.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const EXECUTION_REFUSAL_CODES = [
|
|
2
|
+
/** New Hyperliquid exposure is retired; explicit reduce-only recovery is retained. */
|
|
3
|
+
'HYPERLIQUID_RETIRED',
|
|
2
4
|
'ATTRIBUTION_MISSING',
|
|
3
5
|
/**
|
|
4
6
|
* The total take on the route exceeds the configured aggregate cap, while Otto's own
|
|
@@ -109,12 +111,132 @@ export const EXECUTION_REFUSAL_CODES = [
|
|
|
109
111
|
'DELEGATION_USER_UNKNOWN',
|
|
110
112
|
/** A verified plan the fence would refuse anyway: input token not allow-listed, spender not the reviewed diamond, gross over the per-swap cap. */
|
|
111
113
|
'DELEGATION_OUTSIDE_FENCE',
|
|
114
|
+
/**
|
|
115
|
+
* The plan is inside the ENGINE's fence but over the per-swap cap THIS USER chose when they minted.
|
|
116
|
+
* Deliberately distinct from `DELEGATION_OUTSIDE_FENCE`: that code means "Coinbase would refuse this
|
|
117
|
+
* too"; this one means "the engine would have signed it and Otto did not, because the person set a
|
|
118
|
+
* lower number." Conflating them would make the user's own choice indistinguishable from the shared
|
|
119
|
+
* ceiling, and no test could tell whether the chosen cap was ever consulted.
|
|
120
|
+
*/
|
|
121
|
+
'DELEGATION_ABOVE_USER_CAP',
|
|
122
|
+
/**
|
|
123
|
+
* The grant that reads back from CDP carries NO recorded per-swap cap on this server, so what the person
|
|
124
|
+
* agreed to is unknown. Fail-closed: nothing is submitted, and the remedy is a fresh mint (which records
|
|
125
|
+
* one). Never defaulted to the ceiling — a grant minted for $10 must not become a $5,000 grant because
|
|
126
|
+
* its record could not be found.
|
|
127
|
+
*/
|
|
128
|
+
'DELEGATION_CAP_UNRECORDED',
|
|
129
|
+
/**
|
|
130
|
+
* CONFIRM FAILED: the instant CDP reports for the live grant is not the instant this mint RESERVED.
|
|
131
|
+
*
|
|
132
|
+
* Round 3 makes `(userId, expiry)` a grant identity by construction — the server picks a whole second no
|
|
133
|
+
* durable row for that user occupies, writes the cap against it, and the page mints with exactly that
|
|
134
|
+
* second. This code is what happens when that construction does not hold: either another actor's grant
|
|
135
|
+
* is what reads back (replaced between the reservation and the mint), or CDP stored something other than
|
|
136
|
+
* what was asked for. Both mean the live permission is not the one this cap was chosen for, so nothing is
|
|
137
|
+
* blessed. CDP exposes only a user-wide revoke, so the mismatch stays unconfirmed and requires an explicit
|
|
138
|
+
* fresh Stop that revokes whichever permission is current.
|
|
139
|
+
*/
|
|
140
|
+
'DELEGATION_CAP_GRANT_CHANGED',
|
|
141
|
+
/**
|
|
142
|
+
* The offset ladder found no free whole-second instant at or before the requested expiry within its
|
|
143
|
+
* bound. Nothing is reserved and nothing is minted: handing out an instant a reservation already holds
|
|
144
|
+
* would put two permissions on one enforcement key, which is the collision this design removes.
|
|
145
|
+
*/
|
|
146
|
+
'DELEGATION_CAP_EXPIRY_UNAVAILABLE',
|
|
147
|
+
/**
|
|
148
|
+
* 🔴 THE SEND GATE (round 4). No CONFIRMED-ACTIVE record stands for this end user, so no permission
|
|
149
|
+
* has completed `reserved → confirmed_active` on this server. A reservation on its own authorises
|
|
150
|
+
* NOTHING: that is what stops a grant minted at a reserved instant by any client — the agent CLI, an
|
|
151
|
+
* SDK caller, a second tab — from inheriting a cap it never confirmed. Never defaulted to the ceiling.
|
|
152
|
+
*/
|
|
153
|
+
'DELEGATION_CAP_UNCONFIRMED',
|
|
154
|
+
/**
|
|
155
|
+
* A confirmed-active record stands, but the grant CDP reports right now is not the one it names. The
|
|
156
|
+
* live permission is a different one — replaced, or minted elsewhere — so nothing is submitted under
|
|
157
|
+
* it. Distinct from `DELEGATION_CAP_UNCONFIRMED`: that means nothing was ever confirmed; this means
|
|
158
|
+
* something was, and it is not what is live.
|
|
159
|
+
*/
|
|
160
|
+
'DELEGATION_CAP_MISMATCH',
|
|
161
|
+
/**
|
|
162
|
+
* The record requires a NEWER cap ruleset than this worker implements. A rolling deploy runs two
|
|
163
|
+
* binaries at once, and the Coinbase fence is identical on both — so an older worker that cannot
|
|
164
|
+
* honour a per-user cap would execute a new permission at the shared ceiling. It refuses instead.
|
|
165
|
+
*/
|
|
166
|
+
'DELEGATION_CAP_RULESET_STALE',
|
|
167
|
+
/**
|
|
168
|
+
* The reservation was confirmed once and a later confirmation replaced it. It is never revived: a
|
|
169
|
+
* superseded permission returning to active is a replaced cap coming back, and on a wider number that
|
|
170
|
+
* is the widening this unit exists to prevent.
|
|
171
|
+
*/
|
|
172
|
+
'DELEGATION_CAP_SUPERSEDED',
|
|
173
|
+
/**
|
|
174
|
+
* The per-swap cap store itself is unavailable — no durable path is configured, or it could not be read.
|
|
175
|
+
* Every delegated send refuses while that is true, because an unreadable store is indistinguishable from
|
|
176
|
+
* an empty one and the difference decides whether a user's cap is honoured.
|
|
177
|
+
*/
|
|
178
|
+
'DELEGATION_CAP_STORE_UNAVAILABLE',
|
|
179
|
+
/** The durable send journal is absent or unreadable. No delegated transaction is handed to CDP. */
|
|
180
|
+
'DELEGATION_OPERATION_STORE_UNAVAILABLE',
|
|
181
|
+
/** The new journal has started coverage but old non-journaling workers have not been attested drained. */
|
|
182
|
+
'DELEGATION_OPERATION_JOURNAL_NOT_READY',
|
|
183
|
+
/** A prior operation has an unresolved CDP/chain outcome; no conflicting operation may start. */
|
|
184
|
+
'DELEGATION_OPERATION_UNRESOLVED',
|
|
185
|
+
/** The server-held Base-USDC exit journal or its process-liveness guard is unavailable. */
|
|
186
|
+
'DELEGATION_EXIT_UNAVAILABLE',
|
|
187
|
+
/** A token-bound exit operation does not exist; status-without-id uses the explicit has_exit:false result. */
|
|
188
|
+
'DELEGATION_EXIT_NOT_FOUND',
|
|
189
|
+
/** Exact intent, signed bytes, current epoch, owner token, or canonical chain evidence did not match. */
|
|
190
|
+
'DELEGATION_EXIT_MISMATCH',
|
|
191
|
+
/** The exit signing owner changed/expired, or an old client answered after cancellation/resume. */
|
|
192
|
+
'DELEGATION_EXIT_STALE_OWNER',
|
|
193
|
+
/** A live CDP grant exists, so the exit cannot safely accept or broadcast a transaction. */
|
|
194
|
+
'DELEGATION_EXIT_GRANT_ACTIVE',
|
|
195
|
+
/** The exact hash is durable but neither a terminal receipt nor finalized replacement proof is available. */
|
|
196
|
+
'DELEGATION_EXIT_UNRESOLVED',
|
|
197
|
+
/**
|
|
198
|
+
* This worker is not creating NEW permissions right now (`DELEGATION_MINT_ENABLED` is not set true) —
|
|
199
|
+
* the staged first deployment. It gates the RESERVE only: a permission that already stands keeps
|
|
200
|
+
* working under its own cap, an in-flight mint can still be confirmed, and revoke always works.
|
|
201
|
+
*/
|
|
202
|
+
'DELEGATION_MINT_PAUSED',
|
|
203
|
+
/**
|
|
204
|
+
* The person pressed Stop while this permission was being created, so the reservation it was minted
|
|
205
|
+
* against was cancelled and nothing is confirmed for it. A stale confirm never issues CDP's user-wide
|
|
206
|
+
* revoke because that could take away a replacement; the person must use a fresh Stop for the current
|
|
207
|
+
* remote permission.
|
|
208
|
+
*/
|
|
209
|
+
'DELEGATION_CAP_CANCELLED',
|
|
112
210
|
/** The user-side verifier refused the envelope with an adapter code the constructor does not share; the message carries `[CODE]`. */
|
|
113
211
|
'DELEGATED_PLAN_REFUSED',
|
|
114
212
|
/** The plan halted mid-way; the message reports the failed step and whether the allowance clear read back zero. */
|
|
115
213
|
'DELEGATED_PLAN_HALTED',
|
|
116
214
|
/** A CDP or chain read/write failed outright; no upstream body is relayed. */
|
|
117
215
|
'DELEGATION_UPSTREAM_FAILED',
|
|
216
|
+
/** `otto_prepare_yield_deposit`: the executableMarketId names no executable Morpho market in this server's registry. */
|
|
217
|
+
'YIELD_MARKET_UNKNOWN',
|
|
218
|
+
/** Exact legacy position remains withdrawable but no new deposit is prepared. */
|
|
219
|
+
'YIELD_DEPOSIT_UNAVAILABLE',
|
|
220
|
+
/** The caller's registryCommitment is not the commitment recomputed over the CURRENT registry record (stale or foreign row). */
|
|
221
|
+
'YIELD_REGISTRY_MISMATCH',
|
|
222
|
+
/** The vault's own previewDeposit could not be read, so deposit parity cannot be checked; nothing is prepared. */
|
|
223
|
+
'YIELD_PREVIEW_UNAVAILABLE',
|
|
224
|
+
/** The route quotes fewer shares than the vault's own previewDeposit by more than the pinned tolerance. */
|
|
225
|
+
'YIELD_DEPOSIT_PARITY',
|
|
226
|
+
/** `otto_prepare_yield_withdraw`: the route quotes less USDC than the vault's own previewRedeem by more than the pinned tolerance. */
|
|
227
|
+
'YIELD_WITHDRAW_PARITY',
|
|
228
|
+
/** A delegated vault withdraw under a permission minted before cap ruleset v2 (no consent to withdraws); re-mint. */
|
|
229
|
+
'DELEGATION_WITHDRAW_UNCONSENTED',
|
|
230
|
+
/** `otto_prepare_stock_buy`: the executableEquityId names no executable equity in this server's registry (or the row fails its own pins). */
|
|
231
|
+
'EQUITY_UNKNOWN',
|
|
232
|
+
/** The caller's registryCommitment is not the commitment recomputed over the CURRENT equity record (stale or foreign row). */
|
|
233
|
+
'EQUITY_REGISTRY_MISMATCH',
|
|
234
|
+
/** The equity's Chainlink feed could not be read (or reads non-positive), so price parity cannot be checked; nothing is prepared. */
|
|
235
|
+
'EQUITY_ORACLE_UNAVAILABLE',
|
|
236
|
+
/** The equity's Chainlink mark is older than the pinned frozen threshold (feeds hold their last value off-hours); a delegated buy waits for a live reference. */
|
|
237
|
+
'EQUITY_ORACLE_FROZEN',
|
|
238
|
+
/** The route's gross implied price exceeds the equity's own Chainlink mark by more than the pinned tolerance. */
|
|
239
|
+
'STOCK_BUY_PARITY',
|
|
118
240
|
];
|
|
119
241
|
/** A fail-closed, machine-readable refusal. No upstream response bodies or secrets are retained. */
|
|
120
242
|
export class ExecutionRefusal extends Error {
|
|
@@ -11,7 +11,12 @@ export { swapIntentDigestInput } from './execution-intent.js';
|
|
|
11
11
|
export { artifactCommitmentDigest, assertArtifactAccountBinding, assertArtifactCommitment, assertArtifactEnvelope, assertArtifactFresh, assertArtifactPayloadDigest, executionDigest, MAX_ARTIFACT_TTL_MS, } from './execution-types.js';
|
|
12
12
|
export type { AccountProfile, ExecutionArtifact, ExecutionEnvelope, ExecutionPayload, } from './execution-types.js';
|
|
13
13
|
export { ExecutionRefusal, EXECUTION_REFUSAL_CODES } from './execution-errors.js';
|
|
14
|
-
export { MODEL_B_DELEGATION_EXPIRY_DEFAULT_DAYS, MODEL_B_DELEGATION_EXPIRY_MAX_DAYS, MODEL_B_INPUT_TOKENS_V1, MODEL_B_PER_SWAP_CAP_USD, boundedDelegationExpiry, MODEL_B_POLICY_DIGEST_V1, MODEL_B_POLICY_NAME_V1, modelBProjectPolicyBody, modelBProjectPolicyRules, policyRulesDigest, readBackModelBFence, type DelegationPolicyRecord, type ModelBFenceReadBack, } from './execution-delegation-policy.js';
|
|
14
|
+
export { MODEL_B_DELEGATION_EXPIRY_DEFAULT_DAYS, MODEL_B_DELEGATION_EXPIRY_MAX_DAYS, MODEL_B_DELEGATION_EXPIRY_MIN_DAYS, MODEL_B_INPUT_TOKENS_V1, MODEL_B_MINT_EXPIRY_FILLER_MS, mintExpiryFor, MODEL_B_PER_SWAP_CAP_MIN_USD, MODEL_B_PER_SWAP_CAP_USD, boundedDelegationExpiry, boundedPerSwapCap, assertWithinUserPerSwapCap, MODEL_B_POLICY_DIGEST_V1, MODEL_B_POLICY_NAME_V1, MODEL_B_POLICY_NAME_V2, MODEL_B_POLICY_NAME, MODEL_B_POLICY_DIGEST_V2, MODEL_B_POLICY_DIGEST, MODEL_B_POLICY_DIGEST_BY_NAME, MODEL_B_POLICY_ACCEPTED_VERSIONS, MODEL_B_WITHDRAW_TOKENS_V2, MODEL_B_WITHDRAW_SHARE_CAP_ATOMIC, assertWithdrawWithinModelBFence, fenceIsCurrent, modelBProjectPolicyBody, modelBProjectPolicyRules, policyRulesDigest, readBackModelBFence, type DelegationPolicyRecord, type ModelBFenceReadBack, } from './execution-delegation-policy.js';
|
|
15
15
|
export { DELEGATED_EXECUTION_TOOL_NAME, DELEGATION_AUTH_HEADER, SUBMIT_UNDER_DELEGATION_INPUT_SCHEMA, DELEGATED_SEND_RESULT_SCHEMA, type DelegatedSendResult, type SubmitUnderDelegationInput, } from './execution-delegated-definition.js';
|
|
16
16
|
export { DEFAULT_LIFI_AGGREGATE_FEE_CAP_RATE, DEFAULT_LIFI_FEE_BPS, DEFAULT_LIFI_FEE_CONFIG_VERSION, DEFAULT_LIFI_PLATFORM_FEE_RECIPIENT, DEFAULT_OTTO_LIFI_FEE_RECIPIENT, LIFI_DIAMOND_ADDRESS, LIFI_FEE_FORWARDERS_BY_CHAIN, LIFI_FEE_FORWARDER_V1, LIFI_FEE_FORWARDER_V1_MAINNET, LIFI_FEE_FORWARDER_V2, LIFI_INTEGRATOR, isReviewedLiFiFeeForwarder, reviewedLiFiFeeForwarders, unreviewedFeeForwarderMessage, } from './execution-config.js';
|
|
17
|
-
export { DELEGATION_ADMIN_TOOL_NAMES, DELEGATION_FENCE_INPUT_SCHEMA, DELEGATION_FENCE_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_INPUT_SCHEMA, DELEGATION_FENCE_STATUS_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_TOOL_NAME, DELEGATION_FENCE_TOOL_NAME, DELEGATION_REVOKE_INPUT_SCHEMA, DELEGATION_REVOKE_RESULT_SCHEMA, DELEGATION_REVOKE_TOOL_NAME, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_RESULT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, type DelegationFenceResult, type DelegationFenceStatusResult, type DelegationRevokeResult, type DelegationStatusResult, } from './execution-delegation-admin-definition.js';
|
|
17
|
+
export { DELEGATION_ADMIN_TOOL_NAMES, DELEGATION_CAP_INPUT_SCHEMA, DELEGATION_CAP_RESULT_SCHEMA, DELEGATION_CAP_TOOL_NAME, DELEGATION_FENCE_INPUT_SCHEMA, DELEGATION_FENCE_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_INPUT_SCHEMA, DELEGATION_FENCE_STATUS_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_TOOL_NAME, DELEGATION_FENCE_TOOL_NAME, DELEGATION_REVOKE_INPUT_SCHEMA, DELEGATION_REVOKE_RESULT_SCHEMA, DELEGATION_REVOKE_TOOL_NAME, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_RESULT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, type DelegationCapResult, type DelegationFenceResult, type DelegationFenceStatusResult, type DelegationRevokeResult, type DelegationStatusResult, } from './execution-delegation-admin-definition.js';
|
|
18
|
+
export { CAP_EXPIRY_MAX_OFFSET_STEPS, DELEGATION_CAP_STORE_PATH_ENV, DelegationCapExpiryUnavailableError, MINT_KEY_PATTERN, createDelegationCapStore, firstFreeExpiryMs, inMemoryDelegationCapStore, resolveDelegationCapStorePath, unavailableDelegationCapStore, wholeSecondMs, type DelegationCapRecord, type DelegationCapReservation, type DelegationCapStore, } from './execution-delegation-cap-store.js';
|
|
19
|
+
export { DELEGATION_OPERATIONS_INPUT_SCHEMA, DELEGATION_OPERATIONS_RESULT_SCHEMA, DELEGATION_OPERATIONS_TOOL_NAME, DELEGATION_RECONCILE_INPUT_SCHEMA, DELEGATION_RECONCILE_TOOL_NAME, type DelegationOperationsResult, } from './execution-delegation-operations-definition.js';
|
|
20
|
+
export { DELEGATION_EXIT_CHAIN_ID, DELEGATION_EXIT_INPUT_SCHEMA, DELEGATION_EXIT_NONE_RESULT_SCHEMA, DELEGATION_EXIT_RECORD_RESULT_SCHEMA, DELEGATION_EXIT_RESULT_SCHEMA, DELEGATION_EXIT_STATES, DELEGATION_EXIT_TOOL_NAME, DELEGATION_EXIT_USDC, type DelegationExitInput, type DelegationExitResult, } from './execution-delegation-exit-definition.js';
|
|
21
|
+
export { DELEGATION_EXIT_SIGNING_LEASE_MS, USER_EXECUTION_CLAIM_KINDS, createDelegationExitStore, delegationExitOwnerTokenDigest, openDelegationExitStore, unavailableDelegationExitStore, type DelegationExitRecord, type DelegationExitState, type DelegationExitStore, type DelegationExitTransaction, type UserExecutionClaim, type UserExecutionClaimKind, } from './execution-delegation-exit-store.js';
|
|
22
|
+
export { DELEGATION_OPERATION_DB_FILE, DELEGATION_OPERATION_HISTORY_LIMIT, DELEGATION_OPERATION_JOURNAL_SCHEMA_VERSION, DELEGATION_OPERATION_STATES, DELEGATION_OPERATION_STEP_KINDS, DELEGATION_OPERATION_STEP_STATES, createDelegationOperationStore, delegationOperationIdempotencyKey, inMemoryDelegationOperationStore, openDelegationOperationStore, unavailableDelegationOperationStore, type DelegationOperationBinding, type DelegationOperationJournalStatus, type DelegationOperationRecord, type DelegationOperationRecoveryRecord, type DelegationOperationRecoveryStep, type DelegationOperationSnapshot, type DelegationOperationState, type DelegationOperationStep, type DelegationOperationStepKind, type DelegationOperationStepState, type DelegationOperationStore, } from './execution-delegation-operation-store.js';
|
package/dist/execution-index.js
CHANGED
|
@@ -9,8 +9,13 @@ export { EXECUTION_ARTIFACT_SCHEMA, EXECUTION_ENVELOPE_SCHEMA, PREPARE_SWAP_INPU
|
|
|
9
9
|
export { swapIntentDigestInput } from './execution-intent.js';
|
|
10
10
|
export { artifactCommitmentDigest, assertArtifactAccountBinding, assertArtifactCommitment, assertArtifactEnvelope, assertArtifactFresh, assertArtifactPayloadDigest, executionDigest, MAX_ARTIFACT_TTL_MS, } from './execution-types.js';
|
|
11
11
|
export { ExecutionRefusal, EXECUTION_REFUSAL_CODES } from './execution-errors.js';
|
|
12
|
-
export { MODEL_B_DELEGATION_EXPIRY_DEFAULT_DAYS, MODEL_B_DELEGATION_EXPIRY_MAX_DAYS, MODEL_B_INPUT_TOKENS_V1, MODEL_B_PER_SWAP_CAP_USD, boundedDelegationExpiry, MODEL_B_POLICY_DIGEST_V1, MODEL_B_POLICY_NAME_V1, modelBProjectPolicyBody, modelBProjectPolicyRules, policyRulesDigest, readBackModelBFence, } from './execution-delegation-policy.js';
|
|
12
|
+
export { MODEL_B_DELEGATION_EXPIRY_DEFAULT_DAYS, MODEL_B_DELEGATION_EXPIRY_MAX_DAYS, MODEL_B_DELEGATION_EXPIRY_MIN_DAYS, MODEL_B_INPUT_TOKENS_V1, MODEL_B_MINT_EXPIRY_FILLER_MS, mintExpiryFor, MODEL_B_PER_SWAP_CAP_MIN_USD, MODEL_B_PER_SWAP_CAP_USD, boundedDelegationExpiry, boundedPerSwapCap, assertWithinUserPerSwapCap, MODEL_B_POLICY_DIGEST_V1, MODEL_B_POLICY_NAME_V1, MODEL_B_POLICY_NAME_V2, MODEL_B_POLICY_NAME, MODEL_B_POLICY_DIGEST_V2, MODEL_B_POLICY_DIGEST, MODEL_B_POLICY_DIGEST_BY_NAME, MODEL_B_POLICY_ACCEPTED_VERSIONS, MODEL_B_WITHDRAW_TOKENS_V2, MODEL_B_WITHDRAW_SHARE_CAP_ATOMIC, assertWithdrawWithinModelBFence, fenceIsCurrent, modelBProjectPolicyBody, modelBProjectPolicyRules, policyRulesDigest, readBackModelBFence, } from './execution-delegation-policy.js';
|
|
13
13
|
export { DELEGATED_EXECUTION_TOOL_NAME, DELEGATION_AUTH_HEADER, SUBMIT_UNDER_DELEGATION_INPUT_SCHEMA, DELEGATED_SEND_RESULT_SCHEMA, } from './execution-delegated-definition.js';
|
|
14
14
|
export { DEFAULT_LIFI_AGGREGATE_FEE_CAP_RATE, DEFAULT_LIFI_FEE_BPS, DEFAULT_LIFI_FEE_CONFIG_VERSION, DEFAULT_LIFI_PLATFORM_FEE_RECIPIENT, DEFAULT_OTTO_LIFI_FEE_RECIPIENT, LIFI_DIAMOND_ADDRESS, LIFI_FEE_FORWARDERS_BY_CHAIN, LIFI_FEE_FORWARDER_V1, LIFI_FEE_FORWARDER_V1_MAINNET, LIFI_FEE_FORWARDER_V2, LIFI_INTEGRATOR, isReviewedLiFiFeeForwarder, reviewedLiFiFeeForwarders, unreviewedFeeForwarderMessage, } from './execution-config.js';
|
|
15
|
-
export { DELEGATION_ADMIN_TOOL_NAMES, DELEGATION_FENCE_INPUT_SCHEMA, DELEGATION_FENCE_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_INPUT_SCHEMA, DELEGATION_FENCE_STATUS_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_TOOL_NAME, DELEGATION_FENCE_TOOL_NAME, DELEGATION_REVOKE_INPUT_SCHEMA, DELEGATION_REVOKE_RESULT_SCHEMA, DELEGATION_REVOKE_TOOL_NAME, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_RESULT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, } from './execution-delegation-admin-definition.js';
|
|
15
|
+
export { DELEGATION_ADMIN_TOOL_NAMES, DELEGATION_CAP_INPUT_SCHEMA, DELEGATION_CAP_RESULT_SCHEMA, DELEGATION_CAP_TOOL_NAME, DELEGATION_FENCE_INPUT_SCHEMA, DELEGATION_FENCE_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_INPUT_SCHEMA, DELEGATION_FENCE_STATUS_RESULT_SCHEMA, DELEGATION_FENCE_STATUS_TOOL_NAME, DELEGATION_FENCE_TOOL_NAME, DELEGATION_REVOKE_INPUT_SCHEMA, DELEGATION_REVOKE_RESULT_SCHEMA, DELEGATION_REVOKE_TOOL_NAME, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_RESULT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, } from './execution-delegation-admin-definition.js';
|
|
16
|
+
export { CAP_EXPIRY_MAX_OFFSET_STEPS, DELEGATION_CAP_STORE_PATH_ENV, DelegationCapExpiryUnavailableError, MINT_KEY_PATTERN, createDelegationCapStore, firstFreeExpiryMs, inMemoryDelegationCapStore, resolveDelegationCapStorePath, unavailableDelegationCapStore, wholeSecondMs, } from './execution-delegation-cap-store.js';
|
|
17
|
+
export { DELEGATION_OPERATIONS_INPUT_SCHEMA, DELEGATION_OPERATIONS_RESULT_SCHEMA, DELEGATION_OPERATIONS_TOOL_NAME, DELEGATION_RECONCILE_INPUT_SCHEMA, DELEGATION_RECONCILE_TOOL_NAME, } from './execution-delegation-operations-definition.js';
|
|
18
|
+
export { DELEGATION_EXIT_CHAIN_ID, DELEGATION_EXIT_INPUT_SCHEMA, DELEGATION_EXIT_NONE_RESULT_SCHEMA, DELEGATION_EXIT_RECORD_RESULT_SCHEMA, DELEGATION_EXIT_RESULT_SCHEMA, DELEGATION_EXIT_STATES, DELEGATION_EXIT_TOOL_NAME, DELEGATION_EXIT_USDC, } from './execution-delegation-exit-definition.js';
|
|
19
|
+
export { DELEGATION_EXIT_SIGNING_LEASE_MS, USER_EXECUTION_CLAIM_KINDS, createDelegationExitStore, delegationExitOwnerTokenDigest, openDelegationExitStore, unavailableDelegationExitStore, } from './execution-delegation-exit-store.js';
|
|
20
|
+
export { DELEGATION_OPERATION_DB_FILE, DELEGATION_OPERATION_HISTORY_LIMIT, DELEGATION_OPERATION_JOURNAL_SCHEMA_VERSION, DELEGATION_OPERATION_STATES, DELEGATION_OPERATION_STEP_KINDS, DELEGATION_OPERATION_STEP_STATES, createDelegationOperationStore, delegationOperationIdempotencyKey, inMemoryDelegationOperationStore, openDelegationOperationStore, unavailableDelegationOperationStore, } from './execution-delegation-operation-store.js';
|
|
16
21
|
//# sourceMappingURL=execution-index.js.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** Ordinary fresh initialization remains v4; v5 is an explicit offline semantic-reader migration. */
|
|
2
|
+
export declare const EXECUTION_JOURNAL_SCHEMA_VERSION: 4;
|
|
3
|
+
export declare const EXECUTION_JOURNAL_MAX_SCHEMA_VERSION: 6;
|
|
4
|
+
export declare const USER_EXECUTION_CLAIM_KINDS: readonly ["mint", "delegated", "exit", "native", "sponsored"];
|
|
5
|
+
export type UserExecutionClaimKind = (typeof USER_EXECUTION_CLAIM_KINDS)[number];
|
|
6
|
+
export interface UserExecutionClaim {
|
|
7
|
+
readonly userId: string;
|
|
8
|
+
readonly kind: UserExecutionClaimKind;
|
|
9
|
+
readonly claimId: string;
|
|
10
|
+
/** Only mint claims carry the Stop generation that acquired the claim. */
|
|
11
|
+
readonly claimGeneration?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ExecutionJournalDatabase {
|
|
14
|
+
readonly isTransaction?: boolean;
|
|
15
|
+
exec(sql: string): void;
|
|
16
|
+
prepare(sql: string): {
|
|
17
|
+
run(...params: unknown[]): {
|
|
18
|
+
changes: number | bigint;
|
|
19
|
+
};
|
|
20
|
+
get(...params: unknown[]): unknown;
|
|
21
|
+
all(...params: unknown[]): unknown[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ExecutionJournalStatus {
|
|
25
|
+
readonly schemaVersion: 2 | 3 | 4 | 5 | 6;
|
|
26
|
+
/** Existing Base admission status. Internal schema upgrades must not change the public v2 contract. */
|
|
27
|
+
readonly ready: boolean;
|
|
28
|
+
readonly coverageStartedAt: string;
|
|
29
|
+
readonly nativeReady: boolean;
|
|
30
|
+
readonly nativeCoverageStartedAt: string | null;
|
|
31
|
+
readonly sponsoredReady: boolean;
|
|
32
|
+
readonly sponsoredCoverageStartedAt: string | null;
|
|
33
|
+
readonly nativeUserOpReady: boolean;
|
|
34
|
+
readonly nativeUserOpCoverageStartedAt: string | null;
|
|
35
|
+
readonly lpUserOpReady: boolean;
|
|
36
|
+
readonly lpUserOpCoverageStartedAt: string | null;
|
|
37
|
+
}
|
|
38
|
+
export declare class ExecutionJournalNotReadyError extends Error {
|
|
39
|
+
constructor();
|
|
40
|
+
}
|
|
41
|
+
/** Every writer checks the actual version under its own transaction. Opening is not migration authority. */
|
|
42
|
+
export declare function assertExecutionJournalCompatible(db: ExecutionJournalDatabase, minimumVersion?: 2 | 3 | 4 | 5 | 6): void;
|
|
43
|
+
export declare function readExecutionJournalStatus(db: ExecutionJournalDatabase): ExecutionJournalStatus;
|
|
44
|
+
export declare function requireExecutionJournalReady(db: ExecutionJournalDatabase): void;
|
|
45
|
+
export declare function requireNativeExecutionJournalReady(db: ExecutionJournalDatabase): void;
|
|
46
|
+
export declare function requireSponsoredExecutionJournalReady(db: ExecutionJournalDatabase): void;
|
|
47
|
+
/** v2 native records require a new reader rollout. Existing v4 sponsorship readiness is insufficient. */
|
|
48
|
+
export declare function requireNativeUserOpJournalReady(db: ExecutionJournalDatabase): void;
|
|
49
|
+
/** Operator-only transaction after draining every v4 worker; no table, record or claim is rewritten. */
|
|
50
|
+
export declare function migrateNativeUserOpJournal(db: ExecutionJournalDatabase, nowMs: number, expected: {
|
|
51
|
+
readonly coverageStartedAt: string;
|
|
52
|
+
readonly sponsoredCoverageStartedAt: string;
|
|
53
|
+
}): ExecutionJournalStatus;
|
|
54
|
+
/** A separate explicit attestation that all deployed readers understand native version-2 records. */
|
|
55
|
+
export declare function markNativeUserOpReadyAfterDrain(db: ExecutionJournalDatabase, nowMs: number): ExecutionJournalStatus;
|
|
56
|
+
/** LP record v3 is another explicit reader rollout; prior native readiness does not grant LP admission. */
|
|
57
|
+
export declare function requireLpUserOpJournalReady(db: ExecutionJournalDatabase): void;
|
|
58
|
+
export declare function migrateLpUserOpJournal(db: ExecutionJournalDatabase, nowMs: number, expected: {
|
|
59
|
+
readonly coverageStartedAt: string;
|
|
60
|
+
readonly sponsoredCoverageStartedAt: string;
|
|
61
|
+
readonly nativeUserOpCoverageStartedAt: string;
|
|
62
|
+
}): ExecutionJournalStatus;
|
|
63
|
+
export declare function markLpUserOpReadyAfterDrain(db: ExecutionJournalDatabase, nowMs: number): ExecutionJournalStatus;
|
|
64
|
+
/** Explicit operator attestation that every worker understands sponsored claims; migration alone cannot enable sends. */
|
|
65
|
+
export declare function markSponsoredExecutionReadyAfterLegacyDrain(db: ExecutionJournalDatabase, nowMs: number): ExecutionJournalStatus;
|
|
66
|
+
/** Explicit native rollout attestation, separate from the existing public Base rollout action. */
|
|
67
|
+
export declare function markNativeExecutionReadyAfterLegacyDrain(db: ExecutionJournalDatabase, nowMs: number): ExecutionJournalStatus;
|
|
68
|
+
export declare function executionClaimFromRow(row: unknown): UserExecutionClaim | undefined;
|
|
69
|
+
export declare function readUserExecutionClaim(db: ExecutionJournalDatabase, userId: string): UserExecutionClaim | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Fresh databases are initialized atomically, unready, with all storage contracts. Existing databases
|
|
72
|
+
* are only validated unless the operator supplies the exact prior version and coverage after draining
|
|
73
|
+
* every old writer. Ordinary status, construction and hosted startup can never widen a live journal.
|
|
74
|
+
*/
|
|
75
|
+
export declare function initializeExecutionJournal(db: ExecutionJournalDatabase, nowMs: number, expectedPrior?: {
|
|
76
|
+
readonly schemaVersion: '2' | '3';
|
|
77
|
+
readonly coverageStartedAt: string;
|
|
78
|
+
}): void;
|
|
79
|
+
export interface NativeExecutionClaimBinding {
|
|
80
|
+
readonly userId: string;
|
|
81
|
+
readonly operationId: string;
|
|
82
|
+
}
|
|
83
|
+
export type NativeExecutionClaimOutcome = {
|
|
84
|
+
readonly outcome: 'started' | 'existing';
|
|
85
|
+
} | {
|
|
86
|
+
readonly outcome: 'conflict';
|
|
87
|
+
readonly claim: UserExecutionClaim;
|
|
88
|
+
};
|
|
89
|
+
/** Call inside the transaction that also creates the native operation row. No standalone reservation. */
|
|
90
|
+
export declare function claimNativeExecution(db: ExecutionJournalDatabase, binding: NativeExecutionClaimBinding, nowMs: number): NativeExecutionClaimOutcome;
|
|
91
|
+
/** The caller must prove and record the native terminal outcome in this same transaction. */
|
|
92
|
+
export declare function releaseNativeExecutionClaim(db: ExecutionJournalDatabase, binding: NativeExecutionClaimBinding): void;
|
|
93
|
+
/** Atomic companion to inserting/consuming a sponsored review in the same operations.db transaction. */
|
|
94
|
+
export declare function claimSponsoredExecution(db: ExecutionJournalDatabase, binding: NativeExecutionClaimBinding, nowMs: number): NativeExecutionClaimOutcome;
|
|
95
|
+
/** Caller commits the proven terminal record in this same transaction. No TTL or provider-timeout release. */
|
|
96
|
+
export declare function releaseSponsoredExecutionClaim(db: ExecutionJournalDatabase, binding: NativeExecutionClaimBinding): void;
|