frontmcp 1.0.4 → 1.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 +10 -4
- package/src/commands/build/adapters/cloudflare.d.ts +1 -1
- package/src/commands/build/adapters/cloudflare.js +1 -0
- package/src/commands/build/adapters/cloudflare.js.map +1 -1
- package/src/commands/build/adapters/distributed.d.ts +15 -0
- package/src/commands/build/adapters/distributed.js +30 -0
- package/src/commands/build/adapters/distributed.js.map +1 -0
- package/src/commands/build/adapters/index.d.ts +3 -2
- package/src/commands/build/adapters/index.js +4 -1
- package/src/commands/build/adapters/index.js.map +1 -1
- package/src/commands/build/adapters/lambda.d.ts +1 -1
- package/src/commands/build/adapters/lambda.js +1 -0
- package/src/commands/build/adapters/lambda.js.map +1 -1
- package/src/commands/build/adapters/vercel.d.ts +1 -1
- package/src/commands/build/adapters/vercel.js +1 -0
- package/src/commands/build/adapters/vercel.js.map +1 -1
- package/src/commands/build/exec/cli-runtime/generate-cli-entry.js +122 -34
- package/src/commands/build/exec/cli-runtime/generate-cli-entry.js.map +1 -1
- package/src/commands/build/exec/config.d.ts +2 -2
- package/src/commands/build/exec/config.js.map +1 -1
- package/src/commands/build/exec/esbuild-bundler.d.ts +1 -1
- package/src/commands/build/exec/esbuild-bundler.js +1 -1
- package/src/commands/build/exec/esbuild-bundler.js.map +1 -1
- package/src/commands/build/exec/index.d.ts +1 -1
- package/src/commands/build/exec/index.js +5 -38
- package/src/commands/build/exec/index.js.map +1 -1
- package/src/commands/build/exec/skill-assets.d.ts +27 -0
- package/src/commands/build/exec/skill-assets.js +60 -0
- package/src/commands/build/exec/skill-assets.js.map +1 -0
- package/src/commands/build/index.d.ts +1 -1
- package/src/commands/build/index.js +44 -5
- package/src/commands/build/index.js.map +1 -1
- package/src/commands/build/mcpb/binary.d.ts +37 -0
- package/src/commands/build/mcpb/binary.js +72 -0
- package/src/commands/build/mcpb/binary.js.map +1 -0
- package/src/commands/build/mcpb/constants.d.ts +21 -0
- package/src/commands/build/mcpb/constants.js +31 -0
- package/src/commands/build/mcpb/constants.js.map +1 -0
- package/src/commands/build/mcpb/index.d.ts +20 -0
- package/src/commands/build/mcpb/index.js +241 -0
- package/src/commands/build/mcpb/index.js.map +1 -0
- package/src/commands/build/mcpb/manifest.d.ts +183 -0
- package/src/commands/build/mcpb/manifest.js +252 -0
- package/src/commands/build/mcpb/manifest.js.map +1 -0
- package/src/commands/build/mcpb/stage.d.ts +50 -0
- package/src/commands/build/mcpb/stage.js +94 -0
- package/src/commands/build/mcpb/stage.js.map +1 -0
- package/src/commands/build/mcpb/user-config.d.ts +26 -0
- package/src/commands/build/mcpb/user-config.js +147 -0
- package/src/commands/build/mcpb/user-config.js.map +1 -0
- package/src/commands/build/mcpb/validate.d.ts +27 -0
- package/src/commands/build/mcpb/validate.js +218 -0
- package/src/commands/build/mcpb/validate.js.map +1 -0
- package/src/commands/build/mcpb/zip.d.ts +37 -0
- package/src/commands/build/mcpb/zip.js +85 -0
- package/src/commands/build/mcpb/zip.js.map +1 -0
- package/src/commands/build/register.d.ts +1 -1
- package/src/commands/build/register.js +7 -1
- package/src/commands/build/register.js.map +1 -1
- package/src/commands/build/sdk/index.d.ts +1 -1
- package/src/commands/build/sdk/index.js +1 -1
- package/src/commands/build/sdk/index.js.map +1 -1
- package/src/commands/build/types.d.ts +1 -1
- package/src/commands/build/types.js.map +1 -1
- package/src/commands/mcpb/register.d.ts +2 -0
- package/src/commands/mcpb/register.js +14 -0
- package/src/commands/mcpb/register.js.map +1 -0
- package/src/commands/mcpb/validate.d.ts +1 -0
- package/src/commands/mcpb/validate.js +28 -0
- package/src/commands/mcpb/validate.js.map +1 -0
- package/src/commands/scaffold/create.js +5 -7
- package/src/commands/scaffold/create.js.map +1 -1
- package/src/config/define-config.d.ts +26 -0
- package/src/config/define-config.js +31 -0
- package/src/config/define-config.js.map +1 -0
- package/src/config/frontmcp-config.loader.d.ts +32 -0
- package/src/config/frontmcp-config.loader.js +113 -0
- package/src/config/frontmcp-config.loader.js.map +1 -0
- package/src/config/frontmcp-config.schema.d.ts +1062 -0
- package/src/config/frontmcp-config.schema.js +313 -0
- package/src/config/frontmcp-config.schema.js.map +1 -0
- package/src/config/frontmcp-config.types.d.ts +287 -0
- package/src/config/frontmcp-config.types.js +14 -0
- package/src/config/frontmcp-config.types.js.map +1 -0
- package/src/config/index.d.ts +5 -0
- package/src/config/index.js +13 -0
- package/src/config/index.js.map +1 -0
- package/src/core/args.d.ts +7 -2
- package/src/core/args.js +12 -2
- package/src/core/args.js.map +1 -1
- package/src/core/bridge.d.ts +1 -1
- package/src/core/bridge.js +10 -0
- package/src/core/bridge.js.map +1 -1
- package/src/core/cli.js +3 -1
- package/src/core/cli.js.map +1 -1
- package/src/core/program.js +15 -13
- package/src/core/program.js.map +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +7 -0
- package/src/index.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmcp-config.types.js","sourceRoot":"","sources":["../../../src/config/frontmcp-config.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * FrontMCP Configuration Types\n *\n * Defines the unified deployment configuration schema.\n * Used by `frontmcp.config.(json|yml|js|ts)` files.\n *\n * Separation of concerns:\n * - frontmcp.config = deployment (targets, server defaults, cookies, CSP)\n * - @FrontMcp() = runtime (auth, tools, resources, transport)\n * - Environment variables = secrets/overrides (Redis password, API keys)\n */\n\n// ============================================\n// Server Defaults\n// ============================================\n\nexport interface CorsConfig {\n /** Allowed origins. Empty array = permissive. */\n origins?: string[];\n /** Allow credentials (cookies, authorization headers). @default false */\n credentials?: boolean;\n /** Preflight cache max age in seconds. */\n maxAge?: number;\n}\n\nexport interface CspConfig {\n /** Enable CSP headers. @default false */\n enabled?: boolean;\n /** CSP directives (e.g., 'default-src': \"'self'\"). */\n directives?: Record<string, string | string[]>;\n /** Report URI for CSP violations. */\n reportUri?: string;\n /** Use Content-Security-Policy-Report-Only instead. @default false */\n reportOnly?: boolean;\n}\n\nexport interface CookiesConfig {\n /** LB affinity cookie name. @default '__frontmcp_node' */\n affinity?: string;\n /** Cookie domain. */\n domain?: string;\n /** SameSite policy. @default 'Strict' */\n sameSite?: 'Strict' | 'Lax' | 'None';\n}\n\nexport interface SecurityHeadersConfig {\n /** Strict-Transport-Security. Set to false to disable. */\n hsts?: string | false;\n /** X-Content-Type-Options. Set to false to disable. @default 'nosniff' */\n contentTypeOptions?: string | false;\n /** X-Frame-Options. Set to false to disable. @default 'DENY' */\n frameOptions?: string | false;\n /** Custom response headers. */\n custom?: Record<string, string>;\n}\n\n/**\n * HTTP options — aligns with `@FrontMcp({ http })`.\n *\n * Available on targets that serve HTTP:\n * - node, distributed: full (port + cors)\n * - vercel, lambda, cloudflare: no port (platform-managed), but cors applies\n * - browser, sdk, cli: not available\n */\nexport interface HttpConfig {\n /** HTTP port. Only for node/distributed. @default 3000 */\n port?: number;\n /** Unix socket path (alternative to port). Only for node/distributed. */\n socketPath?: string;\n /** MCP entry path ('' or '/mcp'). @default '' */\n entryPath?: string;\n /** CORS configuration. */\n cors?: CorsConfig;\n}\n\n/**\n * Server-level options for targets that handle HTTP responses.\n * Separated from HttpConfig because these apply even to serverless\n * targets that don't control the port (Cloudflare, Vercel, Lambda).\n */\nexport interface ServerDefaults {\n /** HTTP configuration (port, cors). */\n http?: HttpConfig;\n /** Content Security Policy. */\n csp?: CspConfig;\n /** Cookie configuration. */\n cookies?: CookiesConfig;\n /** Security headers. */\n headers?: SecurityHeadersConfig;\n}\n\n// ============================================\n// Build Options\n// ============================================\n\nexport interface EsbuildOptions {\n /** Dependencies to exclude from bundle. */\n external?: string[];\n /** Global defines. */\n define?: Record<string, string>;\n /** Build target (e.g., 'node22'). */\n target?: string;\n /** Minify output. */\n minify?: boolean;\n}\n\nexport interface BuildOptions {\n /** esbuild/bundler options. */\n esbuild?: EsbuildOptions;\n /** System/native dependencies for CLI packaging. */\n dependencies?: {\n system?: string[];\n nativeAddons?: string[];\n };\n /** Storage type for CLI setup. */\n storage?: {\n type: 'sqlite' | 'redis' | 'none';\n required?: boolean;\n };\n /** Network defaults. */\n network?: {\n defaultPort?: number;\n supportsSocket?: boolean;\n };\n}\n\n// ============================================\n// HA Configuration (distributed target only)\n// ============================================\n\nexport interface HaDeploymentConfig {\n /** Heartbeat interval in ms. @default 10000 */\n heartbeatIntervalMs?: number;\n /** Heartbeat TTL in ms (should be 2-3x interval). @default 30000 */\n heartbeatTtlMs?: number;\n /** Grace period before claiming orphaned sessions. @default 5000 */\n takeoverGracePeriodMs?: number;\n /** Redis key prefix for HA keys. @default 'mcp:ha:' */\n redisKeyPrefix?: string;\n}\n\n// ============================================\n// CLI Configuration (cli target only)\n// ============================================\n\nexport interface CliTargetConfig {\n /** CLI description. */\n description?: string;\n /** Default output format. @default 'text' */\n outputDefault?: 'text' | 'json';\n /** Require authentication for CLI. */\n authRequired?: boolean;\n /** Tools to exclude from CLI. */\n excludeTools?: string[];\n /** OAuth configuration for CLI authentication. */\n oauth?: {\n serverUrl?: string;\n clientId?: string;\n defaultScope?: string;\n portRange?: [number, number];\n };\n}\n\n// ============================================\n// Wrangler Configuration (cloudflare target only)\n// ============================================\n\nexport interface WranglerConfig {\n /** Worker name. */\n name?: string;\n /** Compatibility date. */\n compatibilityDate?: string;\n}\n\n// ============================================\n// Deployment Targets\n// ============================================\n\nexport type DeploymentTargetType =\n | 'node'\n | 'distributed'\n | 'cli'\n | 'vercel'\n | 'lambda'\n | 'cloudflare'\n | 'browser'\n | 'sdk'\n | 'mcpb';\n\ninterface DeploymentBase {\n /** Deployment target type. */\n target: DeploymentTargetType;\n /** Output directory override. @default 'dist/{target}' */\n outDir?: string;\n /** Environment variables injected at build time. */\n env?: Record<string, string>;\n}\n\nexport interface NodeDeployment extends DeploymentBase {\n target: 'node';\n /** Server config (http with port, csp, cookies, headers). */\n server?: ServerDefaults;\n}\n\nexport interface DistributedDeployment extends DeploymentBase {\n target: 'distributed';\n /** Server config (http with port, csp, cookies, headers). */\n server?: ServerDefaults;\n /** HA configuration. */\n ha?: HaDeploymentConfig;\n}\n\nexport interface CliDeployment extends DeploymentBase {\n target: 'cli';\n /** Output JS bundle instead of native binary. */\n js?: boolean;\n /** CLI-specific configuration. */\n cli?: CliTargetConfig;\n /** Single Executable Application settings. */\n sea?: { enabled?: boolean };\n}\n\nexport interface VercelDeployment extends DeploymentBase {\n target: 'vercel';\n /** Server config (no port — platform-managed, but cors/csp/cookies apply). */\n server?: ServerDefaults;\n}\n\nexport interface LambdaDeployment extends DeploymentBase {\n target: 'lambda';\n /** Server config (no port — platform-managed, but cors/csp/cookies apply). */\n server?: ServerDefaults;\n}\n\nexport interface CloudflareDeployment extends DeploymentBase {\n target: 'cloudflare';\n /** Server config (no port — platform-managed, but cors/csp/cookies apply). */\n server?: ServerDefaults;\n /** Wrangler configuration. */\n wrangler?: WranglerConfig;\n}\n\nexport interface BrowserDeployment extends DeploymentBase {\n target: 'browser';\n /** No server — browser bundles are client-side. */\n}\n\nexport interface SdkDeployment extends DeploymentBase {\n target: 'sdk';\n /** No server — SDK is a library. */\n}\n\n// ============================================\n// MCPB Deployment (MCP Bundle)\n// ============================================\n\nexport interface McpbAuthor {\n name: string;\n email?: string;\n url?: string;\n}\n\nexport type McpbUserConfigType = 'string' | 'number' | 'boolean' | 'directory' | 'file';\n\nexport interface McpbUserConfigEntry {\n type: McpbUserConfigType;\n title: string;\n description?: string;\n required?: boolean;\n default?: string | number | boolean;\n multiple?: boolean;\n sensitive?: boolean;\n min?: number;\n max?: number;\n}\n\nexport interface McpbCompatibility {\n /** Semver range for Claude Desktop (e.g., \">=1.0.0\"). */\n claude_desktop?: string;\n /** Supported platforms. */\n platforms?: Array<'darwin' | 'win32' | 'linux'>;\n /** Runtime version constraints. */\n runtimes?: {\n node?: string;\n python?: string;\n };\n}\n\nexport type McpbRepository = string | { type: string; url: string };\n\nexport interface McpbDeployment extends DeploymentBase {\n target: 'mcpb';\n /** Human-friendly display name. */\n displayName?: string;\n /** Long markdown description. */\n longDescription?: string;\n /** Author object — overrides parsed package.json.author. */\n author?: McpbAuthor;\n /** SPDX license identifier — overrides package.json.license. */\n license?: string;\n /** Project homepage URL. */\n homepage?: string;\n /** Source repository. */\n repository?: McpbRepository;\n /** Documentation URL. */\n documentation?: string;\n /** Support URL (issues/contact). */\n support?: string;\n /** Path to icon (PNG) relative to project root. */\n icon?: string;\n /** Keywords for search. */\n keywords?: string[];\n /** Privacy policy URLs. */\n privacyPolicies?: string[];\n /** Runtime/platform compatibility constraints. */\n compatibility?: McpbCompatibility;\n /** User-configurable inputs (injected as env vars). */\n userConfig?: Record<string, McpbUserConfigEntry>;\n /** Single-executable binary integration. */\n sea?: {\n /** Build SEA binary for host platform. */\n enabled?: boolean;\n /** Directory of pre-built cross-platform SEA binaries to merge. */\n mergeFrom?: string;\n };\n /** Include node_modules/ in archive (opt-in). */\n includeNodeModules?: boolean;\n /** Deterministic archive output. @default true */\n deterministic?: boolean;\n}\n\nexport type DeploymentTarget =\n | NodeDeployment\n | DistributedDeployment\n | CliDeployment\n | VercelDeployment\n | LambdaDeployment\n | CloudflareDeployment\n | BrowserDeployment\n | SdkDeployment\n | McpbDeployment;\n\n// ============================================\n// Top-Level Config\n// ============================================\n\nexport interface FrontMcpConfig {\n /** JSON Schema pointer for IDE autocomplete. */\n $schema?: string;\n /** Server name (alphanumeric, .-_ allowed). */\n name: string;\n /** Server version (semver). @default '1.0.0' */\n version?: string;\n /** Entry point file path. */\n entry?: string;\n /** Node.js version requirement. @default '>=22.0.0' */\n nodeVersion?: string;\n /** Build targets — server config lives inside each target that needs it. */\n deployments: DeploymentTarget[];\n /** Build/bundler options. */\n build?: BuildOptions;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { defineConfig } from './define-config';
|
|
2
|
+
export { loadFrontMcpConfig, validateConfig, findDeployment, getDeploymentTargets } from './frontmcp-config.loader';
|
|
3
|
+
export { frontmcpConfigSchema } from './frontmcp-config.schema';
|
|
4
|
+
export type { FrontMcpConfigParsed } from './frontmcp-config.schema';
|
|
5
|
+
export type { FrontMcpConfig, ServerDefaults, DeploymentTarget, DeploymentTargetType } from './frontmcp-config.types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontmcpConfigSchema = exports.getDeploymentTargets = exports.findDeployment = exports.validateConfig = exports.loadFrontMcpConfig = exports.defineConfig = void 0;
|
|
4
|
+
var define_config_1 = require("./define-config");
|
|
5
|
+
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return define_config_1.defineConfig; } });
|
|
6
|
+
var frontmcp_config_loader_1 = require("./frontmcp-config.loader");
|
|
7
|
+
Object.defineProperty(exports, "loadFrontMcpConfig", { enumerable: true, get: function () { return frontmcp_config_loader_1.loadFrontMcpConfig; } });
|
|
8
|
+
Object.defineProperty(exports, "validateConfig", { enumerable: true, get: function () { return frontmcp_config_loader_1.validateConfig; } });
|
|
9
|
+
Object.defineProperty(exports, "findDeployment", { enumerable: true, get: function () { return frontmcp_config_loader_1.findDeployment; } });
|
|
10
|
+
Object.defineProperty(exports, "getDeploymentTargets", { enumerable: true, get: function () { return frontmcp_config_loader_1.getDeploymentTargets; } });
|
|
11
|
+
var frontmcp_config_schema_1 = require("./frontmcp-config.schema");
|
|
12
|
+
Object.defineProperty(exports, "frontmcpConfigSchema", { enumerable: true, get: function () { return frontmcp_config_schema_1.frontmcpConfigSchema; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,mEAAoH;AAA3G,4HAAA,kBAAkB,OAAA;AAAE,wHAAA,cAAc,OAAA;AAAE,wHAAA,cAAc,OAAA;AAAE,8HAAA,oBAAoB,OAAA;AACjF,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA","sourcesContent":["export { defineConfig } from './define-config';\nexport { loadFrontMcpConfig, validateConfig, findDeployment, getDeploymentTargets } from './frontmcp-config.loader';\nexport { frontmcpConfigSchema } from './frontmcp-config.schema';\nexport type { FrontMcpConfigParsed } from './frontmcp-config.schema';\nexport type { FrontMcpConfig, ServerDefaults, DeploymentTarget, DeploymentTargetType } from './frontmcp-config.types';\n"]}
|
package/src/core/args.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type Command = 'dev' | 'build' | 'init' | 'doctor' | 'inspector' | 'create' | 'help' | 'version' | 'test' | 'socket' | 'start' | 'stop' | 'restart' | 'status' | 'list' | 'logs' | 'service' | 'install' | 'uninstall' | 'configure';
|
|
2
|
-
export type DeploymentAdapter = 'node' | 'vercel' | 'lambda' | 'cloudflare';
|
|
3
|
-
export type BuildTarget = 'cli' | 'node' | 'sdk' | 'browser' | 'cloudflare' | 'vercel' | 'lambda';
|
|
2
|
+
export type DeploymentAdapter = 'node' | 'vercel' | 'lambda' | 'cloudflare' | 'distributed';
|
|
3
|
+
export type BuildTarget = 'cli' | 'node' | 'sdk' | 'browser' | 'cloudflare' | 'vercel' | 'lambda' | 'distributed' | 'mcpb';
|
|
4
4
|
export declare function isDeploymentAdapter(val: string): val is DeploymentAdapter;
|
|
5
5
|
export declare function isBuildTarget(val: string): val is BuildTarget;
|
|
6
6
|
export type RedisSetupOption = 'docker' | 'existing' | 'none';
|
|
@@ -17,6 +17,11 @@ export interface ParsedArgs {
|
|
|
17
17
|
coverage?: boolean;
|
|
18
18
|
buildTarget?: BuildTarget;
|
|
19
19
|
js?: boolean;
|
|
20
|
+
sea?: boolean;
|
|
21
|
+
mergeFrom?: string;
|
|
22
|
+
icon?: string;
|
|
23
|
+
noDeterministic?: boolean;
|
|
24
|
+
stageOnly?: boolean;
|
|
20
25
|
yes?: boolean;
|
|
21
26
|
target?: DeploymentAdapter;
|
|
22
27
|
redis?: RedisSetupOption;
|
package/src/core/args.js
CHANGED
|
@@ -3,8 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isDeploymentAdapter = isDeploymentAdapter;
|
|
4
4
|
exports.isBuildTarget = isBuildTarget;
|
|
5
5
|
exports.parseArgs = parseArgs;
|
|
6
|
-
const DEPLOYMENT_ADAPTERS = ['node', 'vercel', 'lambda', 'cloudflare'];
|
|
7
|
-
const BUILD_TARGETS = [
|
|
6
|
+
const DEPLOYMENT_ADAPTERS = ['node', 'vercel', 'lambda', 'cloudflare', 'distributed'];
|
|
7
|
+
const BUILD_TARGETS = [
|
|
8
|
+
'cli',
|
|
9
|
+
'node',
|
|
10
|
+
'sdk',
|
|
11
|
+
'browser',
|
|
12
|
+
'cloudflare',
|
|
13
|
+
'vercel',
|
|
14
|
+
'lambda',
|
|
15
|
+
'distributed',
|
|
16
|
+
'mcpb',
|
|
17
|
+
];
|
|
8
18
|
function isDeploymentAdapter(val) {
|
|
9
19
|
return DEPLOYMENT_ADAPTERS.includes(val);
|
|
10
20
|
}
|
package/src/core/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../../src/core/args.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../../src/core/args.ts"],"names":[],"mappings":";;AAiDA,kDAEC;AAED,sCAEC;AAmDD,8BAiDC;AAvHD,MAAM,mBAAmB,GAAiC,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AACpH,MAAM,aAAa,GAA2B;IAC5C,KAAK;IACL,MAAM;IACN,KAAK;IACL,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,MAAM;CACP,CAAC;AAEF,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,OAAQ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AG,IAAI,CAAC;QACrC,gBAAgB;aACX,IAAI,CAAC,KAAK,YAAY;YAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;;YACjD,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["export type Command =\n | 'dev'\n | 'build'\n | 'init'\n | 'doctor'\n | 'inspector'\n | 'create'\n | 'help'\n | 'version'\n | 'test'\n | 'socket'\n // Process Manager commands\n | 'start'\n | 'stop'\n | 'restart'\n | 'status'\n | 'list'\n | 'logs'\n | 'service'\n // Package Manager commands\n | 'install'\n | 'uninstall'\n | 'configure';\n\nexport type DeploymentAdapter = 'node' | 'vercel' | 'lambda' | 'cloudflare' | 'distributed';\nexport type BuildTarget =\n | 'cli'\n | 'node'\n | 'sdk'\n | 'browser'\n | 'cloudflare'\n | 'vercel'\n | 'lambda'\n | 'distributed'\n | 'mcpb';\n\nconst DEPLOYMENT_ADAPTERS: readonly DeploymentAdapter[] = ['node', 'vercel', 'lambda', 'cloudflare', 'distributed'];\nconst BUILD_TARGETS: readonly BuildTarget[] = [\n 'cli',\n 'node',\n 'sdk',\n 'browser',\n 'cloudflare',\n 'vercel',\n 'lambda',\n 'distributed',\n 'mcpb',\n];\n\nexport function isDeploymentAdapter(val: string): val is DeploymentAdapter {\n return (DEPLOYMENT_ADAPTERS as readonly string[]).includes(val);\n}\n\nexport function isBuildTarget(val: string): val is BuildTarget {\n return (BUILD_TARGETS as readonly string[]).includes(val);\n}\n\nexport type RedisSetupOption = 'docker' | 'existing' | 'none';\nexport type PackageManagerOption = 'npm' | 'yarn' | 'pnpm';\n\nexport interface ParsedArgs {\n _: string[];\n outDir?: string;\n entry?: string;\n help?: boolean;\n runInBand?: boolean;\n watch?: boolean;\n verbose?: boolean;\n timeout?: number;\n coverage?: boolean;\n // Build --target flag (unified build target)\n buildTarget?: BuildTarget;\n // Build --js flag (cli target: produce JS bundle instead of SEA binary)\n js?: boolean;\n // MCPB flags\n sea?: boolean;\n mergeFrom?: string;\n icon?: string;\n noDeterministic?: boolean;\n stageOnly?: boolean;\n // Create command flags\n yes?: boolean;\n target?: DeploymentAdapter;\n redis?: RedisSetupOption;\n cicd?: boolean;\n pm?: PackageManagerOption;\n // Socket command flags\n socket?: string;\n db?: string;\n background?: boolean;\n // Process Manager flags\n port?: number;\n force?: boolean;\n maxRestarts?: number;\n follow?: boolean;\n lines?: number;\n // Install flags\n registry?: string;\n // Create --nx flag\n nx?: boolean;\n}\n\n/**\n * @deprecated Use commander-based parsing via {@link createProgram} instead.\n * Kept for backward compatibility and existing test coverage.\n */\nexport function parseArgs(argv: string[]): ParsedArgs {\n const out: ParsedArgs = { _: [] };\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n if (a === '--out-dir' || a === '-o') out.outDir = argv[++i];\n else if (a === '--entry' || a === '-e') out.entry = argv[++i];\n else if (a === '--help' || a === '-h') out.help = true;\n else if (a === '--runInBand' || a === '-i') out.runInBand = true;\n else if (a === '--watch' || a === '-w') out.watch = true;\n else if (a === '--verbose' || a === '-v') out.verbose = true;\n else if (a === '--timeout' || a === '-t') {\n const parsed = parseInt(argv[++i], 10);\n out.timeout = Number.isNaN(parsed) ? undefined : parsed;\n } else if (a === '--coverage' || a === '-c') out.coverage = true;\n // Create command flags\n else if (a === '--yes' || a === '-y') out.yes = true;\n else if (a === '--target') {\n const val = argv[++i];\n if (isDeploymentAdapter(val)) out.target = val;\n if (isBuildTarget(val)) out.buildTarget = val;\n } else if (a === '--redis') out.redis = argv[++i] as RedisSetupOption;\n else if (a === '--cicd') out.cicd = true;\n else if (a === '--no-cicd') out.cicd = false;\n else if (a === '--pm') out.pm = argv[++i] as PackageManagerOption;\n // Socket command flags\n else if (a === '--socket' || a === '-s') out.socket = argv[++i];\n else if (a === '--db') out.db = argv[++i];\n else if (a === '--background' || a === '-b') out.background = true;\n else if (a === '--js') out.js = true;\n // Process Manager flags\n else if (a === '--port' || a === '-p') {\n const parsed = parseInt(argv[++i], 10);\n out.port = Number.isNaN(parsed) ? undefined : parsed;\n } else if (a === '--force' || a === '-f') out.force = true;\n else if (a === '--max-restarts') {\n const parsed = parseInt(argv[++i], 10);\n out.maxRestarts = Number.isNaN(parsed) ? undefined : parsed;\n } else if (a === '--follow' || a === '-F') out.follow = true;\n else if (a === '--lines' || a === '-n') {\n const parsed = parseInt(argv[++i], 10);\n out.lines = Number.isNaN(parsed) ? undefined : parsed;\n }\n // Create --nx flag\n else if (a === '--nx') out.nx = true;\n // Install flags\n else if (a === '--registry') out.registry = argv[++i];\n else out._.push(a);\n }\n return out;\n}\n"]}
|
package/src/core/bridge.d.ts
CHANGED
package/src/core/bridge.js
CHANGED
|
@@ -18,6 +18,16 @@ function toParsedArgs(commandName, positionalArgs, options) {
|
|
|
18
18
|
out.buildTarget = options['target'];
|
|
19
19
|
if (options['js'] !== undefined)
|
|
20
20
|
out.js = options['js'];
|
|
21
|
+
if (options['sea'] !== undefined)
|
|
22
|
+
out.sea = options['sea'];
|
|
23
|
+
if (options['mergeFrom'] !== undefined)
|
|
24
|
+
out.mergeFrom = options['mergeFrom'];
|
|
25
|
+
if (options['icon'] !== undefined)
|
|
26
|
+
out.icon = options['icon'];
|
|
27
|
+
if (options['deterministic'] === false)
|
|
28
|
+
out.noDeterministic = true;
|
|
29
|
+
if (options['stageOnly'] !== undefined)
|
|
30
|
+
out.stageOnly = options['stageOnly'];
|
|
21
31
|
}
|
|
22
32
|
// Create
|
|
23
33
|
if (options['yes'] !== undefined)
|
package/src/core/bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/core/bridge.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/core/bridge.ts"],"names":[],"mappings":";;AAYA,oCAuDC;AA3DD;;;GAGG;AACH,S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I,OAAO,CAAC,MAAM,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAW,CAAC;IACxE,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAW,CAAC;IAC9E,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAW,CAAC;IAClE,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,YAAY,CAAY,CAAC;IAC3F,IAAI,OAAO,CAAC,aAAa,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC,aAAa,CAAW,CAAC;IAE7F,YAAY;IACZ,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAY,CAAC;IAE5E,YAAY;IACZ,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAY,CAAC;IAC/E,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAW,CAAC;IAE3E,kBAAkB;IAClB,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAW,CAAC;IAEpF,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {\n type BuildTarget,\n type DeploymentAdapter,\n type PackageManagerOption,\n type ParsedArgs,\n type RedisSetupOption,\n} from './args';\n\n/**\n * Convert commander's parsed command name, positional arguments, and options\n * into the {@link ParsedArgs} shape expected by existing handlers.\n */\nexport function toParsedArgs(\n commandName: string,\n positionalArgs: string[],\n options: Record<string, unknown>,\n): ParsedArgs {\n const out: ParsedArgs = { _: [commandName, ...positionalArgs] };\n\n // General\n if (options['outDir'] !== undefined) out.outDir = options['outDir'] as string;\n if (options['entry'] !== undefined) out.entry = options['entry'] as string;\n\n // Build --target resolution\n if (commandName === 'build') {\n if (options['target'] !== undefined) out.buildTarget = options['target'] as BuildTarget;\n if (options['js'] !== undefined) out.js = options['js'] as boolean;\n if (options['sea'] !== undefined) out.sea = options['sea'] as boolean;\n if (options['mergeFrom'] !== undefined) out.mergeFrom = options['mergeFrom'] as string;\n if (options['icon'] !== undefined) out.icon = options['icon'] as string;\n if (options['deterministic'] === false) out.noDeterministic = true;\n if (options['stageOnly'] !== undefined) out.stageOnly = options['stageOnly'] as boolean;\n }\n\n // Create\n if (options['yes'] !== undefined) out.yes = options['yes'] as boolean;\n if (commandName === 'create' && options['target'] !== undefined) out.target = options['target'] as DeploymentAdapter;\n if (options['redis'] !== undefined) out.redis = options['redis'] as RedisSetupOption;\n if (options['cicd'] !== undefined) out.cicd = options['cicd'] as boolean;\n if (options['pm'] !== undefined) out.pm = options['pm'] as PackageManagerOption;\n if (options['nx'] !== undefined) out.nx = options['nx'] as boolean;\n\n // Test\n if (options['runInBand'] !== undefined) out.runInBand = options['runInBand'] as boolean;\n if (options['watch'] !== undefined) out.watch = options['watch'] as boolean;\n if (options['verbose'] !== undefined) out.verbose = options['verbose'] as boolean;\n if (options['timeout'] !== undefined) out.timeout = options['timeout'] as number;\n if (options['coverage'] !== undefined) out.coverage = options['coverage'] as boolean;\n\n // PM - start / socket\n if (options['port'] !== undefined) out.port = options['port'] as number;\n if (options['socket'] !== undefined) out.socket = options['socket'] as string;\n if (options['db'] !== undefined) out.db = options['db'] as string;\n if (options['background'] !== undefined) out.background = options['background'] as boolean;\n if (options['maxRestarts'] !== undefined) out.maxRestarts = options['maxRestarts'] as number;\n\n // PM - stop\n if (options['force'] !== undefined) out.force = options['force'] as boolean;\n\n // PM - logs\n if (options['follow'] !== undefined) out.follow = options['follow'] as boolean;\n if (options['lines'] !== undefined) out.lines = options['lines'] as number;\n\n // Package manager\n if (options['registry'] !== undefined) out.registry = options['registry'] as string;\n\n return out;\n}\n"]}
|
package/src/core/cli.js
CHANGED
|
@@ -13,7 +13,9 @@ async function main() {
|
|
|
13
13
|
try {
|
|
14
14
|
const program = (0, program_1.createProgram)();
|
|
15
15
|
await program.parseAsync(process.argv);
|
|
16
|
-
process.exit(
|
|
16
|
+
// Defer process.exit() by one event-loop tick so native addon destructors
|
|
17
|
+
// (ONNX runtime, etc.) can release mutexes before V8 tears down.
|
|
18
|
+
setImmediate(() => process.exit(0));
|
|
17
19
|
}
|
|
18
20
|
catch (err) {
|
|
19
21
|
console.error('\n' + (0, colors_1.c)('red', err instanceof Error ? err.stack || err.message : String(err)));
|
package/src/core/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/core/cli.ts"],"names":[],"mappings":";;AACA;;;;;GAKG;;AAEH,uCAA0C;AAC1C,qCAA6B;AAE7B,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,uBAAa,GAAE,CAAC;QAChC,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/core/cli.ts"],"names":[],"mappings":";;AACA;;;;;GAKG;;AAEH,uCAA0C;AAC1C,qCAA6B;AAE7B,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,uBAAa,GAAE,CAAC;QAChC,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,0EAA0E;QAC1E,iEAAiE;QACjE,YAAY,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,IAAA,UAAC,EAAC,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC","sourcesContent":["#!/usr/bin/env node\n/**\n * frontmcp - FrontMCP command line interface\n *\n * Uses commander.js for argument parsing, command management, and\n * auto-generated help. Interactive TUI is handled by @clack/prompts.\n */\n\nimport { createProgram } from './program';\nimport { c } from './colors';\n\nasync function main(): Promise<void> {\n try {\n const program = createProgram();\n await program.parseAsync(process.argv);\n // Defer process.exit() by one event-loop tick so native addon destructors\n // (ONNX runtime, etc.) can release mutexes before V8 tears down.\n setImmediate(() => process.exit(0));\n } catch (err: unknown) {\n console.error('\\n' + c('red', err instanceof Error ? err.stack || err.message : String(err)));\n process.exit(1);\n }\n}\n\nmain();\n"]}
|
package/src/core/program.js
CHANGED
|
@@ -2,26 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createProgram = createProgram;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
5
|
+
const register_1 = require("../commands/build/register");
|
|
6
|
+
const register_2 = require("../commands/dev/register");
|
|
7
|
+
const register_3 = require("../commands/mcpb/register");
|
|
8
|
+
const register_4 = require("../commands/package/register");
|
|
9
|
+
const register_5 = require("../commands/pm/register");
|
|
10
|
+
const register_6 = require("../commands/scaffold/register");
|
|
11
|
+
const register_7 = require("../commands/skills/register");
|
|
12
12
|
const help_1 = require("./help");
|
|
13
|
+
const version_1 = require("./version");
|
|
13
14
|
function createProgram() {
|
|
14
15
|
const program = new commander_1.Command();
|
|
15
16
|
program
|
|
16
17
|
.name('frontmcp')
|
|
17
18
|
.description('Build, test, and deploy MCP servers with FrontMCP')
|
|
18
19
|
.version((0, version_1.getSelfVersion)(), '-V, --version');
|
|
19
|
-
(0,
|
|
20
|
-
(0,
|
|
21
|
-
(0,
|
|
22
|
-
(0,
|
|
23
|
-
(0,
|
|
24
|
-
(0,
|
|
20
|
+
(0, register_2.registerDevCommands)(program);
|
|
21
|
+
(0, register_1.registerBuildCommands)(program);
|
|
22
|
+
(0, register_6.registerScaffoldCommands)(program);
|
|
23
|
+
(0, register_5.registerPmCommands)(program);
|
|
24
|
+
(0, register_4.registerPackageCommands)(program);
|
|
25
|
+
(0, register_7.registerSkillsCommands)(program);
|
|
26
|
+
(0, register_3.registerMcpbCommands)(program);
|
|
25
27
|
(0, help_1.customizeHelp)(program);
|
|
26
28
|
return program;
|
|
27
29
|
}
|
package/src/core/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../../src/core/program.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../../src/core/program.ts"],"names":[],"mappings":";;AAYA,sCAkBC;AA9BD,yCAAoC;AAEpC,yDAAmE;AACnE,uDAA+D;AAC/D,wDAAiE;AACjE,2DAAuE;AACvE,sDAA6D;AAC7D,4DAAyE;AACzE,0DAAqE;AACrE,iCAAuC;AACvC,uCAA2C;AAE3C,SAAgB,aAAa;IAC3B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;IAE9B,OAAO;SACJ,IAAI,CAAC,UAAU,CAAC;SAChB,WAAW,CAAC,mDAAmD,CAAC;SAChE,OAAO,CAAC,IAAA,wBAAc,GAAE,EAAE,eAAe,CAAC,CAAC;IAE9C,IAAA,8BAAmB,EAAC,OAAO,CAAC,CAAC;IAC7B,IAAA,gCAAqB,EAAC,OAAO,CAAC,CAAC;IAC/B,IAAA,mCAAwB,EAAC,OAAO,CAAC,CAAC;IAClC,IAAA,6BAAkB,EAAC,OAAO,CAAC,CAAC;IAC5B,IAAA,kCAAuB,EAAC,OAAO,CAAC,CAAC;IACjC,IAAA,iCAAsB,EAAC,OAAO,CAAC,CAAC;IAChC,IAAA,+BAAoB,EAAC,OAAO,CAAC,CAAC;IAC9B,IAAA,oBAAa,EAAC,OAAO,CAAC,CAAC;IAEvB,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { Command } from 'commander';\n\nimport { registerBuildCommands } from '../commands/build/register';\nimport { registerDevCommands } from '../commands/dev/register';\nimport { registerMcpbCommands } from '../commands/mcpb/register';\nimport { registerPackageCommands } from '../commands/package/register';\nimport { registerPmCommands } from '../commands/pm/register';\nimport { registerScaffoldCommands } from '../commands/scaffold/register';\nimport { registerSkillsCommands } from '../commands/skills/register';\nimport { customizeHelp } from './help';\nimport { getSelfVersion } from './version';\n\nexport function createProgram(): Command {\n const program = new Command();\n\n program\n .name('frontmcp')\n .description('Build, test, and deploy MCP servers with FrontMCP')\n .version(getSelfVersion(), '-V, --version');\n\n registerDevCommands(program);\n registerBuildCommands(program);\n registerScaffoldCommands(program);\n registerPmCommands(program);\n registerPackageCommands(program);\n registerSkillsCommands(program);\n registerMcpbCommands(program);\n customizeHelp(program);\n\n return program;\n}\n"]}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeploymentTargets = exports.findDeployment = exports.loadFrontMcpConfig = exports.validateConfig = exports.defineConfig = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
tslib_1.__exportStar(require("./core"), exports);
|
|
6
|
+
var config_1 = require("./config");
|
|
7
|
+
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return config_1.defineConfig; } });
|
|
8
|
+
Object.defineProperty(exports, "validateConfig", { enumerable: true, get: function () { return config_1.validateConfig; } });
|
|
9
|
+
Object.defineProperty(exports, "loadFrontMcpConfig", { enumerable: true, get: function () { return config_1.loadFrontMcpConfig; } });
|
|
10
|
+
Object.defineProperty(exports, "findDeployment", { enumerable: true, get: function () { return config_1.findDeployment; } });
|
|
11
|
+
Object.defineProperty(exports, "getDeploymentTargets", { enumerable: true, get: function () { return config_1.getDeploymentTargets; } });
|
|
5
12
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iDAAuB;AACvB,mCAAkH;AAAzG,sGAAA,YAAY,OAAA;AAAE,wGAAA,cAAc,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAAE,wGAAA,cAAc,OAAA;AAAE,8GAAA,oBAAoB,OAAA","sourcesContent":["export * from './core';\nexport { defineConfig, validateConfig, loadFrontMcpConfig, findDeployment, getDeploymentTargets } from './config';\nexport type {\n FrontMcpConfig,\n FrontMcpConfigParsed,\n ServerDefaults,\n DeploymentTarget,\n DeploymentTargetType,\n} from './config';\n"]}
|