@tsrx/mcp 0.0.98 → 0.1.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
@@ -3,7 +3,7 @@
3
3
  "description": "MCP server for TSRX documentation and project context",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.0.98",
6
+ "version": "0.1.0",
7
7
  "type": "module",
8
8
  "repository": {
9
9
  "type": "git",
@@ -37,8 +37,8 @@
37
37
  "@modelcontextprotocol/sdk": "^1.29.0",
38
38
  "prettier": "^3.9.6",
39
39
  "zod": "^4.3.6",
40
- "@tsrx/core": "0.1.71",
41
- "@tsrx/prettier-plugin": "0.3.138"
40
+ "@tsrx/core": "0.2.0",
41
+ "@tsrx/prettier-plugin": "0.4.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^24.3.0",
@@ -11,7 +11,7 @@ export const documentation_sections = [
11
11
  use_cases:
12
12
  'always, introduction, explain tsrx, compare jsx, language model context, runtime targets',
13
13
  content:
14
- '# TSRX Overview\n\nTSRX is a TypeScript language extension for authoring declarative UI in .tsrx files. It adds a small set of syntax forms on top of TypeScript, while letting each target compiler define the runtime semantics.\n\nCore ideas:\n- Components are ordinary TypeScript functions. Use a JSX statement container, `@{ ... }`, when the function body is mostly TSRX setup plus one rendered output.\n- JSXElement, JSXFragment, JSXText, JSXExpressionContainer, attributes, and spreads use the standard JSX node family.\n- A mixed setup/template scope must finish with exactly one output node: a JSXElement, JSXFragment, or JSX control-flow expression. Wrap plain text, expression containers, or multiple siblings in a fragment.\n- Template control flow uses directive expressions: `@if`, `@for`, `@switch`, and `@try`; every directive body uses a `{...}` template block.\n- lazy destructuring uses &[] and &{} for by-reference bindings.\n\nThe core language docs should stay target-neutral. After identifying the active runtime target, use target-specific docs, prompts, or skills for runtime imports, bundler setup, and semantics that are not defined by TSRX itself.\n\nSource: website-tsrx/src/pages/specification.tsrx',
14
+ '# TSRX Overview\n\nTSRX is a TypeScript language extension for authoring declarative UI in .tsrx files. It adds a small set of syntax forms on top of TypeScript, while letting each target compiler define the runtime semantics.\n\nCore ideas:\n- Components are ordinary TypeScript functions. Use a JSX statement container, `@{ ... }`, when the function body is mostly TSRX setup plus one rendered output.\n- JSXElement, JSXFragment, JSXText, JSXExpressionContainer, attributes, and spreads use the standard JSX node family.\n- A mixed setup/template scope must finish with exactly one output node: a JSXElement, JSXFragment, or JSX control-flow expression. Wrap plain text, expression containers, or multiple siblings in a fragment.\n- Template control flow uses directive expressions: `@if`, `@for`, `@switch`, and `@try`; every directive body uses a `{...}` template block.\n\nThe core language docs should stay target-neutral. After identifying the active runtime target, use target-specific docs, prompts, or skills for runtime imports, bundler setup, and semantics that are not defined by TSRX itself.\n\nSource: website-tsrx/src/pages/specification.tsrx',
15
15
  },
16
16
  {
17
17
  slug: 'components',
@@ -45,13 +45,6 @@ export const documentation_sections = [
45
45
  content:
46
46
  '# Control Flow\n\nTemplate control flow uses directive-prefixed expressions inside JSX children.\n\n```tsx\nfunction List({ items }: { items: string[] }) @{\n <>\n @if (items.length === 0) {\n <p>No items</p>\n } @else {\n <ul>\n @for (const item of items.filter(Boolean); index i; key item) {\n <li>{item}</li>\n } @empty {\n <li>No items</li>\n }\n </ul>\n }\n </>\n}\n```\n\nUse normal function returns for guard exits before entering template output. Filter a collection before passing it to `@for` when some items should not render, and use `@empty { ... }` for the no-items fallback.\n\n`return` statements are not template output. Put guard returns before the JSX statement container or return value, or render conditionally with `@if`. Inside TSRX `@if` branches and `@for ... of` loops, direct `continue`, `break`, and `return` statements are invalid. Inside a TSRX `@switch` case body, both `break` and `return` are invalid because cases are isolated template blocks.\n\nTSRX rendering supports `@for ... of` list loops. Regular `for`, `for...in`, `while`, and `do...while` loops are not rendering constructs. Move imperative loops into setup code, a nested function, event handler, effect, or helper where normal JavaScript control-flow rules apply.\n\nSource: website-tsrx/src/pages/features.tsrx#for',
47
47
  },
48
- {
49
- slug: 'lazy-destructuring',
50
- title: 'Lazy Destructuring',
51
- use_cases: 'reactivity, lazy binding, ampersand destructuring, &[], &{}',
52
- content:
53
- '# Lazy Destructuring\n\nTSRX supports lazy binding patterns prefixed with `&`. They bind by reference rather than by value. The target compiler provides the runtime semantics.\n\n```tsx\nlet &[count] = source;\nlet &{ name, age } = props;\n```\n\nThe language defines the syntax and AST shape. Target-specific docs should explain what source values are valid and how reads and writes are lowered for the active runtime.\n\nSpecification grammar:\n\n```text\nLazyAssignmentStatement :\n LazyObjectBindingPattern = AssignmentExpression ;\n LazyArrayBindingPattern = AssignmentExpression ;\n```\n\nSource: website-tsrx/src/pages/specification.tsrx#lazy',
54
- },
55
48
  {
56
49
  slug: 'style-and-server',
57
50
  title: 'Style and Server Extensions',
package/src/server.js CHANGED
@@ -305,7 +305,7 @@ function create_tsrx_task_prompt(options) {
305
305
  1. Identify whether the task is about target-neutral TSRX syntax, target runtime behavior, or both.
306
306
  ${project_context_step}
307
307
  3. For syntax uncertainty, use \`list-sections\`, \`get-documentation\`, or read \`tsrx://docs/{slug}.md\`.
308
- 4. Keep core TSRX advice target-neutral: component functions, JSX expression values, JSX statement containers \`@{ ... }\`, JSX text, directive control flow, lazy destructuring, style identifiers, and submodule declarations.
308
+ 4. Keep core TSRX advice target-neutral: component functions, JSX expression values, JSX statement containers \`@{ ... }\`, JSX text, directive control flow, style identifiers, and submodule declarations.
309
309
  5. Use \`tsrx://targets/{target}.md\` as the handoff point for target-specific responsibilities.
310
310
  5a. In template output, render lists with \`@for (... of ...)\`; filter the iterable before rendering when items should be skipped, and use \`@empty { ... }\` for the no-items fallback; use \`@if\`, \`@switch\`, and \`@try\` for rendering control flow. Every directive body uses a \`{...}\` template block. When a scope mixes setup with output, setup comes first and the scope ends with exactly one JSX element, JSX fragment, or JSX control-flow expression.
311
311
  5b. \`return\` is JavaScript function control flow, not template output. Use guard returns before a JSX statement container or return value, or render conditionally with \`@if\`. Do not use \`continue\`, \`break\`, or \`return\` inside \`@if\` template branches or \`@for\` template loops. \`@switch\` cases are isolated blocks and do not use \`break\` or \`return\`.