@nitrostack/cli 1.0.10 → 1.0.12
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 +38 -52
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +13 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +5 -6
- package/dist/commands/init.js +3 -3
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +2 -0
- package/package.json +2 -2
- package/templates/typescript-oauth/.env.example +5 -1
- package/templates/typescript-oauth/README.md +37 -51
- package/templates/typescript-oauth/package.json +2 -1
- package/templates/typescript-oauth/src/widgets/package.json +2 -1
- package/templates/typescript-pizzaz/.env.example +4 -0
- package/templates/typescript-pizzaz/README.md +35 -60
- package/templates/typescript-pizzaz/package.json +2 -1
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.tools.ts +17 -3
- package/templates/typescript-pizzaz/src/widgets/package.json +1 -0
- package/templates/typescript-starter/.env.example +3 -7
- package/templates/typescript-starter/README.md +28 -68
- package/templates/typescript-starter/package.json +2 -1
- package/templates/typescript-starter/src/widgets/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,78 +1,64 @@
|
|
|
1
|
-
# @nitrostack/cli
|
|
1
|
+
# @nitrostack/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official NitroStack CLI for scaffolding, developing, and maintaining MCP server
|
|
4
|
+
projects.
|
|
4
5
|
|
|
5
|
-
[](https://www.npmjs.com/package/@nitrostack/cli)
|
|
7
|
+
[](https://www.npmjs.com/package/@nitrostack/cli)
|
|
8
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## ✨ Key Features
|
|
14
|
-
|
|
15
|
-
- **🏗️ Instant Scaffolding**: Bootstrap new MCP servers from professional templates in seconds.
|
|
16
|
-
- **🛠️ Code Generators**: Generate Modules, Tools, Guards, and Middleware with a single command.
|
|
17
|
-
- **🔄 Live Reload**: Powerful dev server with hot-reloading for rapid development.
|
|
18
|
-
- **🏷️ Type Generation**: Automatically generate TypeScript interfaces from your tool schemas.
|
|
19
|
-
- **🎨 Visual Studio**: Launch the built-in NitroStudio to test inputs/outputs and preview widgets.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 📦 Installation
|
|
24
|
-
|
|
25
|
-
We recommend installing the CLI globally to access the `nitrostack-cli` command anywhere:
|
|
10
|
+
## Installation
|
|
26
11
|
|
|
27
12
|
```bash
|
|
28
13
|
npm install -g @nitrostack/cli
|
|
29
14
|
```
|
|
30
15
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## 🚀 Commands Overview
|
|
16
|
+
## Quick Start
|
|
34
17
|
|
|
35
|
-
### Initialize a New Project
|
|
36
18
|
```bash
|
|
37
|
-
nitrostack-cli init my-project
|
|
19
|
+
nitrostack-cli init my-project --template typescript-starter
|
|
20
|
+
cd my-project
|
|
21
|
+
npm run dev
|
|
38
22
|
```
|
|
39
23
|
|
|
40
|
-
|
|
24
|
+
## Core Commands
|
|
41
25
|
|
|
42
|
-
### Start Development Server
|
|
43
26
|
```bash
|
|
27
|
+
nitrostack-cli init <project-name> [--template <name>]
|
|
44
28
|
nitrostack-cli dev
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Scaffold a New Tool
|
|
48
|
-
```bash
|
|
49
|
-
nitrostack-cli generate tool my-tool --module users
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Build for Production
|
|
53
|
-
```bash
|
|
54
29
|
nitrostack-cli build
|
|
30
|
+
nitrostack-cli start
|
|
31
|
+
nitrostack-cli generate <type> [name] [--module <name>]
|
|
32
|
+
nitrostack-cli install
|
|
33
|
+
nitrostack-cli upgrade
|
|
55
34
|
```
|
|
56
35
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
## 🎨 NitroStudio
|
|
36
|
+
## Templates
|
|
60
37
|
|
|
61
|
-
|
|
38
|
+
- `typescript-starter`
|
|
39
|
+
- `typescript-oauth`
|
|
40
|
+
- `typescript-pizzaz`
|
|
62
41
|
|
|
63
|
-
|
|
42
|
+
## NitroStudio
|
|
64
43
|
|
|
65
|
-
|
|
44
|
+
NitroStudio is the recommended companion app for testing and debugging MCP
|
|
45
|
+
servers built with NitroStack.
|
|
66
46
|
|
|
67
|
-
|
|
47
|
+
- Download: <https://nitrostack.ai/studio>
|
|
48
|
+
- Studio: <https://nitrostack.ai/studio>
|
|
68
49
|
|
|
69
|
-
##
|
|
50
|
+
## Links
|
|
70
51
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
52
|
+
- CLI docs: <https://docs.nitrostack.ai/cli/overview>
|
|
53
|
+
- Full docs: <https://docs.nitrostack.ai>
|
|
54
|
+
- Source: <https://github.com/nitrocloudofficial/nitrostack>
|
|
55
|
+
- npm: <https://www.npmjs.com/package/@nitrostack/cli>
|
|
56
|
+
- Blog: <https://blog.nitrostack.ai>
|
|
75
57
|
|
|
76
|
-
|
|
58
|
+
## Community
|
|
77
59
|
|
|
78
|
-
|
|
60
|
+
- Discord: <https://discord.gg/uVWey6UhuD>
|
|
61
|
+
- X: <https://x.com/nitrostackai>
|
|
62
|
+
- YouTube: <https://www.youtube.com/@nitrostackai>
|
|
63
|
+
- LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
|
|
64
|
+
- GitHub: <https://github.com/nitrostackai>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAmBA,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAmBA,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAgPvD"}
|
package/dist/commands/build.js
CHANGED
|
@@ -76,6 +76,17 @@ export async function buildCommand(options) {
|
|
|
76
76
|
if (fs.existsSync(APP_DIR)) {
|
|
77
77
|
findWidgetPages(APP_DIR);
|
|
78
78
|
}
|
|
79
|
+
// Linked @nitrostack/widgets often has its own node_modules/react (e.g. v19) while this app
|
|
80
|
+
// uses v18. Esbuild resolves from the realpath of the symlinked package, so without aliases
|
|
81
|
+
// the widget bundle can contain two Reacts and render blank in MCP hosts. Next.js can use
|
|
82
|
+
// webpack aliases in next.config.js; production `nitrostack-cli build` mirrors that here.
|
|
83
|
+
const widgetsNm = path.join(widgetsPath, 'node_modules');
|
|
84
|
+
const widgetReactAliases = {
|
|
85
|
+
react: path.join(widgetsNm, 'react'),
|
|
86
|
+
'react-dom': path.join(widgetsNm, 'react-dom'),
|
|
87
|
+
'react/jsx-runtime': path.join(widgetsNm, 'react', 'jsx-runtime.js'),
|
|
88
|
+
'react/jsx-dev-runtime': path.join(widgetsNm, 'react', 'jsx-dev-runtime.js'),
|
|
89
|
+
};
|
|
79
90
|
// Bundle each widget
|
|
80
91
|
for (const widget of widgetPages) {
|
|
81
92
|
const tempEntry = path.join(OUT_DIR, `_temp_${widget.outputName}.jsx`);
|
|
@@ -118,7 +129,8 @@ function init() {
|
|
|
118
129
|
jsx: 'automatic',
|
|
119
130
|
jsxImportSource: 'react',
|
|
120
131
|
external: [],
|
|
121
|
-
nodePaths: [
|
|
132
|
+
nodePaths: [widgetsNm],
|
|
133
|
+
alias: widgetReactAliases,
|
|
122
134
|
define: {
|
|
123
135
|
'process.env.NODE_ENV': '"production"'
|
|
124
136
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAgUA,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwHvG"}
|
|
@@ -17,13 +17,12 @@ const TEMPLATES = {
|
|
|
17
17
|
@Middleware()
|
|
18
18
|
export class ${name} implements MiddlewareInterface {
|
|
19
19
|
async use(context: ExecutionContext, next: () => Promise<any>) {
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
// Use context.logger instead of console.log — console breaks JSON-RPC over stdio in MCP mode
|
|
21
|
+
context.logger.info(\`[\${context.toolName}] Started\`);
|
|
22
|
+
|
|
23
23
|
const result = await next();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
console.log(\`[\${context.toolName}] Completed\`);
|
|
24
|
+
|
|
25
|
+
context.logger.info(\`[\${context.toolName}] Completed\`);
|
|
27
26
|
|
|
28
27
|
return result;
|
|
29
28
|
}
|
package/dist/commands/init.js
CHANGED
|
@@ -293,7 +293,7 @@ async function createProjectFromScratch(targetDir, projectName, answers) {
|
|
|
293
293
|
};
|
|
294
294
|
fs.writeJSONSync(path.join(targetDir, 'tsconfig.json'), tsconfig, { spaces: 2 });
|
|
295
295
|
fs.mkdirSync(path.join(targetDir, 'src'), { recursive: true });
|
|
296
|
-
const indexTs = `import { createServer,
|
|
296
|
+
const indexTs = `import { createServer, Tool, z } from '@nitrostack/core';
|
|
297
297
|
|
|
298
298
|
const server = createServer({
|
|
299
299
|
name: '${projectName}',
|
|
@@ -302,7 +302,7 @@ const server = createServer({
|
|
|
302
302
|
});
|
|
303
303
|
|
|
304
304
|
server.tool(
|
|
305
|
-
|
|
305
|
+
new Tool({
|
|
306
306
|
name: 'hello',
|
|
307
307
|
description: 'Say hello to someone',
|
|
308
308
|
inputSchema: z.object({
|
|
@@ -347,7 +347,7 @@ npm run build
|
|
|
347
347
|
npm start
|
|
348
348
|
\`\`\`
|
|
349
349
|
|
|
350
|
-
Built with [NitroStack](https://nitrostack.
|
|
350
|
+
Built with [NitroStack](https://nitrostack.ai) ⚡
|
|
351
351
|
`;
|
|
352
352
|
fs.writeFileSync(path.join(targetDir, 'README.md'), readme);
|
|
353
353
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAiBA,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAiBA,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBA0FvD"}
|
package/dist/commands/start.js
CHANGED
|
@@ -35,6 +35,8 @@ export async function startCommand(options) {
|
|
|
35
35
|
{ label: 'Server', value: `http://localhost:${port}` },
|
|
36
36
|
{ label: 'Mode', value: 'Production' },
|
|
37
37
|
{ label: 'Transport', value: 'HTTP + STDIO (dual)' },
|
|
38
|
+
{ label: 'Streamable HTTP', value: `http://localhost:${port}/mcp` },
|
|
39
|
+
{ label: 'Legacy SDK SSE', value: `http://localhost:${port}/sse` },
|
|
38
40
|
...(hasBuiltWidgets ? [{ label: 'Widgets', value: 'Bundled' }] : []),
|
|
39
41
|
]));
|
|
40
42
|
log('Starting server...', 'info');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitrostack/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "CLI for NitroStack - Create and manage MCP server projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
"url": "https://github.com/nitrocloudofficial/nitrostack/issues"
|
|
69
69
|
},
|
|
70
70
|
"homepage": "https://nitrostack.ai"
|
|
71
|
-
}
|
|
71
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# NitroStack Configuration
|
|
2
|
+
NITRO_LOG_LEVEL=info
|
|
3
|
+
NITROSTACK_APP_MODE=openai
|
|
4
|
+
|
|
1
5
|
# OAuth 2.1 MCP Server Configuration
|
|
2
6
|
# =============================================================================
|
|
3
7
|
# TRANSPORT MODE (AUTO-CONFIGURED)
|
|
@@ -24,4 +28,4 @@ TOKEN_AUDIENCE=https://mcplocal
|
|
|
24
28
|
# Expected token issuer (your Auth0 tenant domain with trailing slash)
|
|
25
29
|
TOKEN_ISSUER=https://dev-5dt0utuk315713tjm.us.auth0.com
|
|
26
30
|
|
|
27
|
-
DUFFEL_API_KEY=
|
|
31
|
+
DUFFEL_API_KEY=your-duffel-api-key
|
|
@@ -1,70 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NitroStack OAuth Template
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Template for OAuth 2.1-enabled MCP servers, including auth-aware tool patterns
|
|
4
|
+
and a production-style project structure.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## What This Template Includes
|
|
6
7
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
8
|
+
- OAuth 2.1 oriented project setup
|
|
9
|
+
- Tool and module structure for protected workflows
|
|
10
|
+
- Environment-based configuration (`.env`)
|
|
11
|
+
- Widget-ready frontend integration
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## 🚀 Quick Start
|
|
15
|
-
|
|
16
|
-
### 1. Initialize Your Project
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npx nitrostack init my-flight-app --template typescript-oauth
|
|
20
|
-
cd my-flight-app
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### 2. Install Dependencies
|
|
13
|
+
## Quick Start
|
|
24
14
|
|
|
25
15
|
```bash
|
|
26
|
-
|
|
16
|
+
npx @nitrostack/cli init my-oauth-app --template typescript-oauth
|
|
17
|
+
cd my-oauth-app
|
|
18
|
+
npm run dev
|
|
27
19
|
```
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
## Configuration
|
|
30
22
|
|
|
31
|
-
|
|
23
|
+
1. Copy `.env.example` to `.env`
|
|
24
|
+
2. Configure OAuth provider values
|
|
25
|
+
3. (Optional) Configure provider-specific API keys
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
For detailed setup, see `OAUTH_SETUP.md`.
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
2. **Open Project**: Launch NitroStudio and select your project folder.
|
|
29
|
+
## Common Commands
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
You need a free Duffel API key to see live flight data:
|
|
31
|
+
```bash
|
|
32
|
+
npm run dev
|
|
33
|
+
npm run build
|
|
34
|
+
npm start
|
|
35
|
+
```
|
|
45
36
|
|
|
46
|
-
|
|
47
|
-
2. Copy your **Test Token** from the dashboard.
|
|
48
|
-
3. Create `.env` from the example:
|
|
49
|
-
```bash
|
|
50
|
-
cp .env.example .env
|
|
51
|
-
```
|
|
52
|
-
4. Update `DUFFEL_API_KEY` in your `.env`.
|
|
37
|
+
## NitroStudio
|
|
53
38
|
|
|
54
|
-
|
|
39
|
+
Use NitroStudio to test auth flows, inspect tool requests, and validate behavior.
|
|
55
40
|
|
|
56
|
-
|
|
41
|
+
- Download: <https://nitrostack.ai/studio>
|
|
42
|
+
- Studio: <https://nitrostack.ai/studio>
|
|
57
43
|
|
|
58
|
-
|
|
44
|
+
## Links
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
- Docs: <https://docs.nitrostack.ai>
|
|
47
|
+
- OAuth docs: <https://docs.nitrostack.ai/sdk/typescript/11-oauth-authentication>
|
|
48
|
+
- Main repository: <https://github.com/nitrocloudofficial/nitrostack>
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
- `npm run build` — Bundle TypeScript and widgets for deployment.
|
|
64
|
-
- `npm run upgrade` — Keep NitroStack core up to date.
|
|
50
|
+
## Community
|
|
65
51
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
52
|
+
- Discord: <https://discord.gg/uVWey6UhuD>
|
|
53
|
+
- X: <https://x.com/nitrostackai>
|
|
54
|
+
- YouTube: <https://www.youtube.com/@nitrostackai>
|
|
55
|
+
- LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
|
|
56
|
+
- GitHub: <https://github.com/nitrostackai>
|
|
@@ -1,79 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NitroStack Pizzaz Template
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Template focused on rich, interactive widget experiences (map/list/detail flows)
|
|
4
|
+
using the NitroStack widget SDK patterns.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## What This Template Includes
|
|
6
7
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
8
|
+
- Widget-heavy module and UI structure
|
|
9
|
+
- Interactive examples for advanced frontends
|
|
10
|
+
- Optional map provider integration pattern
|
|
11
|
+
- Studio-friendly development workflow
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## 🚀 Quick Start
|
|
15
|
-
|
|
16
|
-
### 1. Initialize Your Project
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npx nitrostack init my-pizza-app --template typescript-pizzaz
|
|
20
|
-
cd my-pizza-app
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### 2. Install Dependencies
|
|
13
|
+
## Quick Start
|
|
24
14
|
|
|
25
15
|
```bash
|
|
26
|
-
|
|
16
|
+
npx @nitrostack/cli init my-pizzaz-app --template typescript-pizzaz
|
|
17
|
+
cd my-pizzaz-app
|
|
18
|
+
npm run dev
|
|
27
19
|
```
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
NitroStudio provides the best experience for visual testing of widgets and maps.
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
1. **Download NitroStudio**: [nitrostack.ai/studio](https://nitrostack.ai/studio)
|
|
36
|
-
2. **Open Project**: Launch NitroStudio and select your project folder.
|
|
37
|
-
3. **View Maps**: Use the chat or visual tools to explore your pizza shops.
|
|
38
|
-
|
|
39
|
-
---
|
|
21
|
+
## Optional Configuration
|
|
40
22
|
|
|
41
|
-
|
|
23
|
+
If this project uses a map provider, configure API tokens in widget `.env` files
|
|
24
|
+
as documented in the template source.
|
|
42
25
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
To enable the interactive map, add your Mapbox token:
|
|
46
|
-
|
|
47
|
-
1. Get a free token at [mapbox.com](https://www.mapbox.com/).
|
|
48
|
-
2. Create `src/widgets/.env` and add:
|
|
49
|
-
```env
|
|
50
|
-
NEXT_PUBLIC_MAPBOX_TOKEN=pk.your_token_here
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## 🛠️ Commands
|
|
26
|
+
## Common Commands
|
|
56
27
|
|
|
57
28
|
```bash
|
|
58
|
-
# Start dev server with Studio integration
|
|
59
29
|
npm run dev
|
|
60
|
-
|
|
61
|
-
# Build for production
|
|
62
30
|
npm run build
|
|
63
|
-
|
|
64
|
-
# Manage widgets directly
|
|
31
|
+
npm start
|
|
65
32
|
npm run widget <command>
|
|
66
33
|
```
|
|
67
34
|
|
|
68
|
-
##
|
|
35
|
+
## NitroStudio
|
|
36
|
+
|
|
37
|
+
NitroStudio is the fastest way to test and debug interactive widget output.
|
|
38
|
+
|
|
39
|
+
- Download: <https://nitrostack.ai/studio>
|
|
40
|
+
- Studio: <https://nitrostack.ai/studio>
|
|
41
|
+
|
|
42
|
+
## Links
|
|
43
|
+
|
|
44
|
+
- Docs: <https://docs.nitrostack.ai>
|
|
45
|
+
- Widgets docs: <https://docs.nitrostack.ai/sdk/typescript/ui/widgets>
|
|
46
|
+
- Main repository: <https://github.com/nitrocloudofficial/nitrostack>
|
|
69
47
|
|
|
70
|
-
|
|
71
|
-
- `src/widgets/app/pizza-map/` — Next.js Map widget.
|
|
72
|
-
- `src/widgets/app/pizza-list/` — Filterable shop list.
|
|
73
|
-
- `src/widgets/app/pizza-shop/` — Detail view with actions.
|
|
48
|
+
## Community
|
|
74
49
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
50
|
+
- Discord: <https://discord.gg/uVWey6UhuD>
|
|
51
|
+
- X: <https://x.com/nitrostackai>
|
|
52
|
+
- YouTube: <https://www.youtube.com/@nitrostackai>
|
|
53
|
+
- LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
|
|
54
|
+
- GitHub: <https://github.com/nitrostackai>
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { ToolDecorator as Tool, Widget, ExecutionContext, Injectable, z } from '@nitrostack/core';
|
|
2
2
|
import { PizzazService } from './pizzaz.service.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Pizzaz widget metadata for ChatGPT / MCP Apps (CSP for Unsplash images, optional border).
|
|
6
|
+
* For production ChatGPT submission, set `domain` to your app HTTPS origin per OpenAI Apps SDK docs.
|
|
7
|
+
*/
|
|
8
|
+
function pizzazWidget(route: string) {
|
|
9
|
+
return {
|
|
10
|
+
route,
|
|
11
|
+
prefersBorder: true,
|
|
12
|
+
csp: {
|
|
13
|
+
resourceDomains: ['https://images.unsplash.com'],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
4
18
|
const ShowMapSchema = z.object({
|
|
5
19
|
filter: z.enum(['open_now', 'top_rated', 'all']).optional().describe('Filter to apply'),
|
|
6
20
|
});
|
|
@@ -67,7 +81,7 @@ export class PizzazTools {
|
|
|
67
81
|
}
|
|
68
82
|
}
|
|
69
83
|
})
|
|
70
|
-
@Widget('pizza-map')
|
|
84
|
+
@Widget(pizzazWidget('pizza-map'))
|
|
71
85
|
async showPizzaMap(args: z.infer<typeof ShowMapSchema>, ctx: ExecutionContext) {
|
|
72
86
|
let shops;
|
|
73
87
|
|
|
@@ -122,7 +136,7 @@ export class PizzazTools {
|
|
|
122
136
|
}
|
|
123
137
|
}
|
|
124
138
|
})
|
|
125
|
-
@Widget('pizza-list')
|
|
139
|
+
@Widget(pizzazWidget('pizza-list'))
|
|
126
140
|
async showPizzaList(args: z.infer<typeof ShowListSchema>, ctx: ExecutionContext) {
|
|
127
141
|
const shops = this.pizzazService.getShopsFiltered(args);
|
|
128
142
|
|
|
@@ -180,7 +194,7 @@ export class PizzazTools {
|
|
|
180
194
|
}
|
|
181
195
|
}
|
|
182
196
|
})
|
|
183
|
-
@Widget('pizza-shop')
|
|
197
|
+
@Widget(pizzazWidget('pizza-shop'))
|
|
184
198
|
async showPizzaShop(args: z.infer<typeof ShowShopSchema>, ctx: ExecutionContext) {
|
|
185
199
|
const shop = this.pizzazService.getShopById(args.shopId);
|
|
186
200
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
# NitroStack
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# =============================================================================
|
|
5
|
-
|
|
6
|
-
# Example:
|
|
7
|
-
# API_KEY=your_api_key_here
|
|
1
|
+
# NitroStack Configuration
|
|
2
|
+
NITRO_LOG_LEVEL=info
|
|
3
|
+
NITROSTACK_APP_MODE=openai
|
|
@@ -1,89 +1,49 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NitroStack Starter Template
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Minimal template for learning NitroStack fundamentals with a calculator-focused
|
|
4
|
+
MCP server and basic widgets.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## What This Template Includes
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
- `calculator` module with tools, resources, and prompts
|
|
9
|
+
- TypeScript + Zod validation setup
|
|
10
|
+
- Widget-ready project structure
|
|
11
|
+
- Production-friendly npm scripts
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
- **Interactive Tools** — A `calculate` tool for performing arithmetic operations.
|
|
11
|
-
- **Dynamic Resources** — A `calculator://operations` resource for discovering capabilities.
|
|
12
|
-
- **Prompt Library** — Context-aware prompts for guiding users.
|
|
13
|
-
- **Pre-built UI Widgets** — Beautiful, high-performance UI components for results and listings.
|
|
14
|
-
- **Production-Ready** — Uses TypeScript, Zod for validation, and best-in-class logging.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 🚀 Quick Start
|
|
19
|
-
|
|
20
|
-
### 1. Initialize Your Project
|
|
21
|
-
|
|
22
|
-
If you haven't already, scaffold your project using the NitroStack CLI:
|
|
13
|
+
## Quick Start
|
|
23
14
|
|
|
24
15
|
```bash
|
|
25
|
-
npx nitrostack init my-server --template typescript-starter
|
|
16
|
+
npx @nitrostack/cli init my-server --template typescript-starter
|
|
26
17
|
cd my-server
|
|
18
|
+
npm run dev
|
|
27
19
|
```
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Install all project dependencies (including the visual widget SDK) in one step:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm run install:all
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### 3. Get NitroStudio
|
|
38
|
-
|
|
39
|
-
NitroStudio is the recommended visual client for running, testing, and managing your NitroStack projects.
|
|
40
|
-
|
|
41
|
-

|
|
42
|
-
|
|
43
|
-
1. **Download NitroStudio**: [nitrostack.ai/studio](https://nitrostack.ai/studio)
|
|
44
|
-
2. **Open Project**: Launch NitroStudio and open this project folder.
|
|
45
|
-
3. **Run**: NitroStudio handles the rest!
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## 🛠️ Development
|
|
50
|
-
|
|
51
|
-
If you prefer using the command line:
|
|
21
|
+
## Common Commands
|
|
52
22
|
|
|
53
23
|
```bash
|
|
54
|
-
# Start development server (Server + Widgets + Studio)
|
|
55
24
|
npm run dev
|
|
56
|
-
|
|
57
|
-
# Build for production
|
|
58
25
|
npm run build
|
|
59
|
-
|
|
60
|
-
# Start production server
|
|
61
26
|
npm start
|
|
62
27
|
```
|
|
63
28
|
|
|
64
|
-
##
|
|
29
|
+
## NitroStudio
|
|
65
30
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
│ ├── calculator.tools.ts # @Tool implementations
|
|
72
|
-
│ ├── calculator.resources.ts # @Resource definitions
|
|
73
|
-
│ └── calculator.prompts.ts # @Prompt templates
|
|
74
|
-
├── widgets/ # Visual SDK UI components
|
|
75
|
-
├── app.module.ts # Root application module
|
|
76
|
-
└── index.ts # Server entry point
|
|
77
|
-
```
|
|
31
|
+
NitroStudio is the recommended way to test and debug this template during
|
|
32
|
+
development.
|
|
33
|
+
|
|
34
|
+
- Download: <https://nitrostack.ai/studio>
|
|
35
|
+
- Studio: <https://nitrostack.ai/studio>
|
|
78
36
|
|
|
79
|
-
##
|
|
37
|
+
## Links
|
|
80
38
|
|
|
81
|
-
|
|
39
|
+
- Docs: <https://docs.nitrostack.ai>
|
|
40
|
+
- Templates docs: <https://docs.nitrostack.ai/templates/01-starter-template>
|
|
41
|
+
- Main repository: <https://github.com/nitrocloudofficial/nitrostack>
|
|
82
42
|
|
|
83
|
-
|
|
84
|
-
- **Documentation**: [docs.nitrostack.ai](https://docs.nitrostack.ai)
|
|
85
|
-
- **Discord**: [Join our community](https://nitrostack.ai/discord)
|
|
43
|
+
## Community
|
|
86
44
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
45
|
+
- Discord: <https://discord.gg/uVWey6UhuD>
|
|
46
|
+
- X: <https://x.com/nitrostackai>
|
|
47
|
+
- YouTube: <https://www.youtube.com/@nitrostackai>
|
|
48
|
+
- LinkedIn: <https://linkedin.com/company/nitrostack-ai/>
|
|
49
|
+
- GitHub: <https://github.com/nitrostackai>
|