funifier-mcp 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/README.md +351 -0
- package/dist/core/api-client.d.ts +131 -0
- package/dist/core/api-client.d.ts.map +1 -0
- package/dist/core/api-client.js +796 -0
- package/dist/core/api-client.js.map +1 -0
- package/dist/core/config.d.ts +11 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +37 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/constants.d.ts +51 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +57 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +26 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/types/Action.d.ts +13 -0
- package/dist/core/types/Action.d.ts.map +1 -0
- package/dist/core/types/Action.js +3 -0
- package/dist/core/types/Action.js.map +1 -0
- package/dist/core/types/Aggregate.d.ts +11 -0
- package/dist/core/types/Aggregate.d.ts.map +1 -0
- package/dist/core/types/Aggregate.js +3 -0
- package/dist/core/types/Aggregate.js.map +1 -0
- package/dist/core/types/AiKnowledge.d.ts +10 -0
- package/dist/core/types/AiKnowledge.d.ts.map +1 -0
- package/dist/core/types/AiKnowledge.js +3 -0
- package/dist/core/types/AiKnowledge.js.map +1 -0
- package/dist/core/types/AuthModule.d.ts +12 -0
- package/dist/core/types/AuthModule.d.ts.map +1 -0
- package/dist/core/types/AuthModule.js +3 -0
- package/dist/core/types/AuthModule.js.map +1 -0
- package/dist/core/types/Challenge.d.ts +26 -0
- package/dist/core/types/Challenge.d.ts.map +1 -0
- package/dist/core/types/Challenge.js +3 -0
- package/dist/core/types/Challenge.js.map +1 -0
- package/dist/core/types/ChallengeAggregate.d.ts +13 -0
- package/dist/core/types/ChallengeAggregate.d.ts.map +1 -0
- package/dist/core/types/ChallengeAggregate.js +3 -0
- package/dist/core/types/ChallengeAggregate.js.map +1 -0
- package/dist/core/types/CustomPage.d.ts +15 -0
- package/dist/core/types/CustomPage.d.ts.map +1 -0
- package/dist/core/types/CustomPage.js +3 -0
- package/dist/core/types/CustomPage.js.map +1 -0
- package/dist/core/types/Leaderboard.d.ts +33 -0
- package/dist/core/types/Leaderboard.d.ts.map +1 -0
- package/dist/core/types/Leaderboard.js +3 -0
- package/dist/core/types/Leaderboard.js.map +1 -0
- package/dist/core/types/Level.d.ts +17 -0
- package/dist/core/types/Level.d.ts.map +1 -0
- package/dist/core/types/Level.js +3 -0
- package/dist/core/types/Level.js.map +1 -0
- package/dist/core/types/Point.d.ts +8 -0
- package/dist/core/types/Point.d.ts.map +1 -0
- package/dist/core/types/Point.js +3 -0
- package/dist/core/types/Point.js.map +1 -0
- package/dist/core/types/PublicEndpoint.d.ts +14 -0
- package/dist/core/types/PublicEndpoint.d.ts.map +1 -0
- package/dist/core/types/PublicEndpoint.js +3 -0
- package/dist/core/types/PublicEndpoint.js.map +1 -0
- package/dist/core/types/Quiz.d.ts +33 -0
- package/dist/core/types/Quiz.d.ts.map +1 -0
- package/dist/core/types/Quiz.js +3 -0
- package/dist/core/types/Quiz.js.map +1 -0
- package/dist/core/types/Scheduler.d.ts +15 -0
- package/dist/core/types/Scheduler.d.ts.map +1 -0
- package/dist/core/types/Scheduler.js +3 -0
- package/dist/core/types/Scheduler.js.map +1 -0
- package/dist/core/types/Trigger.d.ts +14 -0
- package/dist/core/types/Trigger.d.ts.map +1 -0
- package/dist/core/types/Trigger.js +3 -0
- package/dist/core/types/Trigger.js.map +1 -0
- package/dist/core/types/VirtualGood.d.ts +21 -0
- package/dist/core/types/VirtualGood.d.ts.map +1 -0
- package/dist/core/types/VirtualGood.js +3 -0
- package/dist/core/types/VirtualGood.js.map +1 -0
- package/dist/core/types/Websocket.d.ts +10 -0
- package/dist/core/types/Websocket.d.ts.map +1 -0
- package/dist/core/types/Websocket.js +3 -0
- package/dist/core/types/Websocket.js.map +1 -0
- package/dist/core/types/Widget.d.ts +15 -0
- package/dist/core/types/Widget.d.ts.map +1 -0
- package/dist/core/types/Widget.js +3 -0
- package/dist/core/types/Widget.js.map +1 -0
- package/dist/core/types/index.d.ts +18 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/types/index.js +34 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/api-holder.d.ts +40 -0
- package/dist/mcp/api-holder.d.ts.map +1 -0
- package/dist/mcp/api-holder.js +72 -0
- package/dist/mcp/api-holder.js.map +1 -0
- package/dist/mcp/bundle.js +99 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +36 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/prompts/templates.d.ts +3 -0
- package/dist/mcp/prompts/templates.d.ts.map +1 -0
- package/dist/mcp/prompts/templates.js +83 -0
- package/dist/mcp/prompts/templates.js.map +1 -0
- package/dist/mcp/resources/documentation.d.ts +3 -0
- package/dist/mcp/resources/documentation.d.ts.map +1 -0
- package/dist/mcp/resources/documentation.js +79 -0
- package/dist/mcp/resources/documentation.js.map +1 -0
- package/dist/mcp/tools/_fetch-current.d.ts +3 -0
- package/dist/mcp/tools/_fetch-current.d.ts.map +1 -0
- package/dist/mcp/tools/_fetch-current.js +67 -0
- package/dist/mcp/tools/_fetch-current.js.map +1 -0
- package/dist/mcp/tools/_merge.d.ts +2 -0
- package/dist/mcp/tools/_merge.d.ts.map +1 -0
- package/dist/mcp/tools/_merge.js +7 -0
- package/dist/mcp/tools/_merge.js.map +1 -0
- package/dist/mcp/tools/connect.d.ts +4 -0
- package/dist/mcp/tools/connect.d.ts.map +1 -0
- package/dist/mcp/tools/connect.js +44 -0
- package/dist/mcp/tools/connect.js.map +1 -0
- package/dist/mcp/tools/database.d.ts +4 -0
- package/dist/mcp/tools/database.d.ts.map +1 -0
- package/dist/mcp/tools/database.js +189 -0
- package/dist/mcp/tools/database.js.map +1 -0
- package/dist/mcp/tools/delete.d.ts +4 -0
- package/dist/mcp/tools/delete.d.ts.map +1 -0
- package/dist/mcp/tools/delete.js +97 -0
- package/dist/mcp/tools/delete.js.map +1 -0
- package/dist/mcp/tools/execute.d.ts +4 -0
- package/dist/mcp/tools/execute.d.ts.map +1 -0
- package/dist/mcp/tools/execute.js +84 -0
- package/dist/mcp/tools/execute.js.map +1 -0
- package/dist/mcp/tools/get.d.ts +4 -0
- package/dist/mcp/tools/get.d.ts.map +1 -0
- package/dist/mcp/tools/get.js +123 -0
- package/dist/mcp/tools/get.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +4 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +22 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/list.d.ts +4 -0
- package/dist/mcp/tools/list.d.ts.map +1 -0
- package/dist/mcp/tools/list.js +261 -0
- package/dist/mcp/tools/list.js.map +1 -0
- package/dist/mcp/tools/logs.d.ts +4 -0
- package/dist/mcp/tools/logs.d.ts.map +1 -0
- package/dist/mcp/tools/logs.js +50 -0
- package/dist/mcp/tools/logs.js.map +1 -0
- package/dist/mcp/tools/save.d.ts +4 -0
- package/dist/mcp/tools/save.d.ts.map +1 -0
- package/dist/mcp/tools/save.js +106 -0
- package/dist/mcp/tools/save.js.map +1 -0
- package/dist/mcp/tools/save.test.d.ts +2 -0
- package/dist/mcp/tools/save.test.d.ts.map +1 -0
- package/dist/mcp/tools/save.test.js +198 -0
- package/dist/mcp/tools/save.test.js.map +1 -0
- package/package.json +65 -0
- package/skills/funifier-create-action/SKILL.md +86 -0
- package/skills/funifier-create-aggregate/SKILL.md +87 -0
- package/skills/funifier-create-challenge/SKILL.md +87 -0
- package/skills/funifier-create-custom-page/SKILL.md +87 -0
- package/skills/funifier-create-leaderboard/SKILL.md +87 -0
- package/skills/funifier-create-level/SKILL.md +86 -0
- package/skills/funifier-create-point/SKILL.md +86 -0
- package/skills/funifier-create-quiz/SKILL.md +86 -0
- package/skills/funifier-create-scheduler/SKILL.md +87 -0
- package/skills/funifier-create-trigger/SKILL.md +88 -0
- package/skills/funifier-create-virtual-good/SKILL.md +86 -0
- package/skills/funifier-debug/SKILL.md +90 -0
- package/skills/funifier-help/SKILL.md +85 -0
- package/skills/funifier-implement-frontend/SKILL.md +89 -0
- package/skills/funifier-index/SKILL.md +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# @funifier-ai
|
|
2
|
+
|
|
3
|
+
Funifier AI toolkit — API client, MCP server, and AI assistant skills for the [Funifier](https://funifier.com) gamification platform.
|
|
4
|
+
|
|
5
|
+
## What's included
|
|
6
|
+
|
|
7
|
+
| Component | Description |
|
|
8
|
+
|-----------|-------------|
|
|
9
|
+
| **API Client** | Pure Node.js client for the Funifier REST API (80+ methods, 18 resource types) |
|
|
10
|
+
| **MCP Server** | Model Context Protocol server exposing 8 tools + 3 prompts + documentation resources |
|
|
11
|
+
| **Skills** | 15 guided workflows for Claude Code, Codex, Copilot, Continue, and Cursor |
|
|
12
|
+
| **Instructions** | Platform-specific instruction files (AGENTS.md, copilot-instructions.md, cursor rules) |
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
1. **Install:**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @funifier-ai
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. **Choose your platform** and follow setup instructions:
|
|
23
|
+
|
|
24
|
+
- [Claude Code](#claude-code) — Claude's official IDE and CLI
|
|
25
|
+
- [Codex CLI](#codex-cli-and-opencode) — Codex command-line agent
|
|
26
|
+
- [OpenCode](#codex-cli-and-opencode) — Open-source agent framework
|
|
27
|
+
- [GitHub Copilot](#github-copilot) — VS Code, JetBrains, GitHub.com
|
|
28
|
+
- [Continue IDE](#continue-ide) — Open-source IDE extension
|
|
29
|
+
- [Cursor IDE](#cursor-ide) — AI-native code editor
|
|
30
|
+
|
|
31
|
+
For detailed setup instructions, see:
|
|
32
|
+
- **[docs/INSTALL_EXAMPLES.md](docs/INSTALL_EXAMPLES.md)** — Real-world examples
|
|
33
|
+
- **[docs/PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md)** — Full platform guide
|
|
34
|
+
- **[docs/](docs/)** — Complete documentation index
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
### From npm (published)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install @funifier-ai
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Local development (before publishing)
|
|
45
|
+
|
|
46
|
+
**Automated setup (recommended):**
|
|
47
|
+
|
|
48
|
+
From **funifier-ai directory**, run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
node scripts/install-local.js /path/to/my-project
|
|
52
|
+
# or relative path:
|
|
53
|
+
node scripts/install-local.js ../my-project
|
|
54
|
+
# or install in current directory:
|
|
55
|
+
node scripts/install-local.js
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The script will:
|
|
59
|
+
1. Ask which platforms you're using (Claude Code, Codex, OpenCode, Copilot, Cursor, or all/none)
|
|
60
|
+
2. Build Funifier AI
|
|
61
|
+
3. Create npm link
|
|
62
|
+
4. Copy only the files you need for your selected platforms
|
|
63
|
+
|
|
64
|
+
Changes to funifier-ai appear immediately in your project.
|
|
65
|
+
|
|
66
|
+
**Manual setup:**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# In funifier-ai directory
|
|
70
|
+
npm run build && npm run bundle && npm link
|
|
71
|
+
|
|
72
|
+
# In your project
|
|
73
|
+
npm link @funifier-ai
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Direct path (copy mode):**
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install /path/to/funifier-ai
|
|
80
|
+
# or
|
|
81
|
+
npm install file:../funifier-ai
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
See [docs/PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md#local-development-setup) for details.
|
|
85
|
+
|
|
86
|
+
## Quick Verification
|
|
87
|
+
|
|
88
|
+
After local installation, verify everything is working:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# From your project directory
|
|
92
|
+
node ../funifier-ai/scripts/test-local.js
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This checks:
|
|
96
|
+
- ✓ Symlink is set up correctly
|
|
97
|
+
- ✓ Built files exist (dist/)
|
|
98
|
+
- ✓ Instruction files copied
|
|
99
|
+
- ✓ Can import the package
|
|
100
|
+
- ✓ API client works (if credentials set)
|
|
101
|
+
|
|
102
|
+
For detailed information on how local testing works, see [docs/LOCAL_TESTING.md](docs/LOCAL_TESTING.md).
|
|
103
|
+
|
|
104
|
+
If any check fails, see [docs/MCP_SETUP.md](docs/MCP_SETUP.md) for troubleshooting.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## MCP Server Setup
|
|
109
|
+
|
|
110
|
+
### With Claude Code
|
|
111
|
+
|
|
112
|
+
Add to your `.mcp.json` (project or global `~/.claude/.mcp.json`):
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"funifier": {
|
|
118
|
+
"command": "node",
|
|
119
|
+
"args": ["node_modules/@funifier-ai/dist/mcp/index.js"],
|
|
120
|
+
"env": {
|
|
121
|
+
"FUNIFIER_API_KEY": "your-api-key",
|
|
122
|
+
"FUNIFIER_SECRET_KEY": "your-secret-key",
|
|
123
|
+
"FUNIFIER_SERVER_URL": "https://your-instance.funifier.com"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Or place a `funifier.json` in your project root:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"apiKey": "your-api-key",
|
|
135
|
+
"secretKey": "your-secret-key",
|
|
136
|
+
"serverUrl": "https://your-instance.funifier.com"
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### With Claude Desktop
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"mcpServers": {
|
|
145
|
+
"funifier": {
|
|
146
|
+
"command": "npx",
|
|
147
|
+
"args": ["@funifier-ai"],
|
|
148
|
+
"env": {
|
|
149
|
+
"FUNIFIER_API_KEY": "your-api-key",
|
|
150
|
+
"FUNIFIER_SECRET_KEY": "your-secret-key",
|
|
151
|
+
"FUNIFIER_SERVER_URL": "https://your-instance.funifier.com"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Runtime connection
|
|
159
|
+
|
|
160
|
+
If no config is provided at startup, use the `funifier_connect` tool to connect:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
funifier_connect({ apiKey: "...", secretKey: "...", serverUrl: "https://..." })
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## MCP Tools
|
|
167
|
+
|
|
168
|
+
| Tool | Description |
|
|
169
|
+
|------|-------------|
|
|
170
|
+
| `funifier_connect` | Connect to a Funifier instance (or switch between instances) |
|
|
171
|
+
| `funifier_list` | List resources by type with optional search filtering |
|
|
172
|
+
| `funifier_get` | Get a specific resource with full details (including code) |
|
|
173
|
+
| `funifier_save` | Create or update a resource |
|
|
174
|
+
| `funifier_delete` | Delete a resource by type and ID |
|
|
175
|
+
| `funifier_execute` | Execute a scheduler, aggregate, or public endpoint |
|
|
176
|
+
| `funifier_logs` | Get execution logs for triggers and schedulers |
|
|
177
|
+
| `funifier_database` | Query, aggregate, insert, update, delete on any collection |
|
|
178
|
+
|
|
179
|
+
### Resource types
|
|
180
|
+
|
|
181
|
+
trigger, scheduler, aggregate, websocket, widget, custom-page, public-endpoint, challenge-aggregate, auth-module, ai-knowledge, action, challenge, point, level, leaderboard, quiz, virtual-good-catalog, virtual-good-item
|
|
182
|
+
|
|
183
|
+
## API Client (library usage)
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
import { createAPIClient } from "@funifier-ai";
|
|
187
|
+
|
|
188
|
+
const api = createAPIClient({
|
|
189
|
+
apiKey: "your-api-key",
|
|
190
|
+
secretKey: "your-secret-key",
|
|
191
|
+
serverUrl: "https://your-instance.funifier.com",
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// List all triggers
|
|
195
|
+
const triggers = await api.listTriggers();
|
|
196
|
+
|
|
197
|
+
// Execute an aggregate
|
|
198
|
+
const result = await api.executeAggregate("my-aggregate-id", {});
|
|
199
|
+
|
|
200
|
+
// Query any collection
|
|
201
|
+
const players = await api.queryCollection("player", { active: true }, { limit: 10 });
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Skills and Instructions
|
|
205
|
+
|
|
206
|
+
This package includes generated instruction files for multiple platforms. Each provides guided workflows, code quality standards, MCP tool routing, and documentation search.
|
|
207
|
+
|
|
208
|
+
### Claude Code
|
|
209
|
+
|
|
210
|
+
Install skills to your project:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
cp -r node_modules/@funifier-ai/skills/* .claude/skills/
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Invoke any skill with `/funifier-<name>`:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
/funifier-create-trigger
|
|
220
|
+
/funifier-debug
|
|
221
|
+
/funifier-help
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Codex CLI and OpenCode
|
|
225
|
+
|
|
226
|
+
The generated `AGENTS.md` file provides instructions for Codex, OpenCode, and any agent that reads AGENTS.md.
|
|
227
|
+
|
|
228
|
+
**Codex CLI:**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
cp node_modules/@funifier-ai/AGENTS.md .
|
|
232
|
+
codex "Create a trigger for player registration"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**OpenCode:**
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
cp node_modules/@funifier-ai/AGENTS.md .
|
|
239
|
+
# Add to .opencode.json:
|
|
240
|
+
# { "instructions": { "file": "./AGENTS.md" } }
|
|
241
|
+
opencode "Debug my scheduler"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
See [PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md) for full configuration details.
|
|
245
|
+
|
|
246
|
+
### GitHub Copilot
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
mkdir -p .github
|
|
250
|
+
cp node_modules/@funifier-ai/.github/copilot-instructions.md .github/
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Copilot automatically applies `.github/copilot-instructions.md` to code suggestions, chat, and PR reviews.
|
|
254
|
+
|
|
255
|
+
### Continue IDE
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
mkdir -p .github
|
|
259
|
+
cp node_modules/@funifier-ai/.github/copilot-instructions.md .github/
|
|
260
|
+
# Configure ~/.continue/config.json with customInstructions and MCP
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Continue (VS Code / JetBrains) supports full MCP integration. See [PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md) for configuration.
|
|
264
|
+
|
|
265
|
+
### Cursor IDE
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
mkdir -p .cursor/rules
|
|
269
|
+
cp node_modules/@funifier-ai/.cursor/rules/funifier.mdc .cursor/rules/
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Cursor automatically discovers and applies `.mdc` files in `.cursor/rules/` to all code generation and completions.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### Available Workflows
|
|
277
|
+
|
|
278
|
+
Each platform above provides access to these guided workflows:
|
|
279
|
+
|
|
280
|
+
| Skill | Description |
|
|
281
|
+
|-------|-------------|
|
|
282
|
+
| `funifier-help` | Documentation router and guidance |
|
|
283
|
+
| `funifier-debug` | Systematic debugging workflow |
|
|
284
|
+
| `funifier-create-trigger` | Create server-side event handlers |
|
|
285
|
+
| `funifier-create-scheduler` | Create scheduled Groovy jobs |
|
|
286
|
+
| `funifier-create-aggregate` | Create MongoDB aggregate pipelines |
|
|
287
|
+
| `funifier-create-custom-page` | Create Studio admin pages |
|
|
288
|
+
| `funifier-create-action` | Create trackable player actions |
|
|
289
|
+
| `funifier-create-challenge` | Create missions with rewards |
|
|
290
|
+
| `funifier-create-point` | Create point categories |
|
|
291
|
+
| `funifier-create-level` | Create level progression |
|
|
292
|
+
| `funifier-create-leaderboard` | Create rankings |
|
|
293
|
+
| `funifier-create-quiz` | Create quizzes |
|
|
294
|
+
| `funifier-create-virtual-good` | Create virtual stores |
|
|
295
|
+
| `funifier-implement-frontend` | Build frontend consuming Funifier API |
|
|
296
|
+
|
|
297
|
+
## Generated Files
|
|
298
|
+
|
|
299
|
+
When you install `@funifier-ai`, the package includes pre-generated instruction and skill files:
|
|
300
|
+
|
|
301
|
+
| File | Platforms | Purpose |
|
|
302
|
+
|------|-----------|---------|
|
|
303
|
+
| `skills/funifier-*/SKILL.md` | Claude Code | Guided workflows with system prompt, doc search, and steps |
|
|
304
|
+
| `AGENTS.md` | Codex, OpenCode | Agent routing, MCP tools, and skill index |
|
|
305
|
+
| `.github/copilot-instructions.md` | Copilot, Continue | Code quality standards and skill routing |
|
|
306
|
+
| `.cursor/rules/funifier.mdc` | Cursor | Development rules with YAML frontmatter |
|
|
307
|
+
|
|
308
|
+
All files embed:
|
|
309
|
+
- **Senior developer persona** (SOLID, DRY, KISS, YAGNI)
|
|
310
|
+
- **Skill routing** (which skill to use for each task)
|
|
311
|
+
- **MCP tool reference** (if server is configured)
|
|
312
|
+
- **Lexical search command** (to find relevant docs efficiently)
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Documentation
|
|
317
|
+
|
|
318
|
+
- **[docs/README.md](docs/)** — Complete documentation index
|
|
319
|
+
- **[docs/PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md)** — Detailed setup for all platforms
|
|
320
|
+
- **[docs/QUICK_REFERENCE.md](docs/QUICK_REFERENCE.md)** — Copy-paste setup commands
|
|
321
|
+
- **[docs/INSTALL_EXAMPLES.md](docs/INSTALL_EXAMPLES.md)** — Real-world scenarios
|
|
322
|
+
- **[docs/MCP_SETUP.md](docs/MCP_SETUP.md)** — MCP configuration and troubleshooting
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Configuration
|
|
327
|
+
|
|
328
|
+
### Environment variables
|
|
329
|
+
|
|
330
|
+
| Variable | Description |
|
|
331
|
+
|----------|-------------|
|
|
332
|
+
| `FUNIFIER_API_KEY` | API key for authentication |
|
|
333
|
+
| `FUNIFIER_SECRET_KEY` | Secret key for authentication |
|
|
334
|
+
| `FUNIFIER_SERVER_URL` | Base URL of your Funifier instance |
|
|
335
|
+
| `FUNIFIER_DOCS_PATH` | Path to documentation files (optional) |
|
|
336
|
+
|
|
337
|
+
### funifier.json
|
|
338
|
+
|
|
339
|
+
Place in your project root for automatic configuration:
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"apiKey": "your-api-key",
|
|
344
|
+
"secretKey": "your-secret-key",
|
|
345
|
+
"serverUrl": "https://your-instance.funifier.com"
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## License
|
|
350
|
+
|
|
351
|
+
MIT
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { FunifierConfig } from "./config";
|
|
2
|
+
import { Trigger, Scheduler, Aggregate, Widget, CustomPage, PublicEndpoint, ChallengeAggregate, AiKnowledge, AuthModule, Websocket, Action, Challenge, Point, Level, LevelConfig, Leaderboard, LeaderboardEntry, Quiz, Question, VirtualGoodCatalog, VirtualGoodItem } from "./types";
|
|
3
|
+
export declare function createAPIClient(config: FunifierConfig): {
|
|
4
|
+
listTriggers: () => Promise<Trigger[]>;
|
|
5
|
+
saveTrigger: (payload: Trigger) => Promise<Trigger>;
|
|
6
|
+
deleteTrigger: (id: string) => Promise<any>;
|
|
7
|
+
getTriggerLogs: (id: string) => Promise<any[]>;
|
|
8
|
+
listSchedulers: () => Promise<Scheduler[]>;
|
|
9
|
+
saveScheduler: (payload: Scheduler) => Promise<Scheduler | undefined>;
|
|
10
|
+
deleteScheduler: (id: string) => Promise<any>;
|
|
11
|
+
executeScheduler: (id: string) => Promise<{
|
|
12
|
+
scheduler: Scheduler;
|
|
13
|
+
outputs: string[];
|
|
14
|
+
millis: number;
|
|
15
|
+
exceptions: string[];
|
|
16
|
+
}>;
|
|
17
|
+
getSchedulerLogs: (id: string) => Promise<any[]>;
|
|
18
|
+
listAggregates: () => Promise<Aggregate[]>;
|
|
19
|
+
saveAggregate: (payload: Aggregate) => Promise<Aggregate | undefined>;
|
|
20
|
+
deleteAggregate: (id: string) => Promise<any>;
|
|
21
|
+
executeAggregate: (id: string, params: Record<string, any>) => Promise<any>;
|
|
22
|
+
analyzeAggregate: (id: string, params: Record<string, any>) => Promise<{
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
script_outputs: string[];
|
|
25
|
+
script_exceptions: string[];
|
|
26
|
+
obj: any;
|
|
27
|
+
aggregate_step_2?: any[];
|
|
28
|
+
aggregate_step_3?: any[];
|
|
29
|
+
}>;
|
|
30
|
+
getAggregateParams: (id: string) => Promise<string[]>;
|
|
31
|
+
listWebsockets: () => Promise<Websocket[]>;
|
|
32
|
+
saveWebsocket: (payload: Websocket, isNew: boolean) => Promise<Websocket | {
|
|
33
|
+
websocket: Websocket;
|
|
34
|
+
status: string;
|
|
35
|
+
} | undefined>;
|
|
36
|
+
deleteWebsocket: (id: string) => Promise<{
|
|
37
|
+
success: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
listWidgets: () => Promise<Widget[]>;
|
|
40
|
+
getWidgetById: (id: string) => Promise<Widget | undefined>;
|
|
41
|
+
saveWidget: (payload: Widget) => Promise<Widget | undefined>;
|
|
42
|
+
deleteWidget: (id: string) => Promise<any>;
|
|
43
|
+
listCustomPages: () => Promise<CustomPage[]>;
|
|
44
|
+
saveCustomPage: (payload: CustomPage) => Promise<CustomPage | undefined>;
|
|
45
|
+
deleteCustomPage: (id: string) => Promise<any>;
|
|
46
|
+
listPublicEndpoints: () => Promise<PublicEndpoint[]>;
|
|
47
|
+
savePublicEndpoint: (payload: PublicEndpoint) => Promise<PublicEndpoint | undefined>;
|
|
48
|
+
deletePublicEndpoint: (id: string) => Promise<any>;
|
|
49
|
+
executePublicEndpoint: (apiKey: string, id: string, payload: any, method: string) => Promise<any>;
|
|
50
|
+
listChallengeAggregates: () => Promise<ChallengeAggregate[]>;
|
|
51
|
+
saveChallengeAggregate: (payload: ChallengeAggregate) => Promise<ChallengeAggregate | undefined>;
|
|
52
|
+
deleteChallengeAggregate: (id: string) => Promise<any>;
|
|
53
|
+
listAuthModules: () => Promise<AuthModule[]>;
|
|
54
|
+
saveAuthModule: (payload: AuthModule, isNew: boolean) => Promise<AuthModule | undefined>;
|
|
55
|
+
deleteAuthModule: (id: string) => Promise<{
|
|
56
|
+
success: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
listAiKnowledge: () => Promise<AiKnowledge[]>;
|
|
59
|
+
saveAiKnowledge: (payload: AiKnowledge) => Promise<AiKnowledge | undefined>;
|
|
60
|
+
deleteAiKnowledge: (id: string) => Promise<any>;
|
|
61
|
+
getStudioPageFolders: () => Promise<{
|
|
62
|
+
_id: string;
|
|
63
|
+
title: string;
|
|
64
|
+
}[]>;
|
|
65
|
+
evaluateCron: (expression: string) => Promise<{
|
|
66
|
+
valid: boolean;
|
|
67
|
+
expression: string;
|
|
68
|
+
description: string;
|
|
69
|
+
language: string;
|
|
70
|
+
}>;
|
|
71
|
+
getCollections: () => Promise<string[]>;
|
|
72
|
+
queryCollection: (collection: string, query?: Record<string, any>, options?: {
|
|
73
|
+
sort?: Record<string, number>;
|
|
74
|
+
limit?: number;
|
|
75
|
+
skip?: number;
|
|
76
|
+
}) => Promise<any[]>;
|
|
77
|
+
aggregateCollection: (collection: string, pipeline: any[]) => Promise<any>;
|
|
78
|
+
insertDocument: (collection: string, data: Record<string, any>) => Promise<any>;
|
|
79
|
+
updateDocument: (collection: string, data: Record<string, any>) => Promise<any>;
|
|
80
|
+
deleteDocument: (collection: string, query: string) => Promise<any>;
|
|
81
|
+
bulkInsert: (collection: string, data: any[]) => Promise<any>;
|
|
82
|
+
listActions: () => Promise<Action[]>;
|
|
83
|
+
saveAction: (payload: Action) => Promise<Action>;
|
|
84
|
+
deleteAction: (id: string) => Promise<any>;
|
|
85
|
+
listChallenges: () => Promise<Challenge[]>;
|
|
86
|
+
saveChallenge: (payload: Challenge) => Promise<Challenge>;
|
|
87
|
+
deleteChallenge: (id: string) => Promise<any>;
|
|
88
|
+
listPoints: () => Promise<Point[]>;
|
|
89
|
+
savePoint: (payload: Point) => Promise<Point>;
|
|
90
|
+
deletePoint: (id: string) => Promise<any>;
|
|
91
|
+
listLevels: () => Promise<Level[]>;
|
|
92
|
+
saveLevel: (payload: Level) => Promise<Level>;
|
|
93
|
+
deleteLevel: (id: string) => Promise<any>;
|
|
94
|
+
saveLevelConfig: (payload: LevelConfig) => Promise<LevelConfig>;
|
|
95
|
+
listLeaderboards: () => Promise<Leaderboard[]>;
|
|
96
|
+
saveLeaderboard: (payload: Leaderboard) => Promise<Leaderboard>;
|
|
97
|
+
deleteLeaderboard: (id: string) => Promise<any>;
|
|
98
|
+
getLeaderboardResults: (id: string) => Promise<LeaderboardEntry[]>;
|
|
99
|
+
listQuizzes: () => Promise<Quiz[]>;
|
|
100
|
+
saveQuiz: (payload: Quiz) => Promise<Quiz>;
|
|
101
|
+
deleteQuiz: (id: string) => Promise<any>;
|
|
102
|
+
listQuizQuestions: (quizId: string) => Promise<Question[]>;
|
|
103
|
+
saveQuestion: (payload: Question) => Promise<Question>;
|
|
104
|
+
listVirtualGoodCatalogs: () => Promise<VirtualGoodCatalog[]>;
|
|
105
|
+
saveVirtualGoodCatalog: (payload: VirtualGoodCatalog) => Promise<VirtualGoodCatalog>;
|
|
106
|
+
listVirtualGoodItems: () => Promise<VirtualGoodItem[]>;
|
|
107
|
+
saveVirtualGoodItem: (payload: VirtualGoodItem) => Promise<VirtualGoodItem>;
|
|
108
|
+
getGamification: (apiKey: string) => Promise<{
|
|
109
|
+
_id: string;
|
|
110
|
+
name: string;
|
|
111
|
+
imageUrl?: string;
|
|
112
|
+
image?: {
|
|
113
|
+
small?: {
|
|
114
|
+
url: string;
|
|
115
|
+
};
|
|
116
|
+
medium?: {
|
|
117
|
+
url: string;
|
|
118
|
+
};
|
|
119
|
+
original?: {
|
|
120
|
+
url: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
created_at?: number;
|
|
124
|
+
updated_at?: number;
|
|
125
|
+
} | {
|
|
126
|
+
errorMessage: string;
|
|
127
|
+
errorCode: number;
|
|
128
|
+
}>;
|
|
129
|
+
};
|
|
130
|
+
export type FunifierAPIClient = ReturnType<typeof createAPIClient>;
|
|
131
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/core/api-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,MAAM,EACN,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,SAAS,EACT,KAAK,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,eAAe,CAAC,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