@nyxon/nasim-mcp 0.0.0-stage → 0.14.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/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@nyxon/nasim-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.14.0",
4
+ "description": "An MCP server for Nasim (@nyxon/nasim): its parts, props, examples, guides and rules, offline, plus a check of a screen's code against those rules.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "nasim-mcp": "./lib/bin.js"
9
+ },
10
+ "exports": {
11
+ ".": {
12
+ "types": "./lib/server.d.ts",
13
+ "default": "./lib/server.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "lib",
18
+ "manifest.json",
19
+ "skill",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "homepage": "https://nasim.nyxon.tech/docs/get-started/agents",
27
+ "keywords": [
28
+ "mcp",
29
+ "model-context-protocol",
30
+ "nasim",
31
+ "react",
32
+ "rtl",
33
+ "persian"
34
+ ],
35
+ "dependencies": {
36
+ "@babel/parser": "7.29.8",
37
+ "@modelcontextprotocol/sdk": "1.30.0",
38
+ "zod": "3.25.76"
39
+ }
40
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: nasim
3
+ description: How to build a screen with @nyxon/nasim, the React UI library for right-to-left, Persian-first dashboards on HeroUI 3 and React Aria. Use before writing or reviewing any screen, form, table, dialog or state that imports @nyxon/nasim.
4
+ ---
5
+
6
+ # Building with Nasim
7
+
8
+ Generated from the Nasim docs for @nyxon/nasim 0.14.0. The docs are the
9
+ contract: open the page of every part you use before you call its props right or wrong.
10
+
11
+ ## The rules
12
+
13
+ 1. Import every part from `@nyxon/nasim`; never import `@heroui/react` or `react-aria-components` in an app.
14
+ 2. Every visible string is a prop, from the screen’s own strings module: no literal text, `aria-label`, `placeholder`, `title` or `alt` in JSX.
15
+ 3. Colours, radii and fonts are Nasim’s Tailwind v4 tokens (`bg-surface`, `text-muted`, `border-border`); no hex values and no `dark:` utilities.
16
+ 4. Layout is logical (`ms-*`, `pe-*`, `text-start`), except the safe areas (`px-safe`, `px-page`); ids, links and card numbers get `dir="ltr"` and `font-mono`.
17
+ 5. The page is `<html lang="fa" dir="rtl">` inside one `NasimApp` (`NasimProvider` before it), the only theme controller.
18
+
19
+ The reason for each, and the rest: https://nasim.nyxon.tech/llms.mdx/docs/get-started/rules.md.
20
+
21
+ ## Which part for which job
22
+
23
+ | Job | Part | Import | What it is |
24
+ | --- | --- | --- | --- |
25
+ | The frame of a dashboard | `AppShell` | `import { AppShell } from '@nyxon/nasim';` | The frame of a dashboard, a sidebar on a desktop, a drawer and an optional tab bar on a phone, and the page in main, clear of the safe areas. |
26
+ | The heading of a page | `PageHeader` | `import { PageHeader } from '@nyxon/nasim';` | The heading of a page or a section, with its description, a status line, the way back and the actions. |
27
+ | A titled block of a page | `SectionCard` | `import { SectionCard } from '@nyxon/nasim';` | A card with a titled header and a body, a section named by its own heading; server-renderable. |
28
+ | A box on the page | `Card`, `Surface` | `import { Card, Surface } from '@nyxon/nasim';` | HeroUI's Card with its header, content and footer slots, and Surface, a plain box in the surface colours. |
29
+ | Content wider than the screen | `ScrollRegion` | `import { ScrollRegion } from '@nyxon/nasim';` | A box for content wider than the screen, which scrolls sideways and is a named keyboard stop only while it does. |
30
+ | A line between groups | `Separator` | `import { Separator } from '@nyxon/nasim';` | HeroUI's divider between groups of content, horizontal or vertical, announced or decorative. |
31
+ | Sibling pages under one entry | `NavTabs` | `import { NavTabs } from '@nyxon/nasim';` | Sibling pages under one menu entry, switched with a bar that looks like tabs; each tab is a link to its own page. |
32
+ | Panels on one page | `Tabs` | `import { Tabs } from '@nyxon/nasim';` | Tabs on React Aria for panels on one page, controlled or not, with Persian names for the buttons that scroll a long list. |
33
+ | The trail to the page | `Breadcrumbs` | `import { Breadcrumbs } from '@nyxon/nasim';` | The trail from the root to the page on screen, in reading order with the last step as the page itself. |
34
+ | The signed-in person and their menu | `AccountMenu` | `import { AccountMenu } from '@nyxon/nasim';` | The signed-in person as one button, a photo or an initial with a name and a line, opening a menu of what they can do. |
35
+ | Light or dark | `ThemeToggle` | `import { ThemeToggle } from '@nyxon/nasim';` | A round icon button that flips light and dark, and hands the choice back to the device when that is what it shows anyway. |
36
+ | A link in text | `Link` | `import { Link } from '@nyxon/nasim';` | HeroUI's link on React Aria, navigating in the app through the provider's router and leaving external addresses alone. |
37
+ | An action on the page | `Button` | `import { Button } from '@nyxon/nasim';` | HeroUI's button, re-exported through Nasim with its variants, sizes and pending state. |
38
+ | A link that looks like a button | `LinkButton` | `import { LinkButton } from '@nyxon/nasim';` | A link that looks like a button and moves inside the app through NasimApp's router. |
39
+ | Related buttons joined | `Button`, `ButtonGroup` | `import { Button, ButtonGroup } from '@nyxon/nasim';` | HeroUI's group that joins related buttons into one shape, horizontal or vertical, with one variant and size for all. |
40
+ | A menu of actions | `Dropdown`, `Label` | `import { Dropdown, Label } from '@nyxon/nasim';` | HeroUI's menu behind a trigger, registered as a layer while open so the host's Back closes it first. |
41
+ | Put something away | `CloseButton` | `import { CloseButton } from '@nyxon/nasim';` | HeroUI's small close button, named «بستن» in Persian, for a box of your own that can be put away. |
42
+ | A list of records to page through | `DataTable` | `import { DataTable } from '@nyxon/nasim';` | A list a person pages through: columns, every state of its request, selection across pages, cards on a phone, sorting and two keyboard modes. |
43
+ | Narrow, order and refresh a list | `ListToolbar` | `import { ListToolbar } from '@nyxon/nasim';` | The bar above a list: a search, status tabs, filters, facets, sort, columns, the refresh control and the primary action, each a member the screen picks. |
44
+ | Move through the pages of a list | `DataTable`, `Pager` | `import { DataTable, Pager } from '@nyxon/nasim';` | The pages of a list: DataTable's pagination in its four forms (page count, numbered, cursor, load more), Pager on its own, and pages as links. |
45
+ | Act on the chosen rows | `ActionBar` | `import { ActionBar } from '@nyxon/nasim';` | The bulk bar: a pill at the bottom of the screen while rows are chosen, with the count, the actions on them and a clear button. |
46
+ | The actions of one row | `RowActions` | `import { RowActions } from '@nyxon/nasim';` | The kebab of a row: one icon button that opens a menu of what can be done to that row, the dangerous items last. |
47
+ | Search a list | `SearchBox` | `import { SearchBox } from '@nyxon/nasim';` | A search field for filtering a list outside a form, named for a screen reader, with a clear button and Enter to search. |
48
+ | Pick one of a few filters | `FilterChips` | `import { FilterChips } from '@nyxon/nasim';` | One of a few filters, always one chosen: a group of toggle chips that wrap on a narrow screen. |
49
+ | A read-only table on a server-rendered page | `StaticTable` | `import { StaticTable } from '@nyxon/nasim';` | Read-only rows a Server Component draws with no client JavaScript, with headers that sort by link. |
50
+ | The fields of one record | `KeyValueList` | `import { KeyValueList } from '@nyxon/nasim';` | The fields of one record as labels and values: split, stacked or in two columns, server-renderable. |
51
+ | Put a short list in order | `SortableList` | `import { SortableList } from '@nyxon/nasim';` | A short list a person puts in order by dragging, or with an up and a down button on every row. |
52
+ | A secret or an id to copy | `CopyButton`, `CopyField`, `CopyText` | `import { CopyButton, CopyField, CopyText } from '@nyxon/nasim';` | Values to copy to the clipboard: a whole field, a button beside your own value, or an id inline with a small button. |
53
+ | A key figure | `Sparkline`, `StatCard`, `TrendChip` | `import { Sparkline, StatCard, TrendChip } from '@nyxon/nasim';` | A key figure with its scope, a trend against the last period and its shape; a tile that can also filter the list under it. |
54
+ | Used of a quota | `Meter`, `ProgressBar`, `UsageBar` | `import { Meter, ProgressBar, UsageBar } from '@nyxon/nasim';` | How much of an allowance is used, with a warning and a danger threshold and unlimited plans; HeroUI's Meter and ProgressBar under it. |
55
+ | The shape of a series beside its figure | `Sparkline` | `import { Sparkline } from '@nyxon/nasim';` | A tiny line of a series with no axes and no text: the shape only, beside the figure that carries the number. |
56
+ | Compare a value across categories or days | `BarTable`, `ColumnChart` | `import { BarTable, ColumnChart } from '@nyxon/nasim';` | A value per category in plain SVG and HTML: columns with a tooltip and a table behind them, or a table whose rows carry bars. |
57
+ | A time series, or this period against the last | `AreaChart` | `import { AreaChart } from '@nyxon/nasim';` | A time series of one or two periods in plain SVG and HTML: a keyboard and a tooltip move between steps, and every figure is in a table. |
58
+ | Options most people skip | `Collapsible` | `import { Collapsible } from '@nyxon/nasim';` | Advanced or rarely used options in a native details element, which opens and closes with no client JavaScript. |
59
+ | Sections that expand | `Disclosure`, `DisclosureGroup` | `import { Disclosure, DisclosureGroup } from '@nyxon/nasim';` | HeroUI's expandable sections on React Aria, alone or in a group that opens one at a time. |
60
+ | A card's picture | `Cover` | `import { Cover } from '@nyxon/nasim';` | A 16:9 picture box that keeps its shape with or without the picture, drawing the kind of thing on a placeholder. |
61
+ | A card number to pay into | `BankCard` | `import { BankCard } from '@nyxon/nasim';` | A card number drawn as a bank card for a card-to-card payment, with its bank, its holder and a button that copies the digits. |
62
+ | One of a few rich choices | `OptionCards` | `import { OptionCards } from '@nyxon/nasim';` | One of a few choices that need more than a word each, as a radio group of tappable cards; controlled, or bound by name in a form. |
63
+ | A step in a short flow | `Stepper` | `import { Stepper } from '@nyxon/nasim';` | Where the person is in a flow of a few steps, as a bar for the eye and the same in words. |
64
+ | A keyboard shortcut | `Kbd` | `import { Kbd } from '@nyxon/nasim';` | A keyboard shortcut in key caps, left to right, with each named key's Persian name for a screen reader. |
65
+ | A short label | `Chip` | `import { Chip } from '@nyxon/nasim';` | HeroUI's chip, a short label on a soft or solid fill, for a tag that is not a status. |
66
+ | A person's photo, and a count on it | `Avatar`, `Badge` | `import { Avatar, Badge } from '@nyxon/nasim';` | HeroUI's avatar, a photo or an initial, and its badge, a count or a dot placed on it with Badge.Anchor. |
67
+ | A receipt to read closely | `ImageViewer` | `import { ImageViewer } from '@nyxon/nasim';` | A full-screen viewer for a receipt photo or a PDF, with zoom, rotation, panning and the app's own download. |
68
+ | A status | `StatusChip` | `import { StatusChip } from '@nyxon/nasim';` | A status as an icon and words on a soft tint, never colour alone. |
69
+ | A notice on the page | `Notice` | `import { Notice } from '@nyxon/nasim';` | An inline message with its icon, a title and the words, in one of five tones. |
70
+ | A message with a layout of its own | `Alert` | `import { Alert } from '@nyxon/nasim';` | HeroUI's alert with its indicator, title and description slots, for a message Notice does not lay out. |
71
+ | What just happened | `toast` | `import { toast } from '@nyxon/nasim';` | A short message about what just happened, raised from code and shown in the region the provider mounts. |
72
+ | The connection is down | `OfflineBanner`, `useOnline` | `import { OfflineBanner, useOnline } from '@nyxon/nasim';` | A polite strip above the page while the connection is down, and the same fact as a boolean. |
73
+ | Nothing to show | `EmptyState` | `import { EmptyState } from '@nyxon/nasim';` | Nothing to show yet, said in words, with the next step as a button or a link. |
74
+ | A failure | `ErrorState` | `import { ErrorState } from '@nyxon/nasim';` | A view that failed to load, what to do about it, a retry that can count down, and a tracking code. |
75
+ | A reply box | `MessageBar` | `import { MessageBar } from '@nyxon/nasim';` | A chat's compact composer, attach, a text box that grows to five lines and a round send button, or a note when the conversation is over. |
76
+ | The name of an icon | `Tooltip` | `import { Tooltip } from '@nyxon/nasim';` | HeroUI's tooltip, a short label shown on hover and focus, mostly for an icon-only button. |
77
+ | Hold a layout still while it loads | `PageSkeleton`, `Skeleton`, `SkeletonRows`, `TableSkeleton` | `import { PageSkeleton, Skeleton, SkeletonRows, TableSkeleton } from '@nyxon/nasim';` | Loading shapes that hold the layout still while data arrives: list rows, a table, a whole screen, or HeroUI's Skeleton for a shape of your own. |
78
+ | Wait for an answer with no shape to show | `LoadingState`, `Spinner` | `import { LoadingState, Spinner } from '@nyxon/nasim';` | A wait with no shape to show yet: a spinner and its words, announced politely, for a page or inside a card; and the Spinner itself. |
79
+ | A dialog | `Modal` | `import { Modal } from '@nyxon/nasim';` | A dialog for a form or a detail, centred on a desktop and a sheet along the bottom of a phone. |
80
+ | A destructive action | `ConfirmDialog` | `import { ConfirmDialog } from '@nyxon/nasim';` | An alert dialog before a destructive or money-moving action, with its impact, a reason and a typed phrase. |
81
+ | A sheet on a phone | `BottomSheet` | `import { BottomSheet } from '@nyxon/nasim';` | A sheet from the bottom edge for choices and short forms, which drags down to close. |
82
+ | A row's detail | `SidePanel` | `import { SidePanel } from '@nyxon/nasim';` | A row's detail and its edit form, a drawer from the inline-end edge on a desktop and a bottom sheet on a phone. |
83
+ | Content beside a trigger | `Popover` | `import { Popover } from '@nyxon/nasim';` | HeroUI's popover, content to read or press beside its trigger, registered as a layer while open. |
84
+ | A form that is validated and saved | `FormFields`, `FormRoot`, `SubmitButton` | `import { FormFields, FormRoot, SubmitButton } from '@nyxon/nasim';` | A form on React Hook Form and Zod: fields bound by name, one press one submission, the server's errors on their fields. |
85
+ | A form posted as FormData | `ActionForm` | `import { ActionForm } from '@nyxon/nasim';` | A form with no form library, posting its fields as FormData to a server action or a handler, checked by the browser in Persian. |
86
+ | A form in a dialog | `FormDialog` | `import { FormDialog } from '@nyxon/nasim';` | A Modal that holds a form; one press one submission, it asks before discarding what was typed, busy until the request ends. |
87
+ | One line of text | `TextField` | `import { TextField } from '@nyxon/nasim';` | One line of text, in a form by name or controlled, with its label, its help and its message tied to the box. |
88
+ | Several lines of text | `TextAreaField` | `import { TextAreaField } from '@nyxon/nasim';` | Several lines of text, for notes and messages; the value is the text as typed, line breaks included. |
89
+ | A quantity | `NumberField` | `import { NumberField } from '@nyxon/nasim';` | A number with − and + steppers, Persian digits shown, the value a number or undefined while the box is empty. |
90
+ | An amount of money | `AmountField` | `import { AmountField } from '@nyxon/nasim';` | Money in toman or rial, grouped as it is typed, said with its unit; the value is a whole number. |
91
+ | A figure shown or read as the fields do | `formatAmount`, `formatFileSize`, `formatNumber`, `parseAmount`, `toLatinDigits`, `toPersianDigits` | `import { formatAmount, formatFileSize, formatNumber, parseAmount, toLatinDigits, toPersianDigits } from '@nyxon/nasim';` | The helpers the fields use, server-safe: parseAmount, formatAmount, formatNumber, toLatinDigits, toPersianDigits, formatFileSize. |
92
+ | One of a list | `SelectField` | `import { SelectField } from '@nyxon/nasim';` | One of a list's options in a closed list, with a Persian placeholder and disabled options; required says so in its name. |
93
+ | Several of a list | `MultiSelect` | `import { MultiSelect } from '@nyxon/nasim';` | Several of a list's options, searched as the person types, with what is chosen shown below as removable tags. |
94
+ | One or several of a few choices | `CheckboxField`, `CheckboxGroupField`, `RadioGroupField` | `import { CheckboxField, CheckboxGroupField, RadioGroupField } from '@nyxon/nasim';` | One of a few choices, any of a few, and one yes or no: each option with its label and a line read with it. |
95
+ | An on/off saved with a form | `SwitchField` | `import { SwitchField } from '@nyxon/nasim';` | An on/off that is saved with the form, with its help and its message under it like any field. |
96
+ | A date, a moment or a range of days | `DateField`, `DateRangeField`, `DateTimeField` | `import { DateField, DateRangeField, DateTimeField } from '@nyxon/nasim';` | Dates in the Persian calendar with Persian digits, held as Gregorian ISO strings a form validates and an API reads. |
97
+ | A secret the server keeps | `SecretField` | `import { SecretField } from '@nyxon/nasim';` | A key, a token or a password the server keeps and never shows again; write-only, with replace and clear. |
98
+ | A mobile number | `PhoneField` | `import { PhoneField } from '@nyxon/nasim';` | An Iranian mobile number, typed or pasted in any form, held in one format, e164 or local. |
99
+ | A one-time code | `CodeField` | `import { CodeField } from '@nyxon/nasim';` | A one-time code in one box, filled from the SMS or a paste, with onComplete once per complete code. |
100
+ | Files to send | `FileField` | `import { FileField } from '@nyxon/nasim';` | Picked or dropped files with their limits said in words, each listed with its size and a remove button; no upload. |
101
+ | A colour chosen by eye | `HexColorPicker` | `import { HexColorPicker } from '@nyxon/nasim';` | A swatch that opens a colour area, a hue slider and ready-made colours, and reports an upper-case |
102
+ | The parts a field is drawn with | `Checkbox`, `Description`, `FieldError`, `Input`, `Label`, `ListBox`, `Select`, `Switch`, `TextArea` | `import { Checkbox, Description, FieldError, Input, Label, ListBox, Select, Switch, TextArea } from '@nyxon/nasim';` | HeroUI's field parts re-exported: Input, TextArea, Label, Description, FieldError, Checkbox, Switch, Select, ListBox; a screen uses the …Field parts instead. |
103
+ | Wrap the app once | `NasimApp` | `import { NasimApp } from '@nyxon/nasim';` | The one provider, with one theme prop, the locale, the router bridge, the palette, the tenant's accent and font, and the toast region. |
104
+ | The first byte of a page | `nasimDocument`, `NasimStyle`, `nasimThemeScript` | `import { nasimDocument, NasimStyle, nasimThemeScript } from '@nyxon/nasim';` | What html and its head need before any client code runs, the attributes, the palette and accent stylesheet and the no-flash script, for a page that renders its own document. |
105
+ | The theme in code | `useTheme` | `import { useTheme } from '@nyxon/nasim';` | The theme controller in code, the mode the person chose, the scheme on screen, and the ways to change them. |
106
+ | A phone layout in code | `useIsNarrow` | `import { useIsNarrow } from '@nyxon/nasim';` | Whether the viewport is narrower than Tailwind's sm or md breakpoint, false on the server and the first render so hydration matches. |
107
+ | Any media query in code | `useMediaQuery` | `import { useMediaQuery } from '@nyxon/nasim';` | HeroUI's hook for any CSS media query, as a boolean that follows it. |
108
+ | The connection in code | `useOnline` | `import { useOnline } from '@nyxon/nasim';` | Whether the device has a connection, as a boolean that follows it; true on the server. |
109
+ | The host's back button | `useNativeBack` | `import { useNativeBack } from '@nyxon/nasim';` | Whether the host app draws its own back button, as Telegram does, so a page draws none. |
110
+ | A bottom bar of your own | `useBottomBar` | `import { useBottomBar } from '@nyxon/nasim';` | A ref for a bar you draw at the bottom of the screen, whose height becomes --nasim-bottom-bar so toasts and the last row rise above it. |
111
+ | The page's title in code | `usePageHeading` | `import { usePageHeading } from '@nyxon/nasim';` | The title the page on screen announced through its h1 PageHeader, so a bar above it need not repeat it. |
112
+ | Close the top layer | `BUSY_ESCAPE_MS`, `useOverlayStack`, `useRegisterOverlay` | `import { BUSY_ESCAPE_MS, useOverlayStack, useRegisterOverlay } from '@nyxon/nasim';` | The stack of open layers, so the host's Back closes the top one first, and the way to put a layer of your own on it. |
113
+ | A layer's open state | `useOverlayState` | `import { useOverlayState } from '@nyxon/nasim';` | HeroUI's open state for one dialog, sheet or popover, with open, close, toggle and setOpen. |
114
+ | Copy from code | `writeClipboard` | `import { writeClipboard } from '@nyxon/nasim';` | Copies a text and says whether it was copied, through the clipboard API or the older path a web view still takes; never throws. |
115
+ | A list whose state survives a reload | `useListUrlState` | `import { useListUrlState } from '@nyxon/nasim/list';` | A list's search, filters, sort and page kept in the address, with the props for the toolbar, the table and the pager, so reload, Back and a shared link bring the list back. |
116
+ | A list inside a dialog or a panel | `useListState` | `import { useListState } from '@nyxon/nasim/list';` | A list's search, filters, sort and page in React state, with the same props and rules as useListUrlState, for a list whose state need not survive a reload. |
117
+ | A list whose rows are all on the client | `localList`, `useLocalList` | `import { localList, useLocalList } from '@nyxon/nasim/list';` | Search, filter, sort and slice rows that are all in memory by a list state's params, returning the page's rows, the total and every match. |
118
+ | A list a Server Component renders | `changeList`, `isListFiltered`, `listHref`, `listSearch`, `parseListParams`, `toggleSort` | `import { changeList, isListFiltered, listHref, listSearch, parseListParams, toggleSort } from '@nyxon/nasim/list';` | A list's state as plain data on the server, read from searchParams, and the link to the same list with one change, with the rules the list hooks use. |
119
+
120
+ Other exports have no page yet; the MCP server's `list_parts` names them.
121
+
122
+ ## Where to read more
123
+
124
+ - The MCP server `@nyxon/nasim-mcp` answers offline for this version: `find_part` for a job,
125
+ `get_part` for a part's page (examples, props), `check_code` on a file once it is written.
126
+ Add it with `{ "command": "npx", "args": ["-y", "@nyxon/nasim-mcp"] }`.
127
+ - Without it: https://nasim.nyxon.tech/llms.txt lists every page as Markdown; https://nasim.nyxon.tech/llms-full.txt is all of
128
+ them in one file.
129
+
130
+ ## Before you call a screen done
131
+
132
+ `check_code` reports no breach, the app's typecheck passes, and the screen has been looked at at 390
133
+ and 1280 px wide, light and dark, with its empty, loading and error states.