Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ Files: `src/agent.ts` (dispatch), `authorize.ts`, `lock.ts`, `ops.ts`, `plans.ts
- Deploys, restarts and dashboard money actions are the user's. Prepare and verify; let them ship.
- The retired owner dashboard frontend and its public entry are removed. `web` builds only the confirm/stop
entry. Keep it independent of owner-session reads; consuming apps own their product UI.
On that page: a held payout is never shown as a completed payment and status text stays visible; review context
comes before the action in mobile document order; a required selection never clears on a repeated click; controls
keep a 44px minimum target.
- `pnpm test:live` moves or touches real funds: run only when asked, never scheduled. `PLATFORM_URL=<host> pnpm smoke` is the read-only check of a host.
- An unattended run or freeze may be in progress: ask the user before editing money-path files.

## Calibrated claims

`evidence/inventory.ts` is the canonical requirement/evidence inventory. The app imports it;
`evidence/inventory.ts` is the canonical requirement/evidence inventory.
`pnpm evidence:write` generates the area tables and DEMO verification section. Do not hand-edit
generated sections. Record dated observations in `docs/mainnet-log.md`, reference them in the
inventory, then regenerate. README and walkthroughs link to the canonical presentations.
Expand Down
16 changes: 5 additions & 11 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ existing domain calls. Submission remains centralized in dispatch.
make (`allowlist.ts`), and, for members, proposal decoding for "What am I voting on?" (`proposals.ts`, `sign-requests.ts`).
App access (`app-access.ts`, `app-routes.ts`) serves `/apps/v1` to app servers; `app-confirm.ts` holds the NEP-366
owner actions apps prepare and serves the confirm page's two calls.
- **Web** (`web/src/`): one app for both areas, plus the standalone confirm page (`confirm.tsx`, its own build entry). `format.ts` `kindOf` uses the configured area, with a policy-based fallback for legacy instances; `beats.ts` holds each area's briefs, requirements and stages; `showcase.tsx` shows
them. `timeline-payment.tsx` follows one held payment step by step, each step read from its own record; it shows data
only on the instance that holds those records (approvals filed there). The autopilot run view is no longer here: its
route (`/follow/run`) redirects to the agent's app.
- **Web** (`web/src/`): the standalone confirm and stop page (`confirm.tsx`, the one build entry) and nothing else.
- **Packages**: a release candidate builds one from the tested snapshot (`test/build-context.test.ts` declares it; the
prototype's `dao` package retired with its hosts on 2026-11-08). `platform` (`scripts/package-platform.mjs`) is the
engine for apps: the
Expand Down Expand Up @@ -276,13 +273,10 @@ grants, agreements, payments, strategy, runs and Activity) belong to the consumi

The owner dashboard (public entry, sign-in, agent launcher, setup, agent-access consent, walkthroughs, the Payables
rehearsal and the evidence view) and its browser suites were removed in 0.6.0; [the prototype record](prototype.md)
describes what it did. Modules it used for session and query handling and for payment display remain under
`web/src/app`, `web/src/features` and `web/src/shared`, built into no entry and kept with their offline unit tests:
`payment-records.ts` joins retained local transfers, provider history, held observations and owner records, and a
failed or incomplete provider history read cannot hide a transfer already present in local activity
(`test/payment-records.test.ts`, `test/payment-queue.test.ts`, `test/frontend-boundaries.test.ts` with the payment
stages); `owner-observation.ts` follows a prepared owner action by its correlation ID (`test/owner-observation.test.ts`).
They are neither durable evidence nor authorization.
describes what it did. The modules it used for session and query handling and for payment display, kept at first
with their offline unit tests, are removed too: that logic and its tests belong to the consuming apps. The page's
build-time libraries are development dependencies, so the platform image, which ships the page prebuilt, installs
none of them.

The invoice listener serves the page and its browser module from the same origin. The browser module owns drafts,
refresh ordering and DOM updates; TypeScript checks its JSDoc types during `pnpm typecheck`. Sign-out and an explicit
Expand Down
28 changes: 14 additions & 14 deletions docs/enforcement.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ and [demo at 77cce32](https://github.com/NEAR-Intents-Agent-API/demo/blob/77cce3
describe stripping `nearcom:` and lowercasing its account for Intents transfers. These are
documentation/source observations, not evidence of a deployed provider version.

Our dashboard normalizes owner-entered payees before policy matching and payment review; the RPC
normalizes transfer destinations before preparation or dispatch. Signed policies and provider
The RPC normalizes transfer destinations before preparation or dispatch; normalizing owner-entered
payees before policy matching and payment review is the consuming app's. Signed policies and provider
evidence are not rewritten. Equivalent recipient inputs reach the existing duplicate held-payout
check. Expired and revoked grants remain visible as history; only live grants can authorize new
actions. These changes are tested offline in `test/upstream-compat.test.ts`,
`test/intents-account.test.ts`, `test/form-validation.test.ts` and
`test/intents-account.test.ts` and
the apps' `test/browser/upstream-compat.cjs`; they have not been verified on mainnet.

**Provider display follow-up (offline-tested).** Upstream's
[funds changes at demo@f888f7d](https://github.com/NEAR-Intents-Agent-API/demo/commit/f888f7d)
retain price timestamps and snake-case transaction/refund fields; its
[error changes at demo@7841c1e](https://github.com/NEAR-Intents-Agent-API/demo/commit/7841c1e)
allowlist budget and availability metadata. Our dashboard now preserves balances when prices are
missing, marks stale or unverified price freshness, and withholds the managed book's USD total and
allocation when a held managed asset lacks a fresh price. Unmanaged holdings remain listed separately.
Prices expire against the browser clock even if a refresh fails.
allowlist budget and availability metadata. The platform's valuation (`src/valuation.ts`) reports a price as
stale or unavailable, gives no USD value for a held asset without a fresh price, and gives no total when any
value is missing (`test/provider-values.test.ts`); how balances, freshness and the managed book's total are
shown is the consuming app's.
The demo preflight also refuses an unavailable or invalid managed-book USD total instead of
counting missing values as zero (`test/demo-check.test.ts`, offline fixtures).
The execution holdings calculation now also requires fresh prices and finite managed valuations before
Expand All @@ -106,9 +106,9 @@ exact valuation, settlement-time prices or fees, or provider accounting. No depl

RPC errors and immediate payment refusals carry only validated budget-remaining and availability
metadata. Availability is an observation, not permission to retry; ambiguous outcomes remain unresolved.
Supplementary refusal metadata is not persisted in the journal. Payment review shows provider-reported
transaction hashes and refund fields, marks missing evidence explicitly, and does not infer an explorer
URL, refund asset, or independent settlement proof. Refund amounts remain exact raw units. These changes
Supplementary refusal metadata is not persisted in the journal. The payment evidence the platform returns
carries only provider-reported transaction hashes and refund fields, leaves missing evidence empty, and infers
no explorer URL, refund asset, or independent settlement proof; how a review screen presents it is the consuming app's. Refund amounts remain exact raw units. These changes
are covered by `test/provider-display.test.ts`, `test/provider-values.test.ts`,
`test/payment-status.test.ts` and the apps' `test/browser/provider-display.cjs`; deployed behavior is unverified.

Expand Down Expand Up @@ -444,10 +444,10 @@ not verified on the hosted deployment. The underlying provider dependencies abov

Agreement terms are voter guidance, not an invoice-to-agreement binding. An owner offer is marked
filed when any later invoice from that payee exists (`src/agreements.ts`); multiple offers can match
the same invoice. Payment review shows the terms of the payee's newest non-declined agreement with terms
(`termsInForce`, as the server's `termsFor`), which need not be the terms of that invoice; a payee's agreements all
read `agreed` once the policy lists the payee. The offline test (`web/src/features/payables/payment-stages.test.ts`)
covers selecting the newest terms, excluding declined agreements and other payees. It does not establish
the same invoice. The server reports the terms of the payee's newest non-declined agreement with terms
(`termsFor`), which need not be the terms of that invoice; a payee's agreements all
read `agreed` once the policy lists the payee. `test/agreements.test.ts` covers returning a payee's terms and
excluding a declined agreement; choosing the newest of several is not separately tested. It does not establish
agreement-specific enforcement.

Autopilot summaries distinguish swaps skipped for cost from a book with no rebalance legs meeting
Expand Down
8 changes: 7 additions & 1 deletion docs/market.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,13 @@ Mostly the app's: the agency lists its agent on the market from its owner's mark
token, receives `hire.*` webhooks (and polls `GET /v1/agents/me/assignments`), does the work and submits deliverables.

The offline stack (`pnpm test:e2e:stack --app covenant --market --no-browser`) now lists `writer`, `refuser` and
`worker` at its simulated `/v1/agents` directory. `worker` exposes token-scoped assignments, start and submit routes;
`worker` at its simulated `/v1/agents` directory. `worker` exposes token-scoped assignments, start and submit routes,
and managed deliverable history, latest raw and version-specific raw reads. The history/raw shapes were checked
against the Market OpenAPI on 2026-11-14 (`test/fixtures/market-deliverable-contract.json`); account-session
admission and external deliverables are not simulated. A known owned assignment starts with an empty history;
unknown assignments remain 404 and other workers are refused. `test/market-deliverable-history.test.ts`
checks immutable version bytes, reads after a lost acknowledgement without resubmission, and late-delivery
history without payment settlement. This is offline simulator coverage, not a deployed provider observation;
the stack keeps its `aat_` token and signing secret in a mode-0600 `market-worker-credentials.json`, named by path only
in `state.json`. `--market-webhook-url http://127.0.0.1:<port>/webhook` sends signed `hire.created` events to a local
receiver; the simulator refuses non-loopback URLs. A 2xx webhook receipt marks start, and a repeated delivery uses the
Expand Down
13 changes: 11 additions & 2 deletions docs/sdk-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,17 @@ removed or narrowed, so an app server on `appClient` moves from 0.5.9 without co
Platform only:

- **The retired owner dashboard is no longer built.** The web build has one entry, the confirm and stop page; the
dashboard's pages and their browser suites are deleted. The owner-session routes it called
(`/gw/*`, `/a/<agent>/rpc/*`) still answer for apps that hold a session.
dashboard's pages and their browser suites are deleted, and so are the session, query and payment-display modules
it used, with their unit tests: `web/src` holds the page alone, and that logic belongs to the consuming apps. The
owner-session routes it called (`/gw/*`, `/a/<agent>/rpc/*`) still answer for apps that hold a session.
- **The platform image installs only what the engine runs.** The confirm page ships prebuilt, so its build-time
libraries (React, Radix, the fonts, near-connect) and the crash test's `openai` client are development dependencies
now; `@tanstack/react-query` and `@phosphor-icons/react` are dropped. A production install is ten packages. Checked by
building the image from the package and booting it offline (`pnpm check:platform-image`); not deployed.
- **`dispatch` takes its optional inputs as one named object** (`sending`, `preparedKey`, `expectedPolicy`,
`requestKey`, `payout`, `market`, and `order` for a limit order) in place of up to seven positional arguments, so an
invoice's prepared key and a request's key can't be passed in each other's place. Its types still refuse the same
combinations; every check and its order is unchanged. Offline-tested.
- **Owner-signed Market funding allocation** ([market allocation](market-allocation.md)): an operator command records a
wallet owner's NEP-413 permission to use a fully proven funding-only observation for one exact hire, as a
`market-allocation` journal line (`journalVersion: 4`). It sends nothing; the hire still goes through dispatch,
Expand Down
6 changes: 6 additions & 0 deletions docs/treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,9 @@ against its ceiling; shields are excluded and refunds do not replenish the limit
refuses. The journal supplies these existing records, so no counter migration is needed. This is
offline-tested in `test/planning-valuation.test.ts`; it does not establish settlement-time cost or
provider budget accounting. See [execution valuation](enforcement.md#how-each-claim-is-known).

Autopilot authority refusal (0.6.0 candidate): when this executor has no live grant, a tick records
`grant_missing` before sweep or quote planning. A live grant that does not approve the strategy
still permits the existing plan-for-owner behavior; dispatch authorization remains unchanged.
Offline regression covers absent, revoked and expired grants, zero provider quote/submission calls,
unchanged balances and unchanged operations (`test/autopilot.test.ts`). Not mainnet-observed.
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,22 @@
},
"dependencies": {
"@ag-ui/core": "1.0.3",
"@fastnear/near-connect": "^0.14.1",
"@fontsource-variable/geist": "^5.3.0",
"@fontsource-variable/geist-mono": "^5.3.0",
"@fontsource-variable/inter": "^5.3.0",
"@near-intents-agent-api/sdk": "0.8.2",
"@orpc/client": "2.0.0-beta.47",
"@orpc/contract": "2.0.0-beta.47",
"@orpc/server": "2.0.0-beta.47",
"@phosphor-icons/react": "^2.1.10",
"@tanstack/react-query": "5.105.0",
"class-variance-authority": "0.7.1",
"cn": "^0.5.0",
"effect": "4.1.0",
"near-kit": "^0.20.2",
"openai": "^7.45.1",
"proper-lockfile": "^4.1.2",
"radix-ui": "1.8.1",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"tsx": "^4.23.15",
"zod": "^4.6.7"
},
"devDependencies": {
"@babel/parser": "^8.0.10",
"@fastnear/near-connect": "^0.14.1",
"@fontsource-variable/geist": "^5.3.0",
"@fontsource-variable/geist-mono": "^5.3.0",
"@fontsource-variable/inter": "^5.3.0",
"@playwright/test": "1.64.1",
"@rsbuild/core": "^2.3.0",
"@rsbuild/plugin-react": "^2.1.1",
Expand All @@ -83,9 +75,15 @@
"@types/proper-lockfile": "^4.1.4",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"class-variance-authority": "0.7.1",
"cn": "^0.5.0",
"esbuild": "0.28.2",
"openai": "^7.45.1",
"playwright": "1.64.1",
"radix-ui": "1.8.1",
"railway": "3.16.0",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"shadcn": "4.23.0",
"tailwindcss": "^4.3.3",
"tw-animate-css": "^1.4.0",
Expand Down
Loading
Loading