@nitrostack/cli 1.0.3 → 1.0.6
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/commands/generate.js +11 -11
- package/dist/commands/init.js +12 -12
- package/package.json +2 -2
- package/templates/typescript-oauth/package.json +1 -1
- package/templates/typescript-oauth/src/app.module.ts +1 -1
- package/templates/typescript-oauth/src/guards/oauth.guard.ts +1 -1
- package/templates/typescript-oauth/src/health/system.health.ts +1 -1
- package/templates/typescript-oauth/src/index.ts +1 -1
- package/templates/typescript-oauth/src/modules/flights/booking.tools.ts +3 -2
- package/templates/typescript-oauth/src/modules/flights/flights.module.ts +1 -1
- package/templates/typescript-oauth/src/modules/flights/flights.prompts.ts +3 -2
- package/templates/typescript-oauth/src/modules/flights/flights.resources.ts +3 -2
- package/templates/typescript-oauth/src/modules/flights/flights.tools.ts +3 -2
- package/templates/typescript-oauth/src/services/duffel.service.ts +1 -1
- package/templates/typescript-pizzaz/package.json +1 -1
- package/templates/typescript-pizzaz/src/app.module.ts +1 -1
- package/templates/typescript-pizzaz/src/index.ts +1 -1
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.module.ts +1 -1
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.service.ts +1 -1
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.tools.ts +3 -2
- package/templates/typescript-starter/package.json +1 -1
- package/templates/typescript-starter/src/app.module.ts +1 -1
- package/templates/typescript-starter/src/health/system.health.ts +1 -1
- package/templates/typescript-starter/src/index.ts +1 -1
- package/templates/typescript-starter/src/modules/calculator/calculator.module.ts +1 -1
- package/templates/typescript-starter/src/modules/calculator/calculator.prompts.ts +1 -1
- package/templates/typescript-starter/src/modules/calculator/calculator.resources.ts +1 -1
- package/templates/typescript-starter/src/modules/calculator/calculator.tools.ts +1 -1
- package/templates/typescript-oauth/.env.example +0 -27
|
@@ -6,7 +6,7 @@ import { createHeader, createSuccessBox, createErrorBox, log, spacer, nextSteps
|
|
|
6
6
|
* Generator templates
|
|
7
7
|
*/
|
|
8
8
|
const TEMPLATES = {
|
|
9
|
-
middleware: (name) => `import { Middleware, MiddlewareInterface, ExecutionContext } from 'nitrostack';
|
|
9
|
+
middleware: (name) => `import { Middleware, MiddlewareInterface, ExecutionContext } from '@nitrostack/core';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* ${name}
|
|
@@ -28,7 +28,7 @@ export class ${name} implements MiddlewareInterface {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
`,
|
|
31
|
-
interceptor: (name) => `import { Interceptor, InterceptorInterface, ExecutionContext } from 'nitrostack';
|
|
31
|
+
interceptor: (name) => `import { Interceptor, InterceptorInterface, ExecutionContext } from '@nitrostack/core';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* ${name}
|
|
@@ -49,7 +49,7 @@ export class ${name} implements InterceptorInterface {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
`,
|
|
52
|
-
pipe: (name) => `import { Pipe, PipeInterface, ArgumentMetadata } from 'nitrostack';
|
|
52
|
+
pipe: (name) => `import { Pipe, PipeInterface, ArgumentMetadata } from '@nitrostack/core';
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* ${name}
|
|
@@ -69,7 +69,7 @@ export class ${name} implements PipeInterface {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
`,
|
|
72
|
-
filter: (name) => `import { ExceptionFilter, ExceptionFilterInterface, ExecutionContext } from 'nitrostack';
|
|
72
|
+
filter: (name) => `import { ExceptionFilter, ExceptionFilterInterface, ExecutionContext } from '@nitrostack/core';
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* ${name}
|
|
@@ -93,7 +93,7 @@ export class ${name} implements ExceptionFilterInterface {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
`,
|
|
96
|
-
service: (name) => `import { Injectable } from 'nitrostack';
|
|
96
|
+
service: (name) => `import { Injectable } from '@nitrostack/core';
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* ${name}
|
|
@@ -129,7 +129,7 @@ export class ${name} {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
`,
|
|
132
|
-
guard: (name) => `import { Guard, ExecutionContext } from 'nitrostack';
|
|
132
|
+
guard: (name) => `import { Guard, ExecutionContext } from '@nitrostack/core';
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* ${name}
|
|
@@ -156,7 +156,7 @@ export class ${name} implements Guard {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
`,
|
|
159
|
-
health: (name) => `import { HealthCheck, HealthCheckInterface, HealthCheckResult } from 'nitrostack';
|
|
159
|
+
health: (name) => `import { HealthCheck, HealthCheckInterface, HealthCheckResult } from '@nitrostack/core';
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
162
|
* ${name}
|
|
@@ -187,7 +187,7 @@ export class ${name} implements HealthCheckInterface {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
`,
|
|
190
|
-
module: (name) => `import { Module } from 'nitrostack';
|
|
190
|
+
module: (name) => `import { Module } from '@nitrostack/core';
|
|
191
191
|
import { ${name}Tools } from './${name.toLowerCase()}.tools.js';
|
|
192
192
|
import { ${name}Resources } from './${name.toLowerCase()}.resources.js';
|
|
193
193
|
import { ${name}Prompts } from './${name.toLowerCase()}.prompts.js';
|
|
@@ -199,7 +199,7 @@ import { ${name}Prompts } from './${name.toLowerCase()}.prompts.js';
|
|
|
199
199
|
})
|
|
200
200
|
export class ${name}Module {}
|
|
201
201
|
`,
|
|
202
|
-
tools: (name) => `import { ToolDecorator as Tool, z, ExecutionContext, Injectable } from 'nitrostack';
|
|
202
|
+
tools: (name) => `import { ToolDecorator as Tool, z, ExecutionContext, Injectable } from '@nitrostack/core';
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* ${name} Tools
|
|
@@ -221,7 +221,7 @@ export class ${name}Tools {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
`,
|
|
224
|
-
resources: (name) => `import { ResourceDecorator as Resource, ExecutionContext } from 'nitrostack';
|
|
224
|
+
resources: (name) => `import { ResourceDecorator as Resource, ExecutionContext } from '@nitrostack/core';
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
227
|
* ${name} Resources
|
|
@@ -244,7 +244,7 @@ export class ${name}Resources {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
`,
|
|
247
|
-
prompts: (name) => `import { PromptDecorator as Prompt, ExecutionContext } from 'nitrostack';
|
|
247
|
+
prompts: (name) => `import { PromptDecorator as Prompt, ExecutionContext } from '@nitrostack/core';
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* ${name} Prompts
|
package/dist/commands/init.js
CHANGED
|
@@ -14,13 +14,13 @@ const __dirname = dirname(__filename);
|
|
|
14
14
|
*/
|
|
15
15
|
function isNitrostackFromNpm() {
|
|
16
16
|
try {
|
|
17
|
-
const result = execSync('npm list -g nitrostack --json', {
|
|
17
|
+
const result = execSync('npm list -g @nitrostack/cli --json', {
|
|
18
18
|
encoding: 'utf-8',
|
|
19
19
|
stdio: 'pipe'
|
|
20
20
|
});
|
|
21
21
|
const parsed = JSON.parse(result);
|
|
22
|
-
if (parsed.dependencies && parsed.dependencies
|
|
23
|
-
const nitrostackInfo = parsed.dependencies
|
|
22
|
+
if (parsed.dependencies && parsed.dependencies['@nitrostack/cli']) {
|
|
23
|
+
const nitrostackInfo = parsed.dependencies['@nitrostack/cli'];
|
|
24
24
|
return nitrostackInfo.version && !nitrostackInfo.resolved?.includes('file:');
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -154,19 +154,19 @@ export async function initCommand(projectName, options) {
|
|
|
154
154
|
const fromNpm = isNitrostackFromNpm();
|
|
155
155
|
const isLocalDev = isLocalDevelopment();
|
|
156
156
|
if (isLocalDev && !fromNpm) {
|
|
157
|
-
// Local development - link nitrostack
|
|
158
|
-
spinner = new NitroSpinner('Linking local nitrostack...').start();
|
|
157
|
+
// Local development - link @nitrostack/core
|
|
158
|
+
spinner = new NitroSpinner('Linking local @nitrostack/core...').start();
|
|
159
159
|
try {
|
|
160
|
-
execSync('npm link nitrostack', { cwd: targetDir, stdio: 'pipe' });
|
|
161
|
-
spinner.succeed('Local nitrostack linked');
|
|
160
|
+
execSync('npm link @nitrostack/core', { cwd: targetDir, stdio: 'pipe' });
|
|
161
|
+
spinner.succeed('Local @nitrostack/core linked');
|
|
162
162
|
}
|
|
163
163
|
catch {
|
|
164
|
-
spinner.warn('Failed to link nitrostack');
|
|
164
|
+
spinner.warn('Failed to link @nitrostack/core');
|
|
165
165
|
}
|
|
166
166
|
spinner = new NitroSpinner('Installing widget dependencies...').start();
|
|
167
167
|
try {
|
|
168
168
|
const widgetsDir = path.join(targetDir, 'src', 'widgets');
|
|
169
|
-
execSync('npm link nitrostack', { cwd: widgetsDir, stdio: 'pipe' });
|
|
169
|
+
execSync('npm link @nitrostack/core', { cwd: widgetsDir, stdio: 'pipe' });
|
|
170
170
|
execSync('npm install', { cwd: widgetsDir, stdio: 'pipe' });
|
|
171
171
|
spinner.succeed('Widget dependencies installed');
|
|
172
172
|
}
|
|
@@ -180,7 +180,7 @@ export async function initCommand(projectName, options) {
|
|
|
180
180
|
try {
|
|
181
181
|
const widgetsDir = path.join(targetDir, 'src', 'widgets');
|
|
182
182
|
execSync('npm install', { cwd: widgetsDir, stdio: 'pipe' });
|
|
183
|
-
execSync('npm install nitrostack@latest', { cwd: widgetsDir, stdio: 'pipe' });
|
|
183
|
+
execSync('npm install @nitrostack/core@latest', { cwd: widgetsDir, stdio: 'pipe' });
|
|
184
184
|
spinner.succeed('Widget dependencies installed');
|
|
185
185
|
}
|
|
186
186
|
catch {
|
|
@@ -238,7 +238,7 @@ async function createProjectFromScratch(targetDir, projectName, answers) {
|
|
|
238
238
|
start: 'node dist/index.js',
|
|
239
239
|
},
|
|
240
240
|
dependencies: {
|
|
241
|
-
nitrostack: '^1.0.0',
|
|
241
|
+
'@nitrostack/core': '^1.0.0',
|
|
242
242
|
dotenv: '^16.3.1',
|
|
243
243
|
},
|
|
244
244
|
devDependencies: {
|
|
@@ -264,7 +264,7 @@ async function createProjectFromScratch(targetDir, projectName, answers) {
|
|
|
264
264
|
};
|
|
265
265
|
fs.writeJSONSync(path.join(targetDir, 'tsconfig.json'), tsconfig, { spaces: 2 });
|
|
266
266
|
fs.mkdirSync(path.join(targetDir, 'src'), { recursive: true });
|
|
267
|
-
const indexTs = `import { createServer, createTool, z } from 'nitrostack';
|
|
267
|
+
const indexTs = `import { createServer, createTool, z } from '@nitrostack/core';
|
|
268
268
|
|
|
269
269
|
const server = createServer({
|
|
270
270
|
name: '${projectName}',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitrostack/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "CLI for NitroStack - Create and manage MCP server projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
"bugs": {
|
|
66
66
|
"url": "https://github.com/abhishekpanditofficial/nitrostack/issues"
|
|
67
67
|
},
|
|
68
|
-
"homepage": "https://nitrostack.
|
|
68
|
+
"homepage": "https://nitrostack.ai"
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpApp, Module, ConfigModule, OAuthModule } from 'nitrostack';
|
|
1
|
+
import { McpApp, Module, ConfigModule, OAuthModule } from '@nitrostack/core';
|
|
2
2
|
import { FlightsModule } from './modules/flights/flights.module.js';
|
|
3
3
|
import { SystemHealthCheck } from './health/system.health.js';
|
|
4
4
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ToolDecorator as Tool, Widget, ExecutionContext, z, UseGuards, Injectable } from 'nitrostack';
|
|
1
|
+
import { ToolDecorator as Tool, Widget, ExecutionContext, z, UseGuards, Injectable } from '@nitrostack/core';
|
|
2
2
|
import { OAuthGuard } from '../../guards/oauth.guard.js';
|
|
3
3
|
import { DuffelService } from '../../services/duffel.service.js';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Note: Using explicit deps for ESM compatibility
|
|
6
|
+
@Injectable({ deps: [DuffelService] })
|
|
6
7
|
export class BookingTools {
|
|
7
8
|
constructor(private duffelService: DuffelService) { }
|
|
8
9
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { PromptDecorator as Prompt, ExecutionContext, Injectable } from 'nitrostack';
|
|
1
|
+
import { PromptDecorator as Prompt, ExecutionContext, Injectable } from '@nitrostack/core';
|
|
2
2
|
import { DuffelService } from '../../services/duffel.service.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// Note: Using explicit deps for ESM compatibility
|
|
5
|
+
@Injectable({ deps: [DuffelService] })
|
|
5
6
|
export class FlightPrompts {
|
|
6
7
|
constructor(private duffelService: DuffelService) { }
|
|
7
8
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ResourceDecorator as Resource, ExecutionContext, z, Injectable } from 'nitrostack';
|
|
1
|
+
import { ResourceDecorator as Resource, ExecutionContext, z, Injectable } from '@nitrostack/core';
|
|
2
2
|
import { DuffelService } from '../../services/duffel.service.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// Note: Using explicit deps for ESM compatibility
|
|
5
|
+
@Injectable({ deps: [DuffelService] })
|
|
5
6
|
export class FlightResources {
|
|
6
7
|
constructor(private duffelService: DuffelService) { }
|
|
7
8
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ToolDecorator as Tool, Widget, ExecutionContext, z, UseGuards, Injectable } from 'nitrostack';
|
|
1
|
+
import { ToolDecorator as Tool, Widget, ExecutionContext, z, UseGuards, Injectable } from '@nitrostack/core';
|
|
2
2
|
import { OAuthGuard } from '../../guards/oauth.guard.js';
|
|
3
3
|
import { DuffelService } from '../../services/duffel.service.js';
|
|
4
4
|
import { format } from 'date-fns';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// Note: Using explicit deps for ESM compatibility
|
|
7
|
+
@Injectable({ deps: [DuffelService] })
|
|
7
8
|
export class FlightTools {
|
|
8
9
|
constructor(private duffelService: DuffelService) { }
|
|
9
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToolDecorator as Tool, Widget, ExecutionContext, Injectable, z } from 'nitrostack';
|
|
1
|
+
import { ToolDecorator as Tool, Widget, ExecutionContext, Injectable, z } from '@nitrostack/core';
|
|
2
2
|
import { PizzazService } from './pizzaz.service.js';
|
|
3
3
|
|
|
4
4
|
const ShowMapSchema = z.object({
|
|
@@ -15,7 +15,8 @@ const ShowShopSchema = z.object({
|
|
|
15
15
|
shopId: z.string().describe('ID of the pizza shop to display'),
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
// Note: Using explicit deps for ESM compatibility
|
|
19
|
+
@Injectable({ deps: [PizzazService] })
|
|
19
20
|
export class PizzazTools {
|
|
20
21
|
constructor(private readonly pizzazService: PizzazService) { }
|
|
21
22
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpApp, Module, ConfigModule } from 'nitrostack';
|
|
1
|
+
import { McpApp, Module, ConfigModule } from '@nitrostack/core';
|
|
2
2
|
import { CalculatorModule } from './modules/calculator/calculator.module.js';
|
|
3
3
|
import { SystemHealthCheck } from './health/system.health.js';
|
|
4
4
|
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# OAuth 2.1 MCP Server Configuration
|
|
3
|
-
# =============================================================================
|
|
4
|
-
# TRANSPORT MODE (AUTO-CONFIGURED)
|
|
5
|
-
# =============================================================================
|
|
6
|
-
# When OAuth is configured, the server automatically runs in DUAL mode:
|
|
7
|
-
# - STDIO: For MCP protocol communication with Studio/Claude
|
|
8
|
-
# - HTTP: For OAuth metadata endpoints (/.well-known/oauth-protected-resource)
|
|
9
|
-
# Both transports run simultaneously on different channels.
|
|
10
|
-
# =============================================================================
|
|
11
|
-
# REQUIRED: Server Configuration
|
|
12
|
-
# =============================================================================
|
|
13
|
-
# =============================================================================
|
|
14
|
-
# Auth0 Configuration
|
|
15
|
-
# =============================================================================
|
|
16
|
-
# After creating your API and Application in Auth0, fill in these values:
|
|
17
|
-
# Your Auth0 API Identifier (from APIs → MCP Server → Identifier)
|
|
18
|
-
# This MUST match exactly what you set when creating the API
|
|
19
|
-
RESOURCE_URI=https://mcplocal
|
|
20
|
-
# Your Auth0 tenant domain (authorization server)
|
|
21
|
-
AUTH_SERVER_URL=https://dev-5dt0utuk31h13tjm.us.auth0.com
|
|
22
|
-
# Expected token audience (should match RESOURCE_URI)
|
|
23
|
-
TOKEN_AUDIENCE=https://mcplocal
|
|
24
|
-
# Expected token issuer (your Auth0 tenant domain with trailing slash)
|
|
25
|
-
TOKEN_ISSUER=https://dev-5dt0utuk31h13tjm.us.auth0.com/
|
|
26
|
-
|
|
27
|
-
DUFFEL_API_KEY=duffel_test_-w0wGDHB0M3DU9k-sBeUbxLqwcibUQqfEbjWDTKNnlf
|