diff --git a/apps/docs/CLAUDE.md b/apps/docs/CLAUDE.md index cc5df48..0c85564 100644 --- a/apps/docs/CLAUDE.md +++ b/apps/docs/CLAUDE.md @@ -12,6 +12,12 @@ The docs site, **docs.hellonear.xyz**, a **Mintlify** project (Starter plan) con - **For agents, from Mintlify itself:** `/llms.txt`, `/llms-full.txt`, every page as Markdown at `.md`, `/skill.md` and a search MCP server at `/mcp`. Nothing to maintain here. - **Deploys:** Mintlify's GitHub app watches `main`. Git settings in the Mintlify dashboard: repository `Hellonear-AI/hellonear`, branch `main`, "docs.json is in a subdirectory" on, path `/apps/docs`. Custom domain `docs.hellonear.xyz` is set in Mintlify's Domain setup; its `CNAME` in the `hellonear.xyz` Cloudflare zone (DNS only) is on the box owner's side (James), with Axel's approval. Pull requests get a Mintlify preview if the GitHub app is allowed to comment. - The public repo `Hellonear-AI/docs` is Mintlify's onboarding starter, not used. +- **Our own look (Ancung, 13 Nov):** `style.css` (Mintlify loads every `.css` in this folder) gives the docs the web app's quiet scrollbars and the diagrams' colours, light and dark (`html.dark`). +- **Diagrams:** "How it works" draws its two diagrams in SVG from `snippets/how-it-works.jsx` (`Architecture`, `PaymentSteps`), not Mermaid, which shrank to unreadable text. Rounded nodes and curved, labelled links like the app's Mind Graph, dots travelling along them (hidden for reduced motion); HelloNear's own parts tinted lime, outside services plain. Desktop flows left to right; under 768 px the architecture is redrawn top to bottom and the payment becomes a step list, so text keeps its size. They show the same parts and steps the Mermaid diagrams did; change them together with the README. Mintlify's dev server doesn't reload a changed snippet: restart it. +- **Logos:** the Tech stack table shows each technology's logo left of its name (a fixed-width box and a hanging indent, so every name lines up; above the name on phones), where the README has one (copies in `images/brands/` from `design/brands/` and `docs/readme/brands/`; Mintlify can't read outside this folder). The README keeps them in a column of their own, which here was mostly empty. Dark mode swaps in the white versions (`hn-on-light` / `hn-on-dark` in `style.css`); NEAR AI has no white file, so its black mark is inverted. +- **Icons:** The agent's skill table and Connectors' app table show each item's icon left of its name, the README's own (`images/skills/`, `images/apps/`, copied from `docs/readme/icons/`), in a narrow 24 px box (`hn-icons`), kept on the left on phones. Two-column label and value tables have no column titles, so their empty header row is hidden (`style.css`). +- **Tab titles:** `title.js` (Mintlify loads every `.js` here) turns Mintlify's "Page - HelloNear" into "Page | HelloNear", like the web app's (docs.json has no separator setting). Only the tab changes; the server-sent title (search engines, link previews) stays Mintlify's. +- **Search** works on the deployed site only; `mint dev` asks for `mint login` (Axel's Mintlify account) to search locally. ## Commands diff --git a/apps/docs/agent.mdx b/apps/docs/agent.mdx index ddfd1fc..d9ec46f 100644 --- a/apps/docs/agent.mdx +++ b/apps/docs/agent.mdx @@ -109,42 +109,46 @@ This is the core of HelloNear, and the part a judge can read end to end in `engi Icons are the ones the web app shows on each skill card. -| | Skill | What it does | Tools it grants | -|---|---|---|---| -| | **Payments** (`payments`) | Sends testnet NEAR and pays bills after the owner approves; quotes USDC or USDT payments to other chains (Base, Solana…) through NEAR Intents | `send_payment`, `get_balance`, `list_payments`, `get_time`, `near_view_account`, `crosschain_quote` | -| | **Recipient guard** (`recipient-guard`) | Checks a recipient before paying and answers allow, warn or block with the reason: where the account came from, that it exists, lookalikes of people you already pay, first payments, and contracts | `near_view_account`, `list_payments`, `send_payment`, `get_balance`, `get_time` | -| | **Split bill** (`split-bill`) | Works out each person's share of a bill and pays each one after you approve | `add_numbers`, `split_amount`, `send_payment`, `near_view_account`, `list_payments`, `get_balance`, `get_time` | -| | **Revenue split** (`revenue-split`) | Remembers your partners' shares and pays each one their part of new income after you approve | `get_balance`, `send_payment`, `near_view_account`, `add_numbers`, `split_amount`, `list_payments`, `get_time` | -| | **Paid data** (`paid-data`) | Buys small live NEAR reports, paying only after you approve | `buy_data`, `send_payment`, `list_payments`, `get_time` | -| | **Best price buyer** (`best-price`) | Compares every seller of a data report, haggles once when the price is over your budget (then buys or walks away), and buys from one your wallet may pay, after you approve | `get_quotes`, `make_offer`, `buy_data`, `send_payment`, `list_payments`, `get_time` | -| | **Hire on Agent Market** (`agent-market`) | Finds agents on the NEAR AI Agent Market (market.near.ai), gets a job's exact price and picks the cheapest within your budget; hiring is paid in USDC on NEAR mainnet, so during the testnet phase it only quotes | `market_search`, `market_quote` | -| | **Price watch** (`price-watch`) | Checks a data report's price and buys only at or under your limit, after you approve | `get_quotes`, `buy_data`, `send_payment`, `add_numbers`, `get_time` | -| | **Mind as seller** (`mind-seller`) | Sells what this Mind made to other Minds for testnet NEAR into its own wallet, and buys from other Minds, after you approve | `sell_offer`, `buy_from_mind`, `send_payment`, `get_balance`, `get_time` | -| | **Invoice & get paid** (`invoice`) | Emails an invoice from this Mind's address after you approve, and checks a payment only by its transaction | `mail_send`, `mail_list`, `mail_read`, `get_balance`, `near_check_transfer`, `get_time` | -| | **Treasury report** (`treasury-report`) | Reports the wallet balance, what went out since yesterday and what is pending; it only reads | `get_balance`, `list_payments`, `get_time`, `add_numbers` | -| | **Spending audit** (`spending-audit`) | Reviews a week of payments, with tx links for those sent and reasons for those refused; it only reads | `get_balance`, `list_payments`, `get_time`, `add_numbers` | -| | **Freeze advisor** (`freeze-advisor`) | Spots trouble in the wallet and tells you when to press Freeze; it cannot freeze anything itself | `list_payments`, `get_balance`, `get_time` | -| | **NEAR account lookup** (`near-account`) | Looks up NEAR testnet accounts, cannot spend | `near_view_account` | -| | **Phishing check** (`phishing-detector`) | Flags emails that ask for money, keys or urgent action, or that try to give the AI orders; never acts on them | `gmail_list_emails`, `gmail_read_email`, `gmail_organize` | -| | **Confidential reader** (`confidential-reader`) | Summarises sensitive emails (contracts, payslips, medical letters) into dates, amounts and obligations; signs or sends nothing | `gmail_list_emails`, `gmail_read_email` | -| | **Redact before send** (`redact-before-send`) | Takes personal data the recipient does not need out of an email or web request and shows what it removed before sending | `mail_send`, `http_request` | -| | **Health journal** (`health-journal`) | Keeps a private log of sleep, meals, symptoms and mood you tell it and sums up your week; gives no medical advice | `get_time` | -| | **Email helper** (`email-triage`) | Reads the owner's Gmail, saves drafts and tidies the inbox when you approve, never sends | `gmail_list_emails`, `gmail_read_email`, `gmail_create_draft`, `gmail_organize`, `get_time` | -| | **Email address** (`email-address`) | Gives this Mind its own email address and sends email after the owner approves | `mail_send`, `mail_list`, `mail_read`, `get_time`, `mail_send_to_owner` | -| | **Follow-ups** (`follow-ups`) | Finds unpaid invoices and unanswered promises in Gmail and drafts polite follow-ups; never sends | `get_time`, `gmail_list_emails`, `gmail_read_email`, `gmail_create_draft` | -| | **Subscriptions & bills** (`subscriptions`) | Finds subscriptions, bills and due dates in Gmail, adds up the costs and adds reminders when you approve | `get_time`, `gmail_list_emails`, `gmail_read_email`, `add_numbers`, `googlecalendar_create_event` | -| | **Spending tracker** (`spending-tracker`) | Reads receipts in Gmail and totals your spending by category; pays nothing | `get_time`, `gmail_list_emails`, `gmail_read_email`, `add_numbers` | -| | **Daily planner** (`daily-planner`) | Time, quick math, Google Calendar events, free time, moving events, and meetings with a Google Meet link; never deletes events | `get_time`, `add_numbers`, `googlecalendar_list_events`, `googlecalendar_create_event`, `googlecalendar_create_meeting`, `googlecalendar_block_time`, `googlecalendar_find_free_time`, `googlecalendar_move_event` | -| | **Calendar conflict check** (`calendar-conflicts`) | Finds double bookings and back-to-back meetings in the owner's week and suggests moves; moves an event only when the owner asks and approves | `get_time`, `googlecalendar_list_events`, `googlecalendar_create_event`, `googlecalendar_find_free_time`, `googlecalendar_move_event` | -| | **Meeting prep** (`meeting-prep`) | One read-only brief for a meeting from the calendar and recent emails with the people in it | `get_time`, `googlecalendar_list_events`, `gmail_list_emails`, `gmail_read_email` | -| | **Morning briefing** (`morning-briefing`) | One read-only briefing of the day's calendar, inbox and wallet | `get_time`, `googlecalendar_list_events`, `gmail_list_emails`, `gmail_read_email`, `get_balance`, `list_payments` | -| | **Google Sheets** (`sheets`) | Finds and reads the owner's spreadsheets, adds a row or changes cells after approval; never clears or deletes cells | `add_numbers`, `googlesheets_find_spreadsheets`, `googlesheets_read_range`, `googlesheets_append_row`, `googlesheets_update_cells` | -| | **Google Docs** (`docs`) | Finds files in Google Drive, reads Google Docs, creates a new Doc or adds text at the end of one after approval; never shares, changes existing text or deletes | `googledrive_find_files`, `googledocs_read_document`, `googledocs_create_document`, `googledocs_append_text` | -| | **Notion** (`notion`) | Searches and reads the owner's Notion pages and databases, adds a page or a row, and changes a row's properties after approval; never clears, archives or deletes | `notion_search`, `notion_read_page`, `notion_create_page`, `notion_add_row`, `notion_query_database`, `notion_update_row` | -| | **Slack** (`slack`) | Lists the owner's Slack channels and posts a message the owner approved; cannot read messages | `slack_list_channels`, `slack_send_message` | -| | **Outlook email** (`outlook`) | Reads the owner's Outlook inbox, sums it up and saves reply drafts; it never sends | `outlook_list_emails`, `outlook_read_email`, `outlook_create_draft` | -| | **Zoom** (`zoom`) | Lists the owner's Zoom meetings, schedules one with a join link after approval, and reads Zoom's AI summary of a past meeting; never deletes, ends or invites | `zoom_list_meetings`, `zoom_create_meeting`, `zoom_meeting_summary` | -| | **HTTP request** (`http-request`) | Calls the owner's own HTTPS APIs with keys saved in Connections, only on the hosts the owner listed | `http_request` | +
+ +| Skill | What it does | Tools it grants | +|---|---|---| +| **Payments** (`payments`) | Sends testnet NEAR and pays bills after the owner approves; quotes USDC or USDT payments to other chains (Base, Solana…) through NEAR Intents | `send_payment`, `get_balance`, `list_payments`, `get_time`, `near_view_account`, `crosschain_quote` | +| **Recipient guard** (`recipient-guard`) | Checks a recipient before paying and answers allow, warn or block with the reason: where the account came from, that it exists, lookalikes of people you already pay, first payments, and contracts | `near_view_account`, `list_payments`, `send_payment`, `get_balance`, `get_time` | +| **Split bill** (`split-bill`) | Works out each person's share of a bill and pays each one after you approve | `add_numbers`, `split_amount`, `send_payment`, `near_view_account`, `list_payments`, `get_balance`, `get_time` | +| **Revenue split** (`revenue-split`) | Remembers your partners' shares and pays each one their part of new income after you approve | `get_balance`, `send_payment`, `near_view_account`, `add_numbers`, `split_amount`, `list_payments`, `get_time` | +| **Paid data** (`paid-data`) | Buys small live NEAR reports, paying only after you approve | `buy_data`, `send_payment`, `list_payments`, `get_time` | +| **Best price buyer** (`best-price`) | Compares every seller of a data report, haggles once when the price is over your budget (then buys or walks away), and buys from one your wallet may pay, after you approve | `get_quotes`, `make_offer`, `buy_data`, `send_payment`, `list_payments`, `get_time` | +| **Hire on Agent Market** (`agent-market`) | Finds agents on the NEAR AI Agent Market (market.near.ai), gets a job's exact price and picks the cheapest within your budget; hiring is paid in USDC on NEAR mainnet, so during the testnet phase it only quotes | `market_search`, `market_quote` | +| **Price watch** (`price-watch`) | Checks a data report's price and buys only at or under your limit, after you approve | `get_quotes`, `buy_data`, `send_payment`, `add_numbers`, `get_time` | +| **Mind as seller** (`mind-seller`) | Sells what this Mind made to other Minds for testnet NEAR into its own wallet, and buys from other Minds, after you approve | `sell_offer`, `buy_from_mind`, `send_payment`, `get_balance`, `get_time` | +| **Invoice & get paid** (`invoice`) | Emails an invoice from this Mind's address after you approve, and checks a payment only by its transaction | `mail_send`, `mail_list`, `mail_read`, `get_balance`, `near_check_transfer`, `get_time` | +| **Treasury report** (`treasury-report`) | Reports the wallet balance, what went out since yesterday and what is pending; it only reads | `get_balance`, `list_payments`, `get_time`, `add_numbers` | +| **Spending audit** (`spending-audit`) | Reviews a week of payments, with tx links for those sent and reasons for those refused; it only reads | `get_balance`, `list_payments`, `get_time`, `add_numbers` | +| **Freeze advisor** (`freeze-advisor`) | Spots trouble in the wallet and tells you when to press Freeze; it cannot freeze anything itself | `list_payments`, `get_balance`, `get_time` | +| **NEAR account lookup** (`near-account`) | Looks up NEAR testnet accounts, cannot spend | `near_view_account` | +| **Phishing check** (`phishing-detector`) | Flags emails that ask for money, keys or urgent action, or that try to give the AI orders; never acts on them | `gmail_list_emails`, `gmail_read_email`, `gmail_organize` | +| **Confidential reader** (`confidential-reader`) | Summarises sensitive emails (contracts, payslips, medical letters) into dates, amounts and obligations; signs or sends nothing | `gmail_list_emails`, `gmail_read_email` | +| **Redact before send** (`redact-before-send`) | Takes personal data the recipient does not need out of an email or web request and shows what it removed before sending | `mail_send`, `http_request` | +| **Health journal** (`health-journal`) | Keeps a private log of sleep, meals, symptoms and mood you tell it and sums up your week; gives no medical advice | `get_time` | +| **Email helper** (`email-triage`) | Reads the owner's Gmail, saves drafts and tidies the inbox when you approve, never sends | `gmail_list_emails`, `gmail_read_email`, `gmail_create_draft`, `gmail_organize`, `get_time` | +| **Email address** (`email-address`) | Gives this Mind its own email address and sends email after the owner approves | `mail_send`, `mail_list`, `mail_read`, `get_time`, `mail_send_to_owner` | +| **Follow-ups** (`follow-ups`) | Finds unpaid invoices and unanswered promises in Gmail and drafts polite follow-ups; never sends | `get_time`, `gmail_list_emails`, `gmail_read_email`, `gmail_create_draft` | +| **Subscriptions & bills** (`subscriptions`) | Finds subscriptions, bills and due dates in Gmail, adds up the costs and adds reminders when you approve | `get_time`, `gmail_list_emails`, `gmail_read_email`, `add_numbers`, `googlecalendar_create_event` | +| **Spending tracker** (`spending-tracker`) | Reads receipts in Gmail and totals your spending by category; pays nothing | `get_time`, `gmail_list_emails`, `gmail_read_email`, `add_numbers` | +| **Daily planner** (`daily-planner`) | Time, quick math, Google Calendar events, free time, moving events, and meetings with a Google Meet link; never deletes events | `get_time`, `add_numbers`, `googlecalendar_list_events`, `googlecalendar_create_event`, `googlecalendar_create_meeting`, `googlecalendar_block_time`, `googlecalendar_find_free_time`, `googlecalendar_move_event` | +| **Calendar conflict check** (`calendar-conflicts`) | Finds double bookings and back-to-back meetings in the owner's week and suggests moves; moves an event only when the owner asks and approves | `get_time`, `googlecalendar_list_events`, `googlecalendar_create_event`, `googlecalendar_find_free_time`, `googlecalendar_move_event` | +| **Meeting prep** (`meeting-prep`) | One read-only brief for a meeting from the calendar and recent emails with the people in it | `get_time`, `googlecalendar_list_events`, `gmail_list_emails`, `gmail_read_email` | +| **Morning briefing** (`morning-briefing`) | One read-only briefing of the day's calendar, inbox and wallet | `get_time`, `googlecalendar_list_events`, `gmail_list_emails`, `gmail_read_email`, `get_balance`, `list_payments` | +| **Google Sheets** (`sheets`) | Finds and reads the owner's spreadsheets, adds a row or changes cells after approval; never clears or deletes cells | `add_numbers`, `googlesheets_find_spreadsheets`, `googlesheets_read_range`, `googlesheets_append_row`, `googlesheets_update_cells` | +| **Google Docs** (`docs`) | Finds files in Google Drive, reads Google Docs, creates a new Doc or adds text at the end of one after approval; never shares, changes existing text or deletes | `googledrive_find_files`, `googledocs_read_document`, `googledocs_create_document`, `googledocs_append_text` | +| **Notion** (`notion`) | Searches and reads the owner's Notion pages and databases, adds a page or a row, and changes a row's properties after approval; never clears, archives or deletes | `notion_search`, `notion_read_page`, `notion_create_page`, `notion_add_row`, `notion_query_database`, `notion_update_row` | +| **Slack** (`slack`) | Lists the owner's Slack channels and posts a message the owner approved; cannot read messages | `slack_list_channels`, `slack_send_message` | +| **Outlook email** (`outlook`) | Reads the owner's Outlook inbox, sums it up and saves reply drafts; it never sends | `outlook_list_emails`, `outlook_read_email`, `outlook_create_draft` | +| **Zoom** (`zoom`) | Lists the owner's Zoom meetings, schedules one with a join link after approval, and reads Zoom's AI summary of a past meeting; never deletes, ends or invites | `zoom_list_meetings`, `zoom_create_meeting`, `zoom_meeting_summary` | +| **HTTP request** (`http-request`) | Calls the owner's own HTTPS APIs with keys saved in Connections, only on the hosts the owner listed | `http_request` | + +
Plus the built-in **HelloNear guide**, loaded by every Mind, so it can answer questions about the app without inventing screens or features. diff --git a/apps/docs/connectors.mdx b/apps/docs/connectors.mdx index 8f6b7ff..1562782 100644 --- a/apps/docs/connectors.mdx +++ b/apps/docs/connectors.mdx @@ -5,21 +5,25 @@ description: "The apps and services a Mind can use, and what each one is for." What a Mind can work with. Logos are the ones the web app shows on the Connections screen (rendered from `apps/fe/src/components/elements/AppLogos.tsx`); each is its owner's trademark, used to name the app. -| | Connector | How it connects | What a Mind can do with it | -|---|---|---|---| -| | **Gmail** | Composio (OAuth, the owner's account) | Read and search mail, save drafts, archive or label after approval. No send tool exists | -| | **Google Calendar** | Composio | Read events, find free time, add an event, move an event, all with times on the owner's clock | -| | **Google Meet** | Composio | Schedule a meeting with guests the owner named and a Meet link, after approval | -| | **Google Sheets** | Composio | Find and read sheets, add a row, change cells with the old value shown first | -| | **Google Drive** | Composio | Search files by name and content | -| | **Google Docs** | Composio | Read a Doc, create one, add text at the end (never replaces) | -| | **Notion** | Composio | Search and read pages and databases, add a page or a row, change a row's properties | -| | **Slack** | Composio | List channels, post a message the owner approved | -| | **Outlook** | Composio | Read mail and save reply drafts (no send) | -| | **Zoom** | Composio | List meetings, schedule one with a join link, read Zoom's AI summary of a past meeting | -| | **Telegram** | A bot per Mind, made by the owner with BotFather | Chat with the Mind, streamed replies, Approve / Decline buttons on cards; only the owner's chat is answered | -| | **The Mind's own email address** | AgentMail, one inbox per Mind | Send from `…@agentmail.to` after approval, only to addresses the owner typed; read its own inbox with spam and phishing warnings | -| | **NEAR wallet** (Meteor first) | NEAR Connect, NEP-413 sign-in | The owner signs in, sets the Mind wallet's limits and freezes it; the Mind never holds the owner's keys | -| | **HTTP request** (your own APIs) | API keys the owner saves in Connections, stored encrypted | Call any HTTPS API the owner uses (a store, a CRM, a webhook) with the owner's key, only on the hosts the owner listed; the Mind writes `{{secrets.NAME}}` and never sees the key | +
+ +| Connector | How it connects | What a Mind can do with it | +|---|---|---| +| **Gmail** | Composio (OAuth, the owner's account) | Read and search mail, save drafts, archive or label after approval. No send tool exists | +| **Google Calendar** | Composio | Read events, find free time, add an event, move an event, all with times on the owner's clock | +| **Google Meet** | Composio | Schedule a meeting with guests the owner named and a Meet link, after approval | +| **Google Sheets** | Composio | Find and read sheets, add a row, change cells with the old value shown first | +| **Google Drive** | Composio | Search files by name and content | +| **Google Docs** | Composio | Read a Doc, create one, add text at the end (never replaces) | +| **Notion** | Composio | Search and read pages and databases, add a page or a row, change a row's properties | +| **Slack** | Composio | List channels, post a message the owner approved | +| **Outlook** | Composio | Read mail and save reply drafts (no send) | +| **Zoom** | Composio | List meetings, schedule one with a join link, read Zoom's AI summary of a past meeting | +| **Telegram** | A bot per Mind, made by the owner with BotFather | Chat with the Mind, streamed replies, Approve / Decline buttons on cards; only the owner's chat is answered | +| **The Mind's own email address** | AgentMail, one inbox per Mind | Send from `…@agentmail.to` after approval, only to addresses the owner typed; read its own inbox with spam and phishing warnings | +| **NEAR wallet** (Meteor first) | NEAR Connect, NEP-413 sign-in | The owner signs in, sets the Mind wallet's limits and freezes it; the Mind never holds the owner's keys | +| **HTTP request** (your own APIs) | API keys the owner saves in Connections, stored encrypted | Call any HTTPS API the owner uses (a store, a CRM, a webhook) with the owner's key, only on the hosts the owner listed; the Mind writes `{{secrets.NAME}}` and never sees the key | + +
--- diff --git a/apps/docs/events.mdx b/apps/docs/events.mdx index cb2ce95..9ee1027 100644 --- a/apps/docs/events.mdx +++ b/apps/docs/events.mdx @@ -31,7 +31,7 @@ Common fields on every event: | `step.finished` | `step`, `usage` | `step-finish` | | `run.finished` | `finishReason`, `text`, `usage`, `costUsd`, `verification: { status: "pending" }` | `finish` | | `run.finished` (canceled) | `status: "canceled"`, `finishReason: "canceled"`; no `text`, `usage` or `costUsd`, and no `run.verified` after it | **backend**, not the engine: the last event of a run stopped with `POST /v1/runs/{runId}/cancel` (#121); a builder run gets `workflow.finished` with `status: "canceled"` instead | -| `attack.verdict` | `attackId`, `attacker`, `paymentTool` (the Mind's skills grant `send_payment`), `stoppedBy`: `model` (refused, asked for no payment) · `no_tool` (no payment tool) · `approval` (a payment card waits for the owner) · `policy` (approved, then refused by the wallet in OutLayer's TEE before signing: `policy_denied` / `wallet_frozen`, no tx) · `none` (a payment was sent), `detail`, optional `to`, `status`, `attackerTargeted` (the payment went to the scenario's attacker), `txHash` (only for `none`) | engine (`src/attacks.ts`, #16), on a run that carries `attackId`, after `run.finished` and before `run.verified` | +| `attack.verdict` | `attackId`, `attacker`, `paymentTool` (the Mind's skills grant `send_payment`), `stoppedBy`: `model` (refused, asked for no payment); `no_tool` (no payment tool); `approval` (a payment card waits for the owner); `policy` (approved, then refused by the wallet in OutLayer's TEE before signing: `policy_denied` / `wallet_frozen`, no tx); `none` (a payment was sent), `detail`, optional `to`, `status`, `attackerTargeted` (the payment went to the scenario's attacker), `txHash` (only for `none`) | engine (`src/attacks.ts`, #16), on a run that carries `attackId`, after `run.finished` and before `run.verified` | | `thread.titled` | `threadId`, `title` (3 to 6 words summing up the user's first message, in the user's language, no quotes or final period) | engine (`src/titles.ts`, #86, #93), after the `run.finished` of a thread's first run and before `run.verified`; skipped if making the title fails or takes too long, and then the backend keeps the first-message cut | | `run.verified` | `model`, `nodeId`, `verification` (see below). Always the run's **last** event | engine, after the stream is read | | `run.error` | `error` | `error` chunk or a thrown error. The backend adds one itself when the engine stream breaks (`engine_stream_interrupted`), and when a run stayed `running` after a backend restart (`run_interrupted`, #218) | diff --git a/apps/docs/how-it-works.mdx b/apps/docs/how-it-works.mdx index 8dcd269..fcd67b9 100644 --- a/apps/docs/how-it-works.mdx +++ b/apps/docs/how-it-works.mdx @@ -3,71 +3,15 @@ title: "How it works" description: "The parts of HelloNear and how one payment goes from a chat message to a NEAR transaction." --- -```mermaid -flowchart LR - O([Owner]) -->|chat, approve| FE[Web app Next.js] - O -->|chat, approve| TG[Telegram bot] - O -->|signs policy, freeze| MW[Meteor wallet] - FE --> BE[Backend API NEP-413 sign-in, runs, approvals] - TG --> BE - BE -->|mind config + skills| EN +import { Architecture, PaymentSteps } from "/snippets/how-it-works.jsx"; - subgraph EN[Engine · Mastra 1.81] - direction TB - AG[One generic Mind agent persona, memory, skills from RequestContext] - TL[[53 tools granted only by equipped skills]] - WF[Visual Builder workflows + Autopilot schedules] - AG --> TL - WF --> TL - end - EN -->|every model call| NAI[(NEAR AI Cloud TEE inference)] - NAI -->|signature + attestation| VER{{verify before the badge}} - TL -->|wallet routes| BE - BE -->|transfer| OL[(OutLayer wallet policy checked in a TEE)] - MW -->|store_wallet_policy, freeze_wallet| OLC[(outlayer.testnet)] - OL --> NEAR[(NEAR testnet)] - TL -->|dry quote| INT[(NEAR Intents 1Click)] - TL -->|Gmail, Calendar, Sheets, Notion…| CMP[(Composio)] - BE -->|Intel quote| TEX[(Phala TEE Explorer)] - TL -->|view_account, tx| RPC[(NEAR RPC)] - BE -.->|registry| REG[(hellonear-registry.testnet)] -``` +## The parts -### One payment, call by call + -```mermaid -sequenceDiagram - autonumber - participant O as Owner - participant A as Mind (Mastra agent) - participant M as NEAR AI Cloud (TEE) - participant B as Backend - participant W as OutLayer (TEE) - participant N as NEAR testnet +## One payment, call by call - O->>A: "Pay 0.01 NEAR to alice.testnet" - A->>M: model call (streamed) - M-->>A: tool call near_view_account - A->>N: RPC view_account alice.testnet - N-->>A: account exists - M-->>A: tool call send_payment - Note over A: requireApproval: the run pauses (unless an owner rule covers it) - A-->>O: approval card: amount, recipient, checks - O->>B: Approve - B->>A: resume the run - A->>B: /internal/v1/wallet/send_payment (wallet token) - B->>W: transfer request - alt inside the policy - W->>N: signed transfer - N-->>W: tx hash - W-->>A: sent + txHash - else over the limit, not on the list, or frozen - W-->>A: policy_denied / wallet_frozen, no tx - end - A-->>O: receipt (or "refused before signing") - A->>M: fetch signatures + attestation - Note over A: run.verified: badge shown only if every step matches the attested key -``` + --- diff --git a/apps/docs/images/apps/gmail.svg b/apps/docs/images/apps/gmail.svg new file mode 100644 index 0000000..0636958 --- /dev/null +++ b/apps/docs/images/apps/gmail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/google-calendar.svg b/apps/docs/images/apps/google-calendar.svg new file mode 100644 index 0000000..54d6bdd --- /dev/null +++ b/apps/docs/images/apps/google-calendar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/google-docs.svg b/apps/docs/images/apps/google-docs.svg new file mode 100644 index 0000000..c3417dd --- /dev/null +++ b/apps/docs/images/apps/google-docs.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/google-drive.svg b/apps/docs/images/apps/google-drive.svg new file mode 100644 index 0000000..8372c1b --- /dev/null +++ b/apps/docs/images/apps/google-drive.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/google-meet.svg b/apps/docs/images/apps/google-meet.svg new file mode 100644 index 0000000..1b4bfb6 --- /dev/null +++ b/apps/docs/images/apps/google-meet.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/google-sheets.svg b/apps/docs/images/apps/google-sheets.svg new file mode 100644 index 0000000..4d04add --- /dev/null +++ b/apps/docs/images/apps/google-sheets.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/meteor.svg b/apps/docs/images/apps/meteor.svg new file mode 100644 index 0000000..6c03792 --- /dev/null +++ b/apps/docs/images/apps/meteor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/notion.svg b/apps/docs/images/apps/notion.svg new file mode 100644 index 0000000..e72672e --- /dev/null +++ b/apps/docs/images/apps/notion.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/outlook.svg b/apps/docs/images/apps/outlook.svg new file mode 100644 index 0000000..21def00 --- /dev/null +++ b/apps/docs/images/apps/outlook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/slack.svg b/apps/docs/images/apps/slack.svg new file mode 100644 index 0000000..24e12df --- /dev/null +++ b/apps/docs/images/apps/slack.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/telegram.svg b/apps/docs/images/apps/telegram.svg new file mode 100644 index 0000000..12c2129 --- /dev/null +++ b/apps/docs/images/apps/telegram.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/apps/zoom.svg b/apps/docs/images/apps/zoom.svg new file mode 100644 index 0000000..df3f18f --- /dev/null +++ b/apps/docs/images/apps/zoom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/brands/agent-market.svg b/apps/docs/images/brands/agent-market.svg new file mode 100644 index 0000000..688798b --- /dev/null +++ b/apps/docs/images/brands/agent-market.svg @@ -0,0 +1,16 @@ + + + + + + + diff --git a/apps/docs/images/brands/agentmail-white.svg b/apps/docs/images/brands/agentmail-white.svg new file mode 100644 index 0000000..3b0744d --- /dev/null +++ b/apps/docs/images/brands/agentmail-white.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/apps/docs/images/brands/agentmail.svg b/apps/docs/images/brands/agentmail.svg new file mode 100644 index 0000000..504c0f6 --- /dev/null +++ b/apps/docs/images/brands/agentmail.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/apps/docs/images/brands/composio-white.svg b/apps/docs/images/brands/composio-white.svg new file mode 100644 index 0000000..0c83904 --- /dev/null +++ b/apps/docs/images/brands/composio-white.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/apps/docs/images/brands/composio.svg b/apps/docs/images/brands/composio.svg new file mode 100644 index 0000000..e285c17 --- /dev/null +++ b/apps/docs/images/brands/composio.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/apps/docs/images/brands/mastra-white.svg b/apps/docs/images/brands/mastra-white.svg new file mode 100644 index 0000000..2eb6512 --- /dev/null +++ b/apps/docs/images/brands/mastra-white.svg @@ -0,0 +1 @@ + diff --git a/apps/docs/images/brands/mastra.svg b/apps/docs/images/brands/mastra.svg new file mode 100644 index 0000000..f01e561 --- /dev/null +++ b/apps/docs/images/brands/mastra.svg @@ -0,0 +1 @@ + diff --git a/apps/docs/images/brands/meteor-wallet-mark.svg b/apps/docs/images/brands/meteor-wallet-mark.svg new file mode 100644 index 0000000..008bfbe --- /dev/null +++ b/apps/docs/images/brands/meteor-wallet-mark.svg @@ -0,0 +1 @@ + diff --git a/apps/docs/images/brands/near-ai-black.svg b/apps/docs/images/brands/near-ai-black.svg new file mode 100644 index 0000000..302e0fb --- /dev/null +++ b/apps/docs/images/brands/near-ai-black.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/apps/docs/images/brands/near-ai.svg b/apps/docs/images/brands/near-ai.svg new file mode 100644 index 0000000..eaab859 --- /dev/null +++ b/apps/docs/images/brands/near-ai.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/apps/docs/images/brands/near-white.svg b/apps/docs/images/brands/near-white.svg new file mode 100644 index 0000000..ccb592c --- /dev/null +++ b/apps/docs/images/brands/near-white.svg @@ -0,0 +1 @@ + diff --git a/apps/docs/images/brands/near.svg b/apps/docs/images/brands/near.svg new file mode 100644 index 0000000..f53fda2 --- /dev/null +++ b/apps/docs/images/brands/near.svg @@ -0,0 +1 @@ + diff --git a/apps/docs/images/brands/outlayer.png b/apps/docs/images/brands/outlayer.png new file mode 100644 index 0000000..032a4ba Binary files /dev/null and b/apps/docs/images/brands/outlayer.png differ diff --git a/apps/docs/images/brands/telegram.svg b/apps/docs/images/brands/telegram.svg new file mode 100644 index 0000000..12c2129 --- /dev/null +++ b/apps/docs/images/brands/telegram.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/brands/zai.svg b/apps/docs/images/brands/zai.svg new file mode 100644 index 0000000..4f511bd --- /dev/null +++ b/apps/docs/images/brands/zai.svg @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/docs/images/skills/agent-market.svg b/apps/docs/images/skills/agent-market.svg new file mode 100644 index 0000000..44b407f --- /dev/null +++ b/apps/docs/images/skills/agent-market.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/best-price.svg b/apps/docs/images/skills/best-price.svg new file mode 100644 index 0000000..04fcc91 --- /dev/null +++ b/apps/docs/images/skills/best-price.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/calendar-conflicts.svg b/apps/docs/images/skills/calendar-conflicts.svg new file mode 100644 index 0000000..8c94f9c --- /dev/null +++ b/apps/docs/images/skills/calendar-conflicts.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/confidential-reader.svg b/apps/docs/images/skills/confidential-reader.svg new file mode 100644 index 0000000..3fd0687 --- /dev/null +++ b/apps/docs/images/skills/confidential-reader.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/daily-planner.svg b/apps/docs/images/skills/daily-planner.svg new file mode 100644 index 0000000..9e76a6a --- /dev/null +++ b/apps/docs/images/skills/daily-planner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/email-address.svg b/apps/docs/images/skills/email-address.svg new file mode 100644 index 0000000..e47176f --- /dev/null +++ b/apps/docs/images/skills/email-address.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/email-triage.svg b/apps/docs/images/skills/email-triage.svg new file mode 100644 index 0000000..0636958 --- /dev/null +++ b/apps/docs/images/skills/email-triage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/follow-ups.svg b/apps/docs/images/skills/follow-ups.svg new file mode 100644 index 0000000..ecbabec --- /dev/null +++ b/apps/docs/images/skills/follow-ups.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/freeze-advisor.svg b/apps/docs/images/skills/freeze-advisor.svg new file mode 100644 index 0000000..f0fe46f --- /dev/null +++ b/apps/docs/images/skills/freeze-advisor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/health-journal.svg b/apps/docs/images/skills/health-journal.svg new file mode 100644 index 0000000..f4f6b39 --- /dev/null +++ b/apps/docs/images/skills/health-journal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/http-request.svg b/apps/docs/images/skills/http-request.svg new file mode 100644 index 0000000..44b407f --- /dev/null +++ b/apps/docs/images/skills/http-request.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/invoice.svg b/apps/docs/images/skills/invoice.svg new file mode 100644 index 0000000..35b69e7 --- /dev/null +++ b/apps/docs/images/skills/invoice.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/meeting-prep.svg b/apps/docs/images/skills/meeting-prep.svg new file mode 100644 index 0000000..aa99e1b --- /dev/null +++ b/apps/docs/images/skills/meeting-prep.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/mind-seller.svg b/apps/docs/images/skills/mind-seller.svg new file mode 100644 index 0000000..c365f86 --- /dev/null +++ b/apps/docs/images/skills/mind-seller.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/morning-briefing.svg b/apps/docs/images/skills/morning-briefing.svg new file mode 100644 index 0000000..004696a --- /dev/null +++ b/apps/docs/images/skills/morning-briefing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/near-account.svg b/apps/docs/images/skills/near-account.svg new file mode 100644 index 0000000..2754b80 --- /dev/null +++ b/apps/docs/images/skills/near-account.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/outlook.svg b/apps/docs/images/skills/outlook.svg new file mode 100644 index 0000000..21def00 --- /dev/null +++ b/apps/docs/images/skills/outlook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/paid-data.svg b/apps/docs/images/skills/paid-data.svg new file mode 100644 index 0000000..883c99f --- /dev/null +++ b/apps/docs/images/skills/paid-data.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/payments.svg b/apps/docs/images/skills/payments.svg new file mode 100644 index 0000000..1b71371 --- /dev/null +++ b/apps/docs/images/skills/payments.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/phishing-detector.svg b/apps/docs/images/skills/phishing-detector.svg new file mode 100644 index 0000000..fb91990 --- /dev/null +++ b/apps/docs/images/skills/phishing-detector.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/price-watch.svg b/apps/docs/images/skills/price-watch.svg new file mode 100644 index 0000000..22a4e60 --- /dev/null +++ b/apps/docs/images/skills/price-watch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/recipient-guard.svg b/apps/docs/images/skills/recipient-guard.svg new file mode 100644 index 0000000..b373366 --- /dev/null +++ b/apps/docs/images/skills/recipient-guard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/redact-before-send.svg b/apps/docs/images/skills/redact-before-send.svg new file mode 100644 index 0000000..5597640 --- /dev/null +++ b/apps/docs/images/skills/redact-before-send.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/revenue-split.svg b/apps/docs/images/skills/revenue-split.svg new file mode 100644 index 0000000..6dc1c81 --- /dev/null +++ b/apps/docs/images/skills/revenue-split.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/spending-audit.svg b/apps/docs/images/skills/spending-audit.svg new file mode 100644 index 0000000..493714b --- /dev/null +++ b/apps/docs/images/skills/spending-audit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/spending-tracker.svg b/apps/docs/images/skills/spending-tracker.svg new file mode 100644 index 0000000..4c6cf3a --- /dev/null +++ b/apps/docs/images/skills/spending-tracker.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/split-bill.svg b/apps/docs/images/skills/split-bill.svg new file mode 100644 index 0000000..8a2e27c --- /dev/null +++ b/apps/docs/images/skills/split-bill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/subscriptions.svg b/apps/docs/images/skills/subscriptions.svg new file mode 100644 index 0000000..972ba99 --- /dev/null +++ b/apps/docs/images/skills/subscriptions.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/images/skills/treasury-report.svg b/apps/docs/images/skills/treasury-report.svg new file mode 100644 index 0000000..161f12a --- /dev/null +++ b/apps/docs/images/skills/treasury-report.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/docs/index.mdx b/apps/docs/index.mdx index 48f473c..b089ab9 100644 --- a/apps/docs/index.mdx +++ b/apps/docs/index.mdx @@ -3,9 +3,9 @@ title: "Introduction" description: "HelloNear gives a person a Mind, an AI agent with a persona, memory, skills and its own NEAR wallet, whose money rules sit outside the model." --- -HelloNear gives a person a **Mind**: an AI agent with a persona, memory, skills it can equip and its own NEAR wallet. It reads your email, works in your apps and pays your bills, but **every limit that matters sits outside the model**: the owner approves, and the wallet's policy is checked inside a TEE before anything is signed. Every reply comes from NEAR AI Cloud's TEE with a proof you can check yourself. +A **Mind** reads your email, works in your apps and pays your bills, but **every limit that matters sits outside the model**: the owner approves, and the wallet's policy is checked inside a TEE before anything is signed. Every reply comes from NEAR AI Cloud's TEE with a proof you can check yourself. -Built at **NEAR HACKATHON** (1 to 14 Nov 2026) for six tracks: `security`, `privacy`, `agents`, `swarms`, `business`, `realworld`. Everything runs on **NEAR testnet** during the hackathon. +Built at **NEAR HACKATHON** (1 to 14 Nov 2026) for six tracks: security, privacy, agents, swarms, business and realworld. Everything runs on **NEAR testnet** during the hackathon. ## Live now diff --git a/apps/docs/snippets/how-it-works.jsx b/apps/docs/snippets/how-it-works.jsx new file mode 100644 index 0000000..9c9b009 --- /dev/null +++ b/apps/docs/snippets/how-it-works.jsx @@ -0,0 +1,298 @@ +// The diagrams on "How it works", drawn as SVG instead of Mermaid (Ancung, 13 Nov: the Mermaid flowchart +// shrank to unreadable text, worst on phones). Same parts, arrows and steps as the Mermaid diagrams they +// replace; nothing added. Like the app's Mind Graph: rounded nodes joined by curved, labelled links, with +// small dots travelling along them (style.css hides the dots for reduced motion). Desktop flows left to +// right; phones get the same parts top to bottom, so the text keeps its size. HelloNear's own parts are +// tinted (hn-ours), outside services plain; colours live in style.css, light and dark. + +// A curved link from one side of a node to a side of another. Sides: l, r, t, b; f is where along the side +// (0 to 1, the middle by default). k1 and k2 set how far the curve leaves and enters (to route it around a +// group); t is where along it the label sits. +const anchor = (n, side, f = 0.5) => + side === "l" ? [n.x, n.y + n.h * f, -1, 0] + : side === "r" ? [n.x + n.w, n.y + n.h * f, 1, 0] + : side === "t" ? [n.x + n.w * f, n.y, 0, -1] + : [n.x + n.w * f, n.y + n.h, 0, 1]; + +const link = (e, a, b) => { + const [x1, y1, dx1, dy1] = anchor(a, e.fs, e.ff); + const [x2, y2, dx2, dy2] = anchor(b, e.ts, e.tf); + const k = Math.max(28, Math.hypot(x2 - x1, y2 - y1) * 0.4); + const c1 = [x1 + dx1 * (e.k1 ?? k), y1 + dy1 * (e.k1 ?? k)]; + const c2 = [x2 + dx2 * (e.k2 ?? k), y2 + dy2 * (e.k2 ?? k)]; + const t = e.t ?? 0.5, u = 1 - t; + const at = (p, q, r, s2) => u * u * u * p + 3 * u * u * t * q + 3 * u * t * t * r + t * t * t * s2; + const mid = [at(x1, c1[0], c2[0], x2), at(y1, c1[1], c2[1], y2)]; + return { d: `M${x1},${y1} C${c1[0]},${c1[1]} ${c2[0]},${c2[1]} ${x2},${y2}`, mid, end: [x2, y2, dx2, dy2] }; +}; + +const Node = ({ n }) => ( + + + + {n.title} + + {(n.sub || []).map((line, i) => ( + + {line} + + ))} + +); + +const Edge = ({ e, nodes, i }) => { + const { d, mid, end } = link(e, nodes[e.from], nodes[e.to]); + const [x, y, dx, dy] = end; + // An arrowhead pointing into the target side. + const ax = -dx, ay = -dy, px = -ay, py = ax; + const head = `M${x + dx * 7 + px * 4},${y + dy * 7 + py * 4} L${x},${y} L${x + dx * 7 - px * 4},${y + dy * 7 - py * 4}`; + const w = e.label ? e.label.length * 5.6 + 12 : 0; + return ( + + + + {e.dashed ? null : ( + + + + )} + {e.label ? ( + + + + {e.label} + + + ) : null} + + ); +}; + +const Group = ({ g }) => ( + + + + {g.label} + + +); + +const Canvas = ({ width, height, nodes, edges, groups, label, className }) => ( + + {(groups || []).map((g, i) => )} + {edges.map((e, i) => )} + {Object.values(nodes).map((n, i) => )} + +); + +const ARCH_LABEL = + "HelloNear's parts. The owner chats and approves in the web app or Telegram, which talk to the backend API; Meteor signs the wallet policy and Freeze on OutLayer. The backend sends each Mind's config and skills to the engine (Mastra): one generic Mind agent, 53 tools granted by equipped skills, and Builder workflows with Autopilot. The engine calls NEAR AI Cloud for every model call, NEAR Intents for dry quotes, Composio for apps, and NEAR RPC. The backend sends transfers to OutLayer, which checks the policy in a TEE and signs for NEAR testnet, uploads Intel quotes to Phala's TEE Explorer, and writes the Mind registry."; + +export const Architecture = () => { + // Desktop: left to right. The backend's own calls (OutLayer, Phala, the registry) sit in the bottom row and + // their links dip under the engine instead of crossing it. + const D = { + web: { x: 0, y: 30, w: 132, h: 54, title: "Web app", sub: ["chat, approve"], ours: true }, + tg: { x: 0, y: 98, w: 132, h: 54, title: "Telegram bot", sub: ["chat, approve"], ours: true }, + meteor: { x: 0, y: 166, w: 132, h: 54, title: "Meteor wallet", sub: ["the owner signs"] }, + be: { x: 200, y: 64, w: 150, h: 70, title: "Backend API", sub: ["NEP-413 sign-in,", "runs, approvals"], ours: true }, + agent: { x: 445, y: 40, w: 150, h: 56, title: "Mind agent", sub: ["persona, memory, skills"], ours: true }, + tools: { x: 445, y: 110, w: 150, h: 56, title: "53 tools", sub: ["only equipped skills"], ours: true }, + wf: { x: 445, y: 180, w: 150, h: 56, title: "Workflows", sub: ["Builder, Autopilot"], ours: true }, + nai: { x: 670, y: 16, w: 150, h: 54, title: "NEAR AI Cloud", sub: ["TEE inference"] }, + intents: { x: 670, y: 82, w: 150, h: 54, title: "NEAR Intents", sub: ["1Click quotes"] }, + composio: { x: 670, y: 148, w: 150, h: 54, title: "Composio", sub: ["Gmail, Calendar, more"] }, + rpc: { x: 670, y: 214, w: 150, h: 54, title: "NEAR RPC", sub: ["view_account, tx"] }, + near: { x: 0, y: 344, w: 132, h: 54, title: "NEAR testnet", sub: ["signed transfers"] }, + ol: { x: 200, y: 336, w: 150, h: 70, title: "OutLayer", sub: ["policy checked", "in a TEE"] }, + phala: { x: 445, y: 336, w: 150, h: 70, title: "Phala TEE", sub: ["Explorer"] }, + reg: { x: 670, y: 336, w: 150, h: 70, title: "Mind registry", sub: ["hellonear-registry", ".testnet"], mono: true }, + }; + const E = [ + { from: "web", fs: "r", to: "be", ts: "l", tf: 0.35 }, + { from: "tg", fs: "r", to: "be", ts: "l", tf: 0.65 }, + { from: "be", fs: "r", ff: 0.35, to: "agent", ts: "l", label: "config + skills", t: 0.45 }, + { from: "tools", fs: "l", to: "be", ts: "r", tf: 0.75, label: "wallet routes", dashed: true, t: 0.5 }, + { from: "agent", fs: "b", to: "tools", ts: "t" }, + { from: "wf", fs: "t", to: "tools", ts: "b" }, + { from: "agent", fs: "r", to: "nai", ts: "l", label: "model calls" }, + { from: "tools", fs: "r", ff: 0.3, to: "intents", ts: "l", label: "dry quote" }, + { from: "tools", fs: "r", ff: 0.55, to: "composio", ts: "l" }, + { from: "tools", fs: "r", ff: 0.8, to: "rpc", ts: "l" }, + { from: "meteor", fs: "b", to: "ol", ts: "t", tf: 0.25, label: "policy, freeze", t: 0.45 }, + { from: "be", fs: "b", ff: 0.6, to: "ol", ts: "t", tf: 0.65, label: "transfer" }, + { from: "ol", fs: "l", to: "near", ts: "r" }, + { from: "be", fs: "b", ff: 0.85, to: "phala", ts: "t", k1: 170, k2: 40, label: "Intel quote", t: 0.72 }, + { from: "be", fs: "b", ff: 0.95, to: "reg", ts: "t", k1: 185, k2: 40, label: "registry", dashed: true, t: 0.8 }, + ]; + const DG = [{ x: 430, y: 0, w: 180, h: 250, label: "Engine (Mastra 1.81)" }]; + + // Phones: the same parts top to bottom, two columns where they fit. + const M = { + web: { x: 0, y: 0, w: 108, h: 40, title: "Web app", ours: true }, + tg: { x: 122, y: 0, w: 108, h: 40, title: "Telegram", ours: true }, + meteor: { x: 244, y: 0, w: 116, h: 40, title: "Meteor" }, + be: { x: 50, y: 92, w: 180, h: 70, title: "Backend API", sub: ["NEP-413 sign-in,", "runs, approvals"], ours: true }, + agent: { x: 24, y: 244, w: 150, h: 56, title: "Mind agent", sub: ["persona, memory"], ours: true }, + tools: { x: 186, y: 244, w: 150, h: 56, title: "53 tools", sub: ["equipped skills"], ours: true }, + wf: { x: 186, y: 314, w: 150, h: 56, title: "Workflows", sub: ["Builder, Autopilot"], ours: true }, + nai: { x: 0, y: 432, w: 172, h: 54, title: "NEAR AI Cloud", sub: ["TEE inference"] }, + intents: { x: 188, y: 432, w: 172, h: 54, title: "NEAR Intents", sub: ["1Click quotes"] }, + composio: { x: 0, y: 498, w: 172, h: 54, title: "Composio", sub: ["Gmail, Calendar"] }, + rpc: { x: 188, y: 498, w: 172, h: 54, title: "NEAR RPC", sub: ["view_account, tx"] }, + ol: { x: 0, y: 610, w: 172, h: 54, title: "OutLayer", sub: ["policy signed in Meteor"] }, + near: { x: 188, y: 610, w: 172, h: 54, title: "NEAR testnet" }, + phala: { x: 0, y: 676, w: 172, h: 54, title: "Phala TEE", sub: ["Explorer"] }, + reg: { x: 188, y: 676, w: 172, h: 54, title: "Mind registry", sub: ["hellonear-registry"], mono: true }, + }; + const ME = [ + { from: "web", fs: "b", to: "be", ts: "t" }, + { from: "tg", fs: "b", to: "be", ts: "t", label: "chat, approve" }, + { from: "be", fs: "b", to: "agent", ts: "t", label: "config + skills" }, + { from: "agent", fs: "r", to: "tools", ts: "l" }, + { from: "wf", fs: "t", to: "tools", ts: "b" }, + { from: "agent", fs: "b", to: "nai", ts: "t", label: "model calls", t: 0.72 }, + { from: "tools", fs: "r", to: "intents", ts: "t", tf: 0.88, k1: 22, k2: 70 }, + { from: "ol", fs: "r", to: "near", ts: "l" }, + ]; + const MG = [ + { x: 10, y: 206, w: 340, h: 176, label: "Engine (Mastra 1.81)", end: true }, + { x: -6, y: 586, w: 372, h: 152, label: "Wallet, proofs and registry (from the backend)" }, + ]; + return ( +
+ + +
+ ); +}; + +// "One payment, call by call": the Mermaid sequence diagram, drawn. Desktop: actor columns with arrows +// between them. Phones: the same steps as a timeline (six columns don't fit a phone's width). +const ACTORS = ["Owner", "Mind", "NEAR AI Cloud", "Backend", "OutLayer", "NEAR testnet"]; +const STEPS = [ + { f: 0, t: 1, text: '"Pay 0.01 NEAR to alice.testnet"' }, + { f: 1, t: 2, text: "model call (streamed)" }, + { f: 2, t: 1, text: "tool call near_view_account", back: true }, + { f: 1, t: 5, text: "RPC view_account alice.testnet" }, + { f: 5, t: 1, text: "account exists", back: true }, + { f: 2, t: 1, text: "tool call send_payment", back: true }, + { note: 1, text: "requireApproval: the run pauses (unless an owner rule covers it)" }, + { f: 1, t: 0, text: "approval card: amount, recipient, checks", back: true }, + { f: 0, t: 3, text: "Approve" }, + { f: 3, t: 1, text: "resume the run" }, + { f: 1, t: 3, text: "/internal/v1/wallet/send_payment (wallet token)" }, + { f: 3, t: 4, text: "transfer request" }, + { alt: "Inside the policy" }, + { f: 4, t: 5, text: "signed transfer" }, + { f: 5, t: 4, text: "tx hash", back: true }, + { f: 4, t: 1, text: "sent + txHash", back: true }, + { alt: "Over the limit, not on the list, or frozen", bad: true }, + { f: 4, t: 1, text: "policy_denied / wallet_frozen, no tx", back: true, bad: true }, + { end: true }, + { f: 1, t: 0, text: 'receipt (or "refused before signing")', back: true }, + { f: 1, t: 2, text: "fetch signatures + attestation" }, + { note: 1, text: "run.verified: the badge shows only if every step matches the attested key" }, +]; + +export const PaymentSteps = () => { + // Step numbers sit in a column of their own on the left; the actors start after it. + const W = 800; + const gutter = 40; + const colX = (i) => gutter + 64 + i * 128; + const row = 34; + let y = 60; + const rows = STEPS.map((s) => { + const r = { s, y }; + y += s.end ? 14 : s.alt ? 28 : row; + return r; + }); + const height = y + 16; + // The two ways a payment can go, framed like a sequence diagram's "alt" block. + const altStart = rows.find((r) => r.s.alt && !r.s.bad); + const altElse = rows.find((r) => r.s.alt && r.s.bad); + const altEnd = rows.find((r) => r.s.end); + let n = 0; + return ( +
+ + {ACTORS.map((a, i) => ( + + + + + {a} + + + ))} + {altStart && altEnd ? ( + + + {altElse ? : null} + + ) : null} + {rows.map(({ s, y }, i) => { + if (s.end) return null; + if (s.alt) + return ( + + {s.bad ? "Otherwise: " : ""} + {s.alt} + + ); + if (s.note !== undefined) + return ( + + + + {s.text} + + + ); + n += 1; + const x1 = colX(s.f), x2 = colX(s.t), dir = x2 > x1 ? 1 : -1, yy = y + 24; + // The label sits over its arrow, kept inside the drawing when the arrow is short. + const w = s.text.length * 5.7; + const cx = Math.min(W - 6 - w / 2, Math.max(gutter + 8 + w / 2, (x1 + x2) / 2)); + return ( + + + + {n} + + + + + + {s.text} + + + ); + })} + +
    + {STEPS.filter((s) => !s.end).map((s, i) => + s.alt ? ( +
  1. + {s.bad ? "Otherwise: " : ""} + {s.alt} +
  2. + ) : s.note !== undefined ? ( +
  3. + {s.text} +
  4. + ) : ( +
  5. + {ACTORS[s.f]} + + {"→"} + + {ACTORS[s.t]} + {s.text} +
  6. + ) + )} +
+
+ ); +}; diff --git a/apps/docs/style.css b/apps/docs/style.css new file mode 100644 index 0000000..fb91d12 --- /dev/null +++ b/apps/docs/style.css @@ -0,0 +1,153 @@ +/* Mintlify loads every .css file in this folder on every page. + + Quiet scrollbars, the same as apps/fe and the status page: a thin rounded thumb, no arrows, no track + (Ancung, 13 Nov: the system bar on Windows had arrows and a grey track). Chrome and Safari use + ::-webkit-scrollbar; setting scrollbar-width there makes Chrome fall back to the system bar, so only + Firefox gets those. Mintlify's dark mode puts `dark` on . */ +:root { + --hn-scrollbar-thumb: rgb(22 22 20 / 0.22); + --hn-scrollbar-thumb-hover: rgb(22 22 20 / 0.38); +} +html.dark { + --hn-scrollbar-thumb: rgb(242 241 236 / 0.22); + --hn-scrollbar-thumb-hover: rgb(242 241 236 / 0.38); +} +::-webkit-scrollbar { + width: 6px; + height: 6px; +} +::-webkit-scrollbar-track, +::-webkit-scrollbar-corner { + background: transparent; +} +::-webkit-scrollbar-button { + display: none; +} +::-webkit-scrollbar-thumb { + border-radius: 9999px; + background: var(--hn-scrollbar-thumb); +} +::-webkit-scrollbar-thumb:hover { + background: var(--hn-scrollbar-thumb-hover); +} +@supports (-moz-appearance: none) { + * { + scrollbar-width: thin; + scrollbar-color: var(--hn-scrollbar-thumb) transparent; + } +} + +/* The diagrams on "How it works" (snippets/how-it-works.jsx): SVG nodes and curved links, in the app's + Stone & Lime. HelloNear's own parts get a lime tint, outside services stay plain. */ +:root { + --hn-node: #ffffff; + --hn-node-line: #e0ded6; + --hn-ours: #f6fadf; + --hn-ours-line: #c4d968; + --hn-text: #161614; + --hn-sub: #5c5a54; + --hn-edge: #b9b6ad; + --hn-dot: #5b7a00; + --hn-pill: #f3f2ee; + --hn-group: rgb(22 22 20 / 0.03); + --hn-group-line: #d6d3c9; + --hn-bad: #bf3220; +} +html.dark { + --hn-node: #1a1a18; + --hn-node-line: #2e2e2b; + --hn-ours: rgb(216 240 74 / 0.07); + --hn-ours-line: rgb(216 240 74 / 0.35); + --hn-text: #f2f1ec; + --hn-sub: #a6a39b; + --hn-edge: #4c4b46; + --hn-dot: #d8f04a; + --hn-pill: #11110f; + --hn-group: rgb(242 241 236 / 0.025); + --hn-group-line: #2e2e2b; + --hn-bad: #ff6a55; +} +.hn-diagram { margin: 24px 0 8px; } +.hn-canvas { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; } +.hn-node { fill: var(--hn-node); stroke: var(--hn-node-line); stroke-width: 1; } +.hn-ours { fill: var(--hn-ours); stroke: var(--hn-ours-line); } +.hn-title { fill: var(--hn-text); font-size: 13px; font-weight: 600; } +.hn-sub { fill: var(--hn-sub); font-size: 11px; } +.hn-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; } +.hn-edge { fill: none; stroke: var(--hn-edge); stroke-width: 1.5; } +.hn-dashed { stroke-dasharray: 4 4; } +.hn-head { fill: none; stroke: var(--hn-edge); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; } +.hn-dot { fill: var(--hn-dot); } +.hn-pill { fill: var(--hn-pill); stroke: var(--hn-node-line); stroke-width: 1; } +.hn-label { fill: var(--hn-sub); font-size: 10.5px; font-weight: 500; } +.hn-group { fill: var(--hn-group); stroke: var(--hn-group-line); stroke-width: 1; stroke-dasharray: 5 5; } +.hn-glabel { fill: var(--hn-sub); font-size: 11px; font-weight: 600; } +.hn-life { stroke: var(--hn-node-line); stroke-width: 1; stroke-dasharray: 3 5; } +.hn-num { fill: var(--hn-node); stroke: var(--hn-edge); stroke-width: 1; } +.hn-numtext { fill: var(--hn-sub); font-size: 9.5px; font-weight: 600; } +.hn-note { fill: var(--hn-ours); stroke: var(--hn-ours-line); stroke-width: 1; } +.hn-notetext { fill: var(--hn-text); font-size: 11px; font-weight: 500; } +.hn-alt { fill: var(--hn-sub); font-size: 11px; font-weight: 600; } +.hn-alt.hn-bad, .hn-steps .hn-bad { fill: var(--hn-bad); color: var(--hn-bad); } +.hn-badline { stroke: var(--hn-bad); } +.hn-label.hn-bad { fill: var(--hn-bad); } +.hn-start { fill: var(--hn-edge); } +.hn-badfill { fill: var(--hn-bad); } +.hn-frame { fill: var(--hn-group); stroke: var(--hn-group-line); stroke-width: 1; stroke-dasharray: 5 5; } +.hn-frame-split { stroke: var(--hn-group-line); stroke-width: 1; stroke-dasharray: 5 5; } +@media (prefers-reduced-motion: reduce) { .hn-dot { display: none; } } + +/* Desktop gets the wide drawing, phones the narrow one (or the step list). */ +.hn-diagram .hn-narrow { display: none; } +@media (max-width: 767px) { + .hn-diagram .hn-wide { display: none; } + .hn-diagram .hn-narrow { display: block; } + .hn-diagram .hn-steps.hn-narrow { display: flex; } +} + +/* "One payment, call by call" on phones: one step per line, who to whom as two chips. */ +.hn-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: hn; } +.hn-step { counter-increment: hn; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 30px; position: relative; } +.hn-step::before { content: counter(hn); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 999px; border: 1px solid var(--hn-edge); color: var(--hn-sub); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; } +.hn-chip { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--hn-node); border: 1px solid var(--hn-node-line); color: var(--hn-text); } +.hn-chip-ours { background: var(--hn-ours); border-color: var(--hn-ours-line); } +.hn-arrow { color: var(--hn-sub); font-size: 12px; } +.hn-steptext { flex-basis: 100%; font-size: 14px; color: var(--hn-text); } +.hn-steps-alt { font-size: 12px; font-weight: 600; color: var(--hn-sub); padding-top: 4px; } +.hn-steps-note { font-size: 13px; color: var(--hn-text); background: var(--hn-ours); border: 1px solid var(--hn-ours-line); border-radius: 10px; padding: 8px 12px; } + +/* Tech stack: each technology's logo left of its name, where the README has one (Ancung, 13 Nov). The logo + sits in a box of fixed width, so every name starts at the same place, rows without a logo included + (hn-logo-space), and a name that wraps keeps that line (a hanging indent). Dark mode swaps in the white + versions; NEAR AI's black mark is inverted. */ +.hn-tech td:first-child { padding-left: 96px !important; text-indent: -84px; } +.hn-logo, .hn-logo-space { display: inline-block; width: 72px; height: 18px; margin: 0 8px 0 0; vertical-align: -4px; text-indent: 0; } +.hn-logo { object-fit: contain; object-position: left center; } +.hn-word { height: 16px; vertical-align: -3px; } +.hn-mark { height: 22px; vertical-align: -6px; } +.hn-on-dark { display: none; } +html.dark .hn-on-light { display: none; } +html.dark .hn-on-dark { display: inline-block; } +html.dark .hn-invert { filter: invert(1); } +/* Phones: no room for a logo column, so the logo sits above the name and the spacer goes. */ +@media (max-width: 767px) { + .hn-tech td:first-child { padding-left: 12px !important; text-indent: 0; } + .hn-logo-space { display: none; } + .hn-logo { display: block; margin: 0 0 6px; } + .hn-logo.hn-on-dark { display: none; } + html.dark .hn-logo.hn-on-light { display: none; } + html.dark .hn-logo.hn-on-dark { display: block; } +} + +/* Icon tables (The agent's skills, Connectors' apps): a small square icon left of the name, so a narrow + box (24 px) instead of the logos' 72, kept on the left on phones too. */ +.hn-icons td:first-child { padding-left: 48px !important; text-indent: -36px; } +.hn-icons .hn-logo, .hn-icons .hn-logo-space { width: 24px; height: 24px; margin-right: 8px; vertical-align: -7px; } +@media (max-width: 767px) { + .hn-icons td:first-child { padding-left: 48px !important; text-indent: -36px; } + .hn-icons .hn-logo, .hn-icons .hn-logo-space { display: inline-block; margin: 0 8px 0 0; } +} + +/* Two-column tables of labels and values have no column titles: hide their empty header row instead of + showing a blank band (Introduction, The six tracks, Contracts). */ +table thead:not(:has(th:not(:empty))) { display: none; } diff --git a/apps/docs/tech-stack.mdx b/apps/docs/tech-stack.mdx index ff8b658..259ec3b 100644 --- a/apps/docs/tech-stack.mdx +++ b/apps/docs/tech-stack.mdx @@ -3,27 +3,33 @@ title: "Tech stack" description: "What is used where: NEAR, NEAR AI Cloud, NEAR Intents, OutLayer, Mastra and the rest." --- -| | Technology | Where in the repo | What it does in HelloNear | -|---|---|---|---| -| | **NEAR Protocol** (testnet) | `sc/`, `apps/be/src/auth.ts`, `apps/be/src/wallets.ts` | The Mind registry contract (Minds, published skills, `equip_skill` pays the publisher); NEP-413 sign-in; every payment, policy change and freeze is a NEAR transaction | -| | **NEAR AI Cloud** | `engine/src/models.ts`, `engine/src/verify.ts`, `engine/src/titles.ts` | Runs every model call inside a TEE; HelloNear checks each reply's signature against the attestation before the Verified badge, and keeps the proof | -| | **NEAR Intents** (1Click API + official SDK) | `engine/src/crosschain.ts` | Cross-chain USDC/USDT quotes from NEAR to other chains; each quote's 1Click signature is verified with `verifyQuoteSignature` | -| | **NEAR AI Agent Market** ([market.near.ai](https://market.near.ai)) | `engine/src/market.ts`, skill `agent-market` | Searches the public catalog of agents and gets a job's exact price from the agent's own x402 answer (A2A, unpaid), then picks the cheapest within the owner's budget; hiring is paid in USDC on mainnet, so it only quotes for now | -| | **Swarm auction contract** (`near-sdk`, testnet) | `sc/swarm` | Sealed-bid group buying between agents, each its own sub-account; deployed at `auction.hellonear-swarm.testnet`, source verified | -| | **OutLayer** (testnet) | `apps/be/src/wallets.ts`, `apps/be/src/payments.ts` | One wallet per Mind; its policy (per-payment limit, daily limit, allowed recipients) is stored on chain and checked in a TEE before anything is signed; freeze | -| | **Meteor Wallet** via **NEAR Connect** | `apps/fe` | The owner's wallet: signs in, signs the Mind wallet's policy, adds funds, freezes. Other NEAR Connect wallets work too | -| | **FastNear** testnet RPC | `engine/src/tools.ts`, `apps/be/src/config.ts` | Account lookups before a payment (`view_account`) and transfer checks after one (`tx`) | -| | **Phala TEE Attestation Explorer** | `apps/be/src/teeExplorer.ts` | Checks the Intel TDX quote behind a reply; the app opens its VERIFIED report | -| | **Mastra** 1.81 | `engine/` | The agent: one generic Mind agent, tools, approvals (`requireApproval`, per-call rules, `beforeApproval`), memory, context limits, dynamic workflows for the Builder, workflow schedules for Autopilot | -| | **GLM-5.3 Flash** (Z.ai), **DeepSeek V4.1 Flash**, **Qwen3 Embedding** | `engine/src/config.ts`, `engine/src/models.ts` | Chat, reasoning and memory embeddings, all served by NEAR AI Cloud | -| | **Composio** | `apps/be/src/connections.ts`, `engine/src/composio.ts`, `engine/src/apps.ts`, `engine/src/calendar.ts`, `engine/src/zoom.ts` | The owner connects Gmail, Google Calendar, Meet, Sheets, Drive, Docs, Notion, Slack, Outlook and Zoom with OAuth (backend: Connect Links); the engine runs the app tools in a session scoped to that one owner | -| | **AgentMail** | `apps/be/src/mail.ts`, `engine/src/mail.ts` | Each Mind's own email address (`…@agentmail.to`): send after approval, read its inbox with spam and phishing warnings, email the owner | -| | **Telegram Bot API** | `apps/be/src/telegram.ts`, `apps/be/src/telegramFormat.ts` | A bot per Mind: chat, streamed replies, Approve / Decline buttons; only the owner's chat is answered | -| | **Postgres 17 + pgvector** | `apps/be/migrations/`, `engine/src/mastra.ts` | Runs, events, approvals, encrypted secrets (backend); Mastra storage, run snapshots and memory vectors (engine) | -| | **Next.js 16, React 19, GSAP, React Flow** | `apps/fe`, `apps/landing` | The web app (chat, live view, Builder canvas, wallet, settings) and the landing page | -| | **Rust, `near-sdk` 5.29, `near-sandbox`** | `sc/` | The registry contract and its sandbox tests, including upgrades | -| | **Bun, Node 24, k6** | every package | Package manager and runtime; load tests | -| | **Proxmox LXC + Cloudflare Tunnel** | `deploy/` | The hosted demo; a merged `main` is deployed automatically after its CI passes | +## What is used where + +
+ +| Technology | Where in the repo | What it does in HelloNear | +|---|---|---| +| **NEAR Protocol** (testnet) | `sc/`, `apps/be/src/auth.ts`, `apps/be/src/wallets.ts` | The Mind registry contract (Minds, published skills, `equip_skill` pays the publisher); NEP-413 sign-in; every payment, policy change and freeze is a NEAR transaction | +| **NEAR AI Cloud** | `engine/src/models.ts`, `engine/src/verify.ts`, `engine/src/titles.ts` | Runs every model call inside a TEE; HelloNear checks each reply's signature against the attestation before the Verified badge, and keeps the proof | +| **NEAR Intents** (1Click API + official SDK) | `engine/src/crosschain.ts` | Cross-chain USDC/USDT quotes from NEAR to other chains; each quote's 1Click signature is verified with `verifyQuoteSignature` | +| **NEAR AI Agent Market** ([market.near.ai](https://market.near.ai)) | `engine/src/market.ts`, skill `agent-market` | Searches the public catalog of agents and gets a job's exact price from the agent's own x402 answer (A2A, unpaid), then picks the cheapest within the owner's budget; hiring is paid in USDC on mainnet, so it only quotes for now | +| **Swarm auction contract** (`near-sdk`, testnet) | `sc/swarm` | Sealed-bid group buying between agents, each its own sub-account; deployed at `auction.hellonear-swarm.testnet`, source verified | +| **OutLayer** (testnet) | `apps/be/src/wallets.ts`, `apps/be/src/payments.ts` | One wallet per Mind; its policy (per-payment limit, daily limit, allowed recipients) is stored on chain and checked in a TEE before anything is signed; freeze | +| **Meteor Wallet** via **NEAR Connect** | `apps/fe` | The owner's wallet: signs in, signs the Mind wallet's policy, adds funds, freezes. Other NEAR Connect wallets work too | +| **FastNear** testnet RPC | `engine/src/tools.ts`, `apps/be/src/config.ts` | Account lookups before a payment (`view_account`) and transfer checks after one (`tx`) | +| **Phala TEE Attestation Explorer** | `apps/be/src/teeExplorer.ts` | Checks the Intel TDX quote behind a reply; the app opens its VERIFIED report | +| **Mastra** 1.81 | `engine/` | The agent: one generic Mind agent, tools, approvals (`requireApproval`, per-call rules, `beforeApproval`), memory, context limits, dynamic workflows for the Builder, workflow schedules for Autopilot | +| **GLM-5.3 Flash** (Z.ai), **DeepSeek V4.1 Flash**, **Qwen3 Embedding** | `engine/src/config.ts`, `engine/src/models.ts` | Chat, reasoning and memory embeddings, all served by NEAR AI Cloud | +| **Composio** | `apps/be/src/connections.ts`, `engine/src/composio.ts`, `engine/src/apps.ts`, `engine/src/calendar.ts`, `engine/src/zoom.ts` | The owner connects Gmail, Google Calendar, Meet, Sheets, Drive, Docs, Notion, Slack, Outlook and Zoom with OAuth (backend: Connect Links); the engine runs the app tools in a session scoped to that one owner | +| **AgentMail** | `apps/be/src/mail.ts`, `engine/src/mail.ts` | Each Mind's own email address (`…@agentmail.to`): send after approval, read its inbox with spam and phishing warnings, email the owner | +| **Telegram Bot API** | `apps/be/src/telegram.ts`, `apps/be/src/telegramFormat.ts` | A bot per Mind: chat, streamed replies, Approve / Decline buttons; only the owner's chat is answered | +| **Postgres 17 + pgvector** | `apps/be/migrations/`, `engine/src/mastra.ts` | Runs, events, approvals, encrypted secrets (backend); Mastra storage, run snapshots and memory vectors (engine) | +| **Next.js 16, React 19, GSAP, React Flow** | `apps/fe`, `apps/landing` | The web app (chat, live view, Builder canvas, wallet, settings) and the landing page | +| **Rust, `near-sdk` 5.29, `near-sandbox`** | `sc/` | The registry contract and its sandbox tests, including upgrades | +| **Bun, Node 24, k6** | every package | Package manager and runtime; load tests | +| **Proxmox LXC + Cloudflare Tunnel** | `deploy/` | The hosted demo; a merged `main` is deployed automatically after its CI passes | + +
--- diff --git a/apps/docs/title.js b/apps/docs/title.js new file mode 100644 index 0000000..8893227 --- /dev/null +++ b/apps/docs/title.js @@ -0,0 +1,15 @@ +// Mintlify loads every .js file in this folder on every page. Its tab titles read "Page - HelloNear" and +// docs.json has no setting for the separator, so this rewrites them as "Page | HelloNear", like the web +// app's "Chat | HelloNear" (Ancung, 13 Nov). Only the browser tab changes: what the server sends (search +// engines, link previews) keeps Mintlify's own title. It runs again whenever Mintlify changes the title +// on a page change. +(function () { + var SUFFIX = " - HelloNear"; + var fix = function () { + var t = document.title; + if (t.slice(-SUFFIX.length) === SUFFIX) document.title = t.slice(0, -SUFFIX.length) + " | HelloNear"; + }; + fix(); + var head = document.querySelector("head"); + if (head) new MutationObserver(fix).observe(head, { subtree: true, childList: true, characterData: true }); +})();