@venlyfinance/settlement-mcp 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md ADDED
@@ -0,0 +1,35 @@
1
+ # Composition rules for coding agents
2
+
3
+ You are building a financial product UI on `@venlyfinance/react`. These rules exist because the failure modes of money UIs are specific; follow them over generic dashboard instincts.
4
+
5
+ ## Non-negotiable
6
+
7
+ 1. **Never hand-roll API calls, auth, retries, or transfer state.** Every read is a hook (`useAccounts`, `useTransfers`, `useRampRequests`, …); every regulated lifecycle is a flow machine (`useStagedTransfer`, `useFourEyesApproval`, `useRampLifecycle`). If you are writing `fetch` or a `useEffect` polling loop, stop – the hook exists.
8
+ 2. **Wrap the tree once** in `<VenlyProvider environment="mock">`. Mock mode needs zero credentials and zero network; it is the correct default for any demo, test, or first build. Going live is a constructor change, not a rewrite.
9
+ 3. **Never place `clientSecret` in browser code.** The provider throws if you try. For browser apps use `proxyClientOptions()` against your own backend route.
10
+ 4. **Money movement is stage-then-confirm.** Render a review step showing `state.staged` (the exact request) before calling `confirm()`. Never wire a form submit directly to execution.
11
+ 5. **Approval UIs render the rule, not the error.** Use `capability` from `useFourEyesApproval`: when `reason` is `"actor-is-creator"`, say that a second person must approve – do not show buttons that will be refused. On failure `"stale-version"`, refetch and let the operator re-decide; never auto-retry an approval.
12
+ 6. **Gate every finished screen with the design audit, and wire it into CI.** `npx @venlyfinance/settlement-mcp review "src/**/*.tsx"` fails (exit 1) on any error-severity finding – raw colours, invented timing or custody copy, crypto codes inside `Intl.NumberFormat` currency formatting, a required field labelled optional, parity fixtures, and more. Add it as a CI step in the app you build. A deliberate, justified exception carries `venly-allow:<rule-id>` on the offending line or the line above.
13
+
14
+ ## Rendering money states
15
+
16
+ - Use `descriptor` from `useRampLifecycle` for status pills and timelines: `intent` gives the semantic colour, but always pair colour with a glyph or label – state is never carried by colour alone.
17
+ - A waiting state must answer: must I act, who is it waiting on, what still works. `descriptor.waitingOn` and `descriptor.explanation` carry this; render them instead of a bare "Pending".
18
+ - Amounts: tabular figures, currency code after the amount, and never render a debit in red as the only signal. Empty numeric cells are an em dash, not 0.
19
+ - Terminal failure states show the reason from the record; the status field is the explanation field.
20
+
21
+ ## Bring your own auth
22
+
23
+ The Venly APIs authenticate machines (OAuth2 client credentials), not people: there is no end-user login, sign-up, session, password, or MFA endpoint in either API, by design. **The Venly APIs never see end-user credentials.** End-user auth is your identity layer's job; the sanctioned browser shape is a backend proxy that inherits YOUR app's session (`proxyClientOptions()`), never Venly's.
24
+
25
+ The UI kit's auth and team blocks therefore render against two adapter interfaces, `AuthAdapter` and `TeamAdapter`, instead of an SDK client:
26
+
27
+ - **Real implementations** wrap what you already run: OAuth/OIDC, Better Auth, Auth0, Clerk, Keycloak, or a plain session cookie. Implement `signIn`/`verifyTotp`/`signUp`/`session`/`signOut` (and the team CRUD) over your provider's SDK.
28
+ - **Session-expiry contract:** `session()` returns `null` once the session has expired for any reason. The shell treats null as signed-out and redirects to sign-in; no other expiry signal exists in the interface.
29
+ - **Mock adapters ship with the blocks** (`createMockAuthAdapter`, `createMockTeamAdapter`): zero credentials, deterministic 2FA code `000000`, an `expireSession()` driver, and invites that mint a display-only link – the mock never claims an email was sent.
30
+ - Password reset, SSO buttons, and passkeys are provider features: point users at your provider's flow rather than rebuilding it behind the adapter.
31
+
32
+ ## Demo choreography (mock mode)
33
+
34
+ `useVenlyMock()` exposes the store controls. A credible end-to-end demo:
35
+ create party → `advanceVerification(id)` → create account → virtual bank account (note its `referenceCode`) → stage + confirm a transfer → `advanceTransfer(id)` → show the ledger. Inject failures with `failNext("CONFLICT")` to show the stale-version approval path – error states are part of the product.
package/CHANGELOG.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  ## 0.3.0 – 2026-08-04
4
4
 
5
- Wording-is-the-safety-surface release. An outside integrator audit (Report 1,
6
- 2026-08-04) found the server's words disagreeing with its behavior in three
5
+ Wording-is-the-safety-surface release. An outside integrator audit (2026-08-04) found the server's words disagreeing with its behavior in three
7
6
  places; all fixed, plus the SDK under the mock now teaches the documented
8
7
  lifecycle (see @venlyfinance/sdk 0.2.0).
9
8
 
@@ -104,3 +103,34 @@ Frontend toolset: the judgment layer for interface assembly.
104
103
  ## 0.4.1 – 2026-08-07
105
104
 
106
105
  - `venly://frontend/agents` now carries the full cold-start recipe, learned from a fresh-agent build run: Tailwind + path-alias prerequisites before `shadcn init`, the non-interactive `-y -b radix -p nova` flags, that blocks land under `components/venly/` at the project root (relative imports, not the `@/` alias), that `shadcn add` auto-installs the npm dependencies, and the `.js`-extension bundler note.
106
+
107
+ ## 0.5.0 – 2026-08-14 (backfill; published 2026-08-15)
108
+
109
+ Entry added retroactively in 0.6.0 – the publish predates it.
110
+
111
+ - Nine payout tools over the re-vendored finance contract (payouts, payout routes +
112
+ ownership proof, party payout bank accounts), fail-closed writes.
113
+ - Corrected capabilities text; react/ui alignment with the 0.4.0 SDK line.
114
+
115
+ ## 0.6.0 – 2026-08-18
116
+
117
+ `review_screen` grows teeth: five new rule classes, a suppression hatch, and a CI-runnable command.
118
+
119
+ - New error rules: `invented-timing-claim` (copy promising durations, settlement windows
120
+ or custody behaviour no API in this stack returns), `intl-currency-crypto`
121
+ (`Intl.NumberFormat` + `style:"currency"` + a crypto code throws `RangeError` at render;
122
+ a variable-fed `currency:` in the same call is a warn), `required-rendered-optional`
123
+ (the payment reference labelled "(not required)"), `parity-fixture` (seeded 1:1
124
+ exchange rates).
125
+ - New warn rules: `blueprint-state-missing` (pass the new optional `journey` argument to
126
+ `review_screen` and the audit lists blueprint-named states not found in the source) and
127
+ `round-number-coincidence` (three or more `x.00` amounts seeded in one source).
128
+ - Suppression hatch on every rule, old and new: `venly-allow:<rule-id>` on the offending
129
+ line or the line above drops the finding silently.
130
+ - Copy-judging rules skip comment lines – a comment documenting a rule must not trip it.
131
+ - Findings now carry a 1-based `line`.
132
+ - New `review` CLI over the same audit: `npx @venlyfinance/settlement-mcp review "src/**/*.tsx"`
133
+ exits 1 on any error-severity finding (0 otherwise, 2 on usage errors/no matches), with
134
+ self-expanded globs and zero dependencies. Added a `settlement-mcp` bin alias so the
135
+ npx form resolves under npm's unscoped-name rule. This repo's CI now runs the command
136
+ over its own registry and example sources.
package/README.md CHANGED
@@ -15,6 +15,8 @@ the normalized write requests. Staging and production writes fail closed.
15
15
 
16
16
  The Venly Finance builder surface documented here is the v0.2.0 release line.
17
17
 
18
+ Building with a coding agent? Start from [AGENTS.md](AGENTS.md) - the MCP also serves it as the \venly://frontend/agents resource.
19
+
18
20
  ## What it is
19
21
 
20
22
  - Built on the official MCP TypeScript SDK (`@modelcontextprotocol/sdk`), Node
@@ -98,6 +100,15 @@ Operator writes: `approve_ramp_request`, `reject_ramp_request`. The legacy
98
100
  Each is dry-run by default and returns the exact request it would send. See the
99
101
  safety model below.
100
102
 
103
+ ### Payout tools (since 0.5.0)
104
+
105
+ The payout surface of the finance contract, same tiering as above. Reads:
106
+ `list_payouts`, `get_payout`, `list_payout_routes`, `list_payout_bank_accounts`.
107
+ Writes (dry-run by default, fail-closed like every write):
108
+ `register_payout_bank_account`, `create_payout_route`,
109
+ `prepare_payout_ownership_proof`, `complete_payout_ownership_proof`,
110
+ `request_payout`.
111
+
101
112
  ### 3. x402 tool (position + stub)
102
113
 
103
114
  `quote_x402_payment` returns an HTTP-402-shaped quote (price, asset, payTo,
@@ -116,13 +127,36 @@ what a registry cannot:
116
127
  - `get_journey_blueprint` – screen inventory, required states, registry items and binding
117
128
  hooks for eight money-product journeys.
118
129
  - `review_screen` – deterministic design audit of a screen's source (raw colours,
119
- hyphen-minus amounts, success styling on cancelled steps, masked review values, zebra
120
- striping, off-token shadows, colour-only state). Findings, not a score.
130
+ hyphen-minus amounts, success styling on cancelled steps, masked review values,
131
+ invented timing/custody copy, crypto codes inside `Intl.NumberFormat` currency
132
+ formatting, required fields rendered optional, parity and round-number fixtures,
133
+ zebra striping, off-token shadows, colour-only state). Pass the optional `journey`
134
+ key to also check that every state the journey blueprint names appears in the
135
+ source. Findings, not a score.
121
136
  - `venly://frontend/agents` – the composition rules an agent should read before building.
122
137
 
123
138
  The `build_international_account` prompt assembles the interface from the registry and
124
139
  gates every finished screen on `review_screen`. See [`ui/`](../ui/README.md) for the kit itself.
125
140
 
141
+ ### Design-audit CLI
142
+
143
+ The same audit runs as a command, so a generated app can gate itself in CI:
144
+
145
+ ```bash
146
+ npx @venlyfinance/settlement-mcp review "src/**/*.tsx"
147
+ ```
148
+
149
+ Exit `1` on any error-severity finding, `0` otherwise (warnings print either way),
150
+ `2` on usage errors or a pattern that matches nothing. Suppress a deliberate,
151
+ justified exception with `venly-allow:<rule-id>` on the offending line or the line
152
+ above – the finding is dropped silently. This repo runs the same command over its
153
+ own registry sources in CI.
154
+
155
+ Scope the glob to component source, never to token or theme files: the
156
+ `raw-colour` rule fires on any hex/rgba literal by design, and a tokens/theme
157
+ css file is the one legitimate home of raw colour values (theming stays a
158
+ one-file edit). `"src/**/*.tsx"` is the right default.
159
+
126
160
  ## Safety model (fail closed)
127
161
 
128
162
  Outside explicit mock mode, read-only/dry-run is the default posture. A staging
@@ -228,8 +262,9 @@ reads, and fail-closed write gate without mutating staging:
228
262
  VENLY_CLIENT_ID=... VENLY_CLIENT_SECRET=... npm run smoke:staging
229
263
  ```
230
264
 
231
- The command starts the MCP with `VENLY_ENV=staging`, lists the expected 24 tools,
232
- five resources, and builder prompt, then reads parties, accounts, and reference data.
265
+ The command starts the MCP with `VENLY_ENV=staging`, verifies the discovery
266
+ surface against the exact tool/resource/prompt inventory pinned in the smoke
267
+ script itself, then reads parties, accounts, and reference data.
233
268
  It deliberately removes `VENLY_MCP_LIVE` and `VENLY_MCP_PRODUCTION` from the child
234
269
  process before submitting one confirmed `create_party` request. Passing requires that
235
270
  request to return `mode: dry-run`, `environment: staging`, and an unarmed gate. Output
@@ -1,6 +1,6 @@
1
1
  import { FundflowClient, VenlyFinanceClient, type MockCall } from "@venlyfinance/sdk";
2
2
  import { type VenlyEnvironment } from "../constants.js";
3
- import type { Account, CryptoCurrency, CreateAccountInput, CreateCryptoTransferInput, CreateFiatTransferInput, CreatePartyInput, CreatePayInSessionRequest, CreateVirtualBankAccountInput, CurrentCreateFiatTransferInput, FiatCurrency, ListRampRequestsParams, OptimisticLockingBody, Party, PaymentSession, RampRequestDto, RampRequestListItem, SupportedChains, Transfer, VenlyClient, VirtualBankAccount, VenlyFee, Wallet } from "../types.js";
3
+ import type { Account, CryptoCurrency, CreateAccountInput, CreateCryptoTransferInput, CreateFiatTransferInput, CreatePartyInput, CreatePayInSessionRequest, CreateVirtualBankAccountInput, CurrentCreateFiatTransferInput, FiatCurrency, ListRampRequestsParams, OptimisticLockingBody, Party, PaymentSession, Payout, PayoutBankAccount, PayoutRoute, CreatePayoutInput, CreatePayoutRouteInput, RegisterPayoutBankAccountInput, PayoutOwnershipProof, CompleteOwnershipProofInput, RampRequestDto, RampRequestListItem, SupportedChains, Transfer, VenlyClient, VirtualBankAccount, VenlyFee, Wallet } from "../types.js";
4
4
  /**
5
5
  * Normalize the legacy stage_transfer input to the current Finance
6
6
  * CreateFiatTransferInput wire shape. Exported so the write tool can show the
@@ -64,4 +64,17 @@ export declare class SdkVenlyClient implements VenlyClient {
64
64
  approveRampRequest(id: string, body: OptimisticLockingBody): Promise<RampRequestDto>;
65
65
  rejectRampRequest(id: string, body: OptimisticLockingBody): Promise<RampRequestDto>;
66
66
  createPayInSession(accountId: string, body: CreatePayInSessionRequest): Promise<PaymentSession>;
67
+ listPayouts(accountId: string, params?: {
68
+ page?: number;
69
+ size?: number;
70
+ status?: string;
71
+ }): Promise<Payout[]>;
72
+ getPayout(accountId: string, payoutId: string): Promise<Payout>;
73
+ requestPayout(accountId: string, body: CreatePayoutInput): Promise<Payout>;
74
+ listPayoutRoutes(accountId: string): Promise<PayoutRoute[]>;
75
+ createPayoutRoute(accountId: string, body: CreatePayoutRouteInput): Promise<PayoutRoute>;
76
+ preparePayoutOwnershipProof(accountId: string, routeId: string): Promise<PayoutOwnershipProof>;
77
+ completePayoutOwnershipProof(accountId: string, routeId: string, body: CompleteOwnershipProofInput): Promise<PayoutRoute>;
78
+ listPayoutBankAccounts(partyId: string): Promise<PayoutBankAccount[]>;
79
+ registerPayoutBankAccount(partyId: string, body: RegisterPayoutBankAccountInput): Promise<PayoutBankAccount>;
67
80
  }
@@ -180,4 +180,43 @@ export class SdkVenlyClient {
180
180
  this.assertReady();
181
181
  return this.finance.paymentSessions.create(accountId, body);
182
182
  }
183
+ // ----- Payout surface (contract 1.3.0) -----
184
+ async listPayouts(accountId, params) {
185
+ this.assertReady();
186
+ const page = await this.finance.payouts.list(accountId, params);
187
+ return page.items;
188
+ }
189
+ async getPayout(accountId, payoutId) {
190
+ this.assertReady();
191
+ return this.finance.payouts.get(accountId, payoutId);
192
+ }
193
+ async requestPayout(accountId, body) {
194
+ this.assertReady();
195
+ return this.finance.payouts.request(accountId, body);
196
+ }
197
+ async listPayoutRoutes(accountId) {
198
+ this.assertReady();
199
+ return this.finance.payoutRoutes.list(accountId);
200
+ }
201
+ async createPayoutRoute(accountId, body) {
202
+ this.assertReady();
203
+ return this.finance.payoutRoutes.create(accountId, body);
204
+ }
205
+ async preparePayoutOwnershipProof(accountId, routeId) {
206
+ this.assertReady();
207
+ return this.finance.payoutRoutes.prepareOwnershipProof(accountId, routeId);
208
+ }
209
+ async completePayoutOwnershipProof(accountId, routeId, body) {
210
+ this.assertReady();
211
+ return this.finance.payoutRoutes.completeOwnershipProof(accountId, routeId, body);
212
+ }
213
+ async listPayoutBankAccounts(partyId) {
214
+ this.assertReady();
215
+ const page = await this.finance.payoutBankAccounts.list(partyId);
216
+ return page.items;
217
+ }
218
+ async registerPayoutBankAccount(partyId, body) {
219
+ this.assertReady();
220
+ return this.finance.payoutBankAccounts.register(partyId, body);
221
+ }
183
222
  }
@@ -1,9 +1,9 @@
1
1
  /** Shared constants. The default environment is MOCK so an unconfigured run
2
2
  * never touches real infrastructure; staging/production are explicit. */
3
3
  export declare const SERVER_NAME = "venly-finance-mcp-server";
4
- export declare const SERVER_VERSION = "0.4.1";
4
+ export declare const SERVER_VERSION = "0.6.0";
5
5
  export declare const ENVIRONMENT_FLAG = "VENLY_ENV";
6
- export type VenlyEnvironment = "mock" | "staging" | "production";
6
+ export type VenlyEnvironment = "mock" | "qa" | "staging" | "production";
7
7
  export declare function resolveVenlyEnvironment(env: Record<string, string | undefined>): VenlyEnvironment;
8
8
  /** The env flag that must equal "1" for any write tool to execute live. */
9
9
  export declare const LIVE_FLAG = "VENLY_MCP_LIVE";
package/dist/constants.js CHANGED
@@ -1,17 +1,17 @@
1
1
  /** Shared constants. The default environment is MOCK so an unconfigured run
2
2
  * never touches real infrastructure; staging/production are explicit. */
3
3
  export const SERVER_NAME = "venly-finance-mcp-server";
4
- export const SERVER_VERSION = "0.4.1";
4
+ export const SERVER_VERSION = "0.6.0";
5
5
  export const ENVIRONMENT_FLAG = "VENLY_ENV";
6
6
  export function resolveVenlyEnvironment(env) {
7
7
  // Default is MOCK (since 0.3.0): the mock-first product must not point at
8
8
  // real infrastructure when unconfigured. Set VENLY_ENV explicitly for
9
9
  // staging or production.
10
10
  const value = env[ENVIRONMENT_FLAG] ?? "mock";
11
- if (value === "mock" || value === "staging" || value === "production") {
11
+ if (value === "mock" || value === "qa" || value === "staging" || value === "production") {
12
12
  return value;
13
13
  }
14
- throw new Error(`${ENVIRONMENT_FLAG} must be one of mock, staging, production; received ${JSON.stringify(value)}`);
14
+ throw new Error(`${ENVIRONMENT_FLAG} must be one of mock, qa, staging, production; received ${JSON.stringify(value)}`);
15
15
  }
16
16
  /** The env flag that must equal "1" for any write tool to execute live. */
17
17
  export const LIVE_FLAG = "VENLY_MCP_LIVE";
@@ -9,13 +9,29 @@
9
9
  */
10
10
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
11
  export declare const REGISTRY_URL_TEMPLATE = "https://raw.githubusercontent.com/Venly/venly-settlement-sdk/main/ui/r/{name}.json";
12
+ declare const JOURNEYS: {
13
+ readonly auth: "# Auth (sign-in, 2FA, sign-up)\nShell: outside the app shell - a centred card column.\nRegistry items: venly-tokens; block: auth (SignInForm, TwoFactorForm, SignUpForm).\nBinding: an AuthAdapter YOU implement - the Venly APIs authenticate machines\n(client credentials), never people, so end-user auth is your identity layer\n(OAuth/OIDC, Better Auth, Auth0, Clerk, Keycloak). createMockAuthAdapter ships\nfor demos: deterministic 2FA code 000000, expireSession() driver.\nStates that must exist: signed out, bad credentials (ONE combined message -\nno user enumeration), 2FA challenge with wrong-code path, session expired\n(session() returns null - redirect, no other signal), duplicate sign-up email.\nRules that must hold: credential errors never confirm which half was wrong;\nthe code field is six slots with paste distribution and full keyboard support;\nthe mock never claims an email was sent.";
14
+ readonly team: "# Team\nShell: in-shell content column.\nRegistry items: venly-tokens, data-table, status-pill; block: team (TeamTable, InviteDialog).\nBinding: a TeamAdapter over your auth provider (createMockTeamAdapter for demos).\nStates that must exist: ACTIVE/INVITED/DISABLED members on first paint, invite\ncreated (display-only link in mock - never a fake sent-email claim), role\nchange persisting, self-actions blocked with the reason.\nRules that must hold: member status is word + glyph; role controls live in the\nrow; you cannot change your own role or disable yourself - the control is\ndisabled AND explains why.";
15
+ readonly "home-balances": "# Home / balances\nShell: left nav rail + thin top bar; full-width content.\nRegistry items: venly-tokens, balance-card, data-table, status-pill; block: balances (BalancesBlock, BalanceMiniature).\nHooks: useAccounts, useWallets; balances rendered per asset across the account's wallets.\nStates that must exist: loading, zero balances (first-run guidance), reserved buckets, entirely reserved (available 0 rendered honestly - the acct-escrow seed exercises it), balance load error degrading locally with a retry.\nRules that must hold: available is the emphasised figure and the only one above the rule; reserved is demoted by position and scale, never colour, and carries the still-yours qualifier; unspendable buckets carry the padlock; masking covers every figure including the chrome miniature; arithmetic mismatches are surfaced, never corrected; never assume stablecoin parity - render the quoted rate.";
16
+ readonly receive: "# Receive\nShell: content column - a warning callout, the field card, an advisory below.\nRegistry items: venly-tokens, field-list; block: receive.\nHooks: useVirtualBankAccounts (first active EUR account).\nStates that must exist: no virtual bank account yet (offer creation), details present, reference not yet assigned (\"Not assigned yet\" + Required pill - never \"(not required)\").\nRules that must hold: the payment reference is enforced as mandatory (amber Required pill, warning above the fields); per-field copy names the field it copied and only confirms on a successful write; rows never vanish - render the \"(not required)\" variant.";
17
+ readonly send: "# Send\nShell: full page; form clamped ~600px; review step replaces the form.\nRegistry items: venly-tokens, arithmetic-ladder, timeline; block: send.\nHooks: useStagedTransfer (the machine IS the flow), useFeeQuote when fees apply.\nStates that must exist: draft (validation issues listed), staged review, submitting, pending (polling), completed, failed (reason shown, terminal).\nRules that must hold: money movement is stage-then-confirm - the review renders the exact staged request as an arithmetic ladder (working before the answer, uncertainty attached to the number); the commit button restates the amount and never carries a countdown; values are never masked on review; execution is single-shot on an idempotency key pinned at staging.";
18
+ readonly activity: "# Activity\nShell: full-width table + side panel.\nRegistry items: venly-tokens, data-table, status-pill, side-panel, timeline; block: activity.\nHooks: useTransfers (and useRampRequests where ramps are in scope).\nStates that must exist: loading, empty ledger, rows with pending/failed pills, open detail panel that stays in sync with refetches.\nRules that must hold: a row click opens the panel, never navigates; no scrim - the source row stays tinted; settled rows stay quiet (colour is a budget; pills only where action or failure lives); the panel's hero is the amount; the failure reason rides the terminal timeline node.";
19
+ readonly "onboarding-status": "# Onboarding / verification status\nShell: full page, form clamped ~600px; a status home once submitted.\nRegistry items: venly-tokens, timeline, status-pill, field-list; block: onboarding (CompanyForm, VerificationStatusHome, RestrictedBanner).\nHooks: useCreateParty, useCreateAccount, useParty, useAccount; verification status from the party/account records verbatim.\nStates that must exist: collecting (review before submit), submitted/waiting (say who acts next, on which channel, what still works meanwhile), approved, declined (humane copy, review-request as the primary action), re-verification on a live account (banner naming what pauses and what keeps working).\nRules that must hold: never render a fake progress percentage - use real status; a waiting state answers how long / who acts / what still works, and where no review window is published the copy says so instead of inventing one; a decline explains and offers a next step, not a dead end; creating a party is NOT completed verification - show the honest state.";
20
+ readonly "withdraw-bank-accounts": "# Withdraw + bank accounts (off-ramp)\nShell: settings page for the whitelist; full page for the flow, form clamped ~600px.\nRegistry items: venly-tokens, data-table, status-pill, timeline, field-list, arithmetic-ladder; blocks: bank-accounts (BankAccountsBlock, AddBankAccountForm), withdraw (WithdrawFlow, WithdrawalsTable, ConnectedWithdrawDetail).\nHooks: useCompanyBankAccounts, useBankAccountConfig, useCreateCompanyBankAccount, useRampRequests, useRampRequest, useCreateRampRequest, useFeeQuote, useRampPairs, useReferenceData, useFourEyesApproval, useInitiateRamp, describeRampStatus.\nStates that must exist: empty whitelist (one CTA), account in review / verified / declined, no-verified-destination block, amount over balance (two-place signal), fee quote with its unit, awaiting approval (creator sees why they can't approve), stale decision (409 - refetch and re-decide, never auto-retry), awaiting funds (deposit instructions + mandatory reference + tx-hash report), processing, paid out, failed, rejected, cancelled, on hold.\nRules that must hold: destinations are the company's OWN verified accounts - unverified rows are disabled with the reason, never hidden; the pre-create review renders only known figures (no invented rate, no bank-receives placeholder - the created record carries the fiat arithmetic and the detail opens on it); a refusal never reads as a wait; the event timeline renders actor, role and absolute timestamps.";
21
+ readonly reconciliation: "# Reconciliation\nShell: split pane (roughly one-third list, two-thirds evidence) - not a drawer.\nRegistry items: venly-tokens, data-table, side-panel, status-pill, field-list.\nHooks: reconcile_by_reference_code (MCP composite) or useVirtualBankAccounts + useTransfers joined on referenceCode.\nStates that must exist: matched, unmatched with candidate expectations, partial/many-to-one with a live shortfall figure, resolved.\nRules that must hold: show per-signal match rationale (which fields agree), never a bare score; keep zero-counts visible - an empty exception queue is information; keyboard row-stepping for review throughput.";
22
+ readonly "proof-of-segregation": "# Proof of segregation\nShell: content column, single card.\nRegistry items: venly-tokens, field-list, balance-card.\nHooks: useWallets, useAccount; on-chain balance beside the ledger figure.\nStates that must exist: reconciled (figures agree, timestamped), reconciling, source unavailable (say so - never render a stale figure as current).\nRules that must hold: the wallet address renders monospace with copy; the on-chain figure and ledger figure sit side by side with their as-of times; discrepancies are stated, not smoothed.";
23
+ readonly approvals: "# Approvals\nShell: full-width queue + side panel tailored to the approver.\nRegistry items: venly-tokens, data-table, status-pill, side-panel, timeline.\nHooks: useRampRequests, useFourEyesApproval (capability decides what renders), useRampLifecycle.\nStates that must exist: queue with awaiting-approval items, detail with the decision context beside the figures, applied, stale-version (someone acted first - refetch and re-decide), creator-view (cannot approve own request - render the rule, not a disabled mystery button).\nRules that must hold: the optimistic-locking version travels with every decision; a 409 means re-decide against fresh state, never auto-retry; reject requires a reason; the creator sees why they cannot approve.";
24
+ };
25
+ type JourneyKey = keyof typeof JOURNEYS;
12
26
  interface Finding {
13
27
  rule: string;
14
28
  severity: "error" | "warn";
15
29
  evidence: string;
16
30
  fix: string;
31
+ /** 1-based line the finding fired on - lets a CLI print path:line. */
32
+ line?: number;
17
33
  }
18
34
  /** Deterministic design audit. Text in, findings out - no model, no taste. */
19
- export declare function reviewScreenSource(source: string): Finding[];
35
+ export declare function reviewScreenSource(source: string, journey?: JourneyKey): Finding[];
20
36
  export declare function registerFrontendTools(server: McpServer): void;
21
37
  export {};