@supernal/interface 1.0.12 → 1.0.13
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/dist/cjs/names/Components.js +13 -0
- package/dist/cjs/names/Components.js.map +1 -1
- package/dist/cjs/src/browser.js +6 -2
- package/dist/cjs/src/browser.js.map +1 -1
- package/dist/cjs/src/cli/upgrade.js +305 -0
- package/dist/cjs/src/cli/upgrade.js.map +1 -0
- package/dist/esm/names/Components.d.ts +12 -0
- package/dist/esm/names/Components.d.ts.map +1 -1
- package/dist/esm/names/Components.js +13 -0
- package/dist/esm/names/Components.js.map +1 -1
- package/dist/esm/names/index.d.ts +12 -0
- package/dist/esm/names/index.d.ts.map +1 -1
- package/dist/esm/src/browser.d.ts +2 -0
- package/dist/esm/src/browser.d.ts.map +1 -1
- package/dist/esm/src/browser.js +2 -0
- package/dist/esm/src/browser.js.map +1 -1
- package/dist/esm/src/cli/upgrade.d.ts +17 -0
- package/dist/esm/src/cli/upgrade.d.ts.map +1 -0
- package/dist/esm/src/cli/upgrade.js +270 -0
- package/dist/esm/src/cli/upgrade.js.map +1 -0
- package/package.json +6 -1
- package/src/claude/agents/si-mcp.md +136 -0
- package/src/claude/agents/si-react.md +136 -0
- package/src/claude/agents/si-tools.md +109 -0
- package/src/claude/skills/si-add-provider/SKILL.md +88 -0
- package/src/claude/skills/si-add-tool/SKILL.md +66 -0
- package/src/claude/skills/si-setup-mcp-oss/SKILL.md +115 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: si-add-provider
|
|
3
|
+
description: Create a @ToolProvider class to group related tools. Free and open source.
|
|
4
|
+
argument-hint: "<provider-name> [--tools <tool1,tool2>]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Create Tool Provider
|
|
9
|
+
|
|
10
|
+
Create a `@ToolProvider` class from `@supernal/interface` to group related tools.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
/si-add-provider CounterTools --tools increment,decrement,reset
|
|
16
|
+
/si-add-provider FormTools
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What This Does
|
|
20
|
+
|
|
21
|
+
1. Creates a new ToolProvider class file
|
|
22
|
+
2. Adds @Tool decorated methods
|
|
23
|
+
3. Sets up constructor for dependencies
|
|
24
|
+
4. Shows how to register with InterfaceProvider
|
|
25
|
+
|
|
26
|
+
## Generated Code
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
// src/tools/CounterTools.ts
|
|
30
|
+
import { ToolProvider, Tool } from '@supernal/interface';
|
|
31
|
+
|
|
32
|
+
@ToolProvider()
|
|
33
|
+
export class CounterTools {
|
|
34
|
+
constructor(
|
|
35
|
+
private setCount: React.Dispatch<React.SetStateAction<number>>
|
|
36
|
+
) {}
|
|
37
|
+
|
|
38
|
+
@Tool({ description: 'Increment the counter by one' })
|
|
39
|
+
increment() {
|
|
40
|
+
this.setCount(prev => prev + 1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Tool({ description: 'Decrement the counter by one' })
|
|
44
|
+
decrement() {
|
|
45
|
+
this.setCount(prev => prev - 1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@Tool({ description: 'Reset the counter to zero' })
|
|
49
|
+
reset() {
|
|
50
|
+
this.setCount(0);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage in React
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { InterfaceProvider } from '@supernal/interface/react';
|
|
59
|
+
import { CounterTools } from './tools/CounterTools';
|
|
60
|
+
|
|
61
|
+
function App() {
|
|
62
|
+
const [count, setCount] = useState(0);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<InterfaceProvider tools={[new CounterTools(setCount)]}>
|
|
66
|
+
<Counter count={count} />
|
|
67
|
+
</InterfaceProvider>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Enterprise Tip
|
|
73
|
+
|
|
74
|
+
> For **type-safe component contracts** and **auto-generated tests**, upgrade to enterprise:
|
|
75
|
+
> ```bash
|
|
76
|
+
> npm install @supernalintelligence/interface-enterprise
|
|
77
|
+
> npx si init . --output src/architecture
|
|
78
|
+
> npx si generate-tests --output tests/generated --include-e2e
|
|
79
|
+
> ```
|
|
80
|
+
|
|
81
|
+
## Task
|
|
82
|
+
|
|
83
|
+
Create a @ToolProvider class with the specified name: $ARGUMENTS
|
|
84
|
+
|
|
85
|
+
1. Determine the appropriate location (src/tools/ or similar)
|
|
86
|
+
2. Create the provider class with @Tool methods
|
|
87
|
+
3. Add necessary imports
|
|
88
|
+
4. Show how to register the provider
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: si-add-tool
|
|
3
|
+
description: Add a @Tool decorator to a function to make it AI-controllable. Free and open source.
|
|
4
|
+
argument-hint: "<function-name> [--description <desc>]"
|
|
5
|
+
allowed-tools: Read, Edit, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Add Tool Decorator
|
|
9
|
+
|
|
10
|
+
Add a `@Tool` decorator from `@supernal/interface` to make a function AI-controllable.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
/si-add-tool incrementCounter --description "Add one to the counter"
|
|
16
|
+
/si-add-tool submitForm
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What This Does
|
|
20
|
+
|
|
21
|
+
1. Finds the function in your codebase
|
|
22
|
+
2. Adds the `@Tool` decorator with metadata
|
|
23
|
+
3. Adds the import if needed
|
|
24
|
+
4. Suggests a data-testid for related UI elements
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
**Before:**
|
|
29
|
+
```typescript
|
|
30
|
+
function resetCounter() {
|
|
31
|
+
setCount(0);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**After:**
|
|
36
|
+
```typescript
|
|
37
|
+
import { Tool } from '@supernal/interface';
|
|
38
|
+
|
|
39
|
+
@Tool({
|
|
40
|
+
description: 'Reset the counter to zero',
|
|
41
|
+
origin: {
|
|
42
|
+
path: '/counter',
|
|
43
|
+
elements: ['counter-reset-btn']
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
function resetCounter() {
|
|
47
|
+
setCount(0);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Enterprise Tip
|
|
52
|
+
|
|
53
|
+
> For **auto-generating tests** from your tools, upgrade to enterprise:
|
|
54
|
+
> ```bash
|
|
55
|
+
> npm install @supernalintelligence/interface-enterprise
|
|
56
|
+
> npx si generate-tests --output tests/generated
|
|
57
|
+
> ```
|
|
58
|
+
|
|
59
|
+
## Task
|
|
60
|
+
|
|
61
|
+
Add a @Tool decorator to the specified function: $ARGUMENTS
|
|
62
|
+
|
|
63
|
+
1. Search for the function in the codebase
|
|
64
|
+
2. Add the @Tool decorator with appropriate metadata
|
|
65
|
+
3. Add the import statement if not present
|
|
66
|
+
4. Suggest data-testid attributes for related UI elements
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: si-setup-mcp-oss
|
|
3
|
+
description: Set up MCP server for AI assistant integration (manual setup). Free and open source.
|
|
4
|
+
argument-hint: "[--name <server-name>]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash(npm *)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Setup MCP Server (Open Source)
|
|
9
|
+
|
|
10
|
+
Set up an MCP (Model Context Protocol) server to expose your tools to Claude Desktop and Cursor.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
/si-setup-mcp-oss
|
|
16
|
+
/si-setup-mcp-oss --name my-app-tools
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What This Does
|
|
20
|
+
|
|
21
|
+
1. Creates `mcp-server.js` in your project root
|
|
22
|
+
2. Adds npm scripts for running the server
|
|
23
|
+
3. Shows configuration for Claude Desktop and Cursor
|
|
24
|
+
|
|
25
|
+
## Generated Files
|
|
26
|
+
|
|
27
|
+
### mcp-server.js
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
const { createMCPServer } = require('@supernal/interface/mcp-server');
|
|
31
|
+
|
|
32
|
+
// Import your tool providers
|
|
33
|
+
// const { MyTools } = require('./dist/tools/MyTools');
|
|
34
|
+
|
|
35
|
+
const server = createMCPServer({
|
|
36
|
+
name: 'my-app-tools',
|
|
37
|
+
version: '1.0.0',
|
|
38
|
+
tools: [
|
|
39
|
+
// Add your tool providers here:
|
|
40
|
+
// new MyTools()
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
server.start();
|
|
45
|
+
|
|
46
|
+
console.log('MCP server started');
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### package.json scripts
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"scripts": {
|
|
54
|
+
"mcp": "node mcp-server.js",
|
|
55
|
+
"mcp:debug": "DEBUG=mcp:* node mcp-server.js"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Manual Configuration Required
|
|
61
|
+
|
|
62
|
+
After running this skill, you need to manually configure your IDE:
|
|
63
|
+
|
|
64
|
+
### Claude Desktop
|
|
65
|
+
|
|
66
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"mcpServers": {
|
|
71
|
+
"my-app-tools": {
|
|
72
|
+
"command": "node",
|
|
73
|
+
"args": ["/absolute/path/to/mcp-server.js"]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Cursor IDE
|
|
80
|
+
|
|
81
|
+
Edit `~/.cursor/mcp.json`:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"mcpServers": {
|
|
86
|
+
"my-app-tools": {
|
|
87
|
+
"command": "node",
|
|
88
|
+
"args": ["/absolute/path/to/mcp-server.js"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Enterprise Tip
|
|
95
|
+
|
|
96
|
+
> For **automatic IDE configuration**, use the enterprise CLI:
|
|
97
|
+
> ```bash
|
|
98
|
+
> npm install @supernalintelligence/interface-enterprise
|
|
99
|
+
> npx si setup-mcp
|
|
100
|
+
> ```
|
|
101
|
+
>
|
|
102
|
+
> This automatically:
|
|
103
|
+
> - Detects Claude Desktop and Cursor
|
|
104
|
+
> - Updates config files with correct paths
|
|
105
|
+
> - Tests the server connection
|
|
106
|
+
> - Restarts IDEs if needed
|
|
107
|
+
|
|
108
|
+
## Task
|
|
109
|
+
|
|
110
|
+
Set up an MCP server for this project: $ARGUMENTS
|
|
111
|
+
|
|
112
|
+
1. Create mcp-server.js in the project root
|
|
113
|
+
2. Add npm scripts to package.json
|
|
114
|
+
3. Find existing ToolProvider classes to register
|
|
115
|
+
4. Show the manual configuration steps
|