@nibgat/nmcp 0.0.0-stage → 2.0.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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -2
  3. package/dist/auth/vault.d.ts +83 -0
  4. package/dist/auth/vault.js +256 -0
  5. package/dist/auth/vault.js.map +1 -0
  6. package/dist/bin/nmcp.d.ts +2 -0
  7. package/dist/bin/nmcp.js +198 -0
  8. package/dist/bin/nmcp.js.map +1 -0
  9. package/dist/cli/configSnippets.d.ts +11 -0
  10. package/dist/cli/configSnippets.js +57 -0
  11. package/dist/cli/configSnippets.js.map +1 -0
  12. package/dist/config/constants.d.ts +31 -0
  13. package/dist/config/constants.js +46 -0
  14. package/dist/config/constants.js.map +1 -0
  15. package/dist/data/ecosystem.d.ts +187 -0
  16. package/dist/data/ecosystem.js +955 -0
  17. package/dist/data/ecosystem.js.map +1 -0
  18. package/dist/http/client.d.ts +31 -0
  19. package/dist/http/client.js +178 -0
  20. package/dist/http/client.js.map +1 -0
  21. package/dist/http/server.d.ts +17 -0
  22. package/dist/http/server.js +210 -0
  23. package/dist/http/server.js.map +1 -0
  24. package/dist/index.d.ts +8 -0
  25. package/dist/index.js +9 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/prompts/index.d.ts +2 -0
  28. package/dist/prompts/index.js +132 -0
  29. package/dist/prompts/index.js.map +1 -0
  30. package/dist/resources/index.d.ts +2 -0
  31. package/dist/resources/index.js +108 -0
  32. package/dist/resources/index.js.map +1 -0
  33. package/dist/security/redact.d.ts +2 -0
  34. package/dist/security/redact.js +183 -0
  35. package/dist/security/redact.js.map +1 -0
  36. package/dist/security/validators.d.ts +205 -0
  37. package/dist/security/validators.js +394 -0
  38. package/dist/security/validators.js.map +1 -0
  39. package/dist/server.d.ts +13 -0
  40. package/dist/server.js +44 -0
  41. package/dist/server.js.map +1 -0
  42. package/dist/tools/index.d.ts +7 -0
  43. package/dist/tools/index.js +1323 -0
  44. package/dist/tools/index.js.map +1 -0
  45. package/package.json +67 -5
@@ -0,0 +1,198 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { DEFAULT_CORE_URL, DEFAULT_GIT_URL, DEFAULT_HTTP_HOST, DEFAULT_HTTP_PORT, NMCP_DESCRIPTION, NMCP_NAME, NMCP_VERSION } from "../config/constants.js";
4
+ import { SUPPORTED_CLIENTS, buildClientConfigSnippet } from "../cli/configSnippets.js";
5
+ import { startNmcpHttpServer } from "../http/server.js";
6
+ import { safeUrlSchema } from "../security/validators.js";
7
+ import { createNmcpServer } from "../server.js";
8
+ const printHelp = () => {
9
+ const lines = [
10
+ `${NMCP_NAME} v${NMCP_VERSION} — ${NMCP_DESCRIPTION}`,
11
+ "",
12
+ "Usage:",
13
+ " nmcp [options]",
14
+ " npx -y @nibgat/nmcp [options]",
15
+ "",
16
+ "Options:",
17
+ " --read-only Disable all mutating/write MCP tools (safe read-only session)",
18
+ " --profile <name> Select named ncli credential profile (default: 'default')",
19
+ ` --core-url <url> Override Core Complex API base URL (default: ${DEFAULT_CORE_URL})`,
20
+ ` --git-url <url> Override N - Git API base URL (default: ${DEFAULT_GIT_URL})`,
21
+ " --http Start Streamable HTTP transport instead of stdio (requires NMCP_HTTP_TOKEN)",
22
+ ` --port <port> HTTP listen port when --http is enabled (default: ${DEFAULT_HTTP_PORT})`,
23
+ ` --host <host> HTTP listen host when --http is enabled (default: ${DEFAULT_HTTP_HOST})`,
24
+ ` --print-config <client> Print ready-to-paste MCP client JSON (${SUPPORTED_CLIENTS.join(" | ")})`,
25
+ " --version, -v Show version number",
26
+ " --help, -h Show this help text",
27
+ "",
28
+ "Environment Variables:",
29
+ " NCLI_TOKEN Bearer token for Core Complex APIs",
30
+ " NGIT_TOKEN N - Git Personal Access Token (ngit_pat_*)",
31
+ " NCLI_SESSION_COOKIE Active N - Auth SSO session cookie",
32
+ " NCLI_PROFILE Default credential profile name",
33
+ " NMCP_HTTP_TOKEN Required Bearer token (>= 16 chars) when running with --http",
34
+ "",
35
+ "Documentation: https://docs.nibgat.space/mcp"
36
+ ];
37
+ process.stdout.write(`${lines.join("\n")}\n`);
38
+ };
39
+ const parseCliArgs = (argv) => {
40
+ const parsed = {
41
+ readOnly: false,
42
+ version: false,
43
+ help: false,
44
+ http: false,
45
+ host: DEFAULT_HTTP_HOST,
46
+ port: DEFAULT_HTTP_PORT
47
+ };
48
+ const readNextValue = (index, flag) => {
49
+ const val = argv[index + 1];
50
+ if (!val || val.startsWith("-")) {
51
+ throw new Error(`Missing value for flag ${flag}.`);
52
+ }
53
+ return val;
54
+ };
55
+ for (let i = 0; i < argv.length; i++) {
56
+ const arg = argv[i] || "";
57
+ if (arg === "--help" || arg === "-h") {
58
+ parsed.help = true;
59
+ continue;
60
+ }
61
+ if (arg === "--version" || arg === "-v") {
62
+ parsed.version = true;
63
+ continue;
64
+ }
65
+ if (arg === "--read-only") {
66
+ parsed.readOnly = true;
67
+ continue;
68
+ }
69
+ if (arg === "--http") {
70
+ parsed.http = true;
71
+ continue;
72
+ }
73
+ if (arg === "--profile") {
74
+ parsed.profile = readNextValue(i, arg);
75
+ i += 1;
76
+ continue;
77
+ }
78
+ if (arg === "--core-url") {
79
+ const val = readNextValue(i, arg);
80
+ const check = safeUrlSchema.safeParse(val);
81
+ if (!check.success) {
82
+ throw new Error(`Invalid --core-url value: ${check.error.issues[0]?.message || "invalid URL"}`);
83
+ }
84
+ parsed.coreUrl = val;
85
+ i += 1;
86
+ continue;
87
+ }
88
+ if (arg === "--git-url") {
89
+ const val = readNextValue(i, arg);
90
+ const check = safeUrlSchema.safeParse(val);
91
+ if (!check.success) {
92
+ throw new Error(`Invalid --git-url value: ${check.error.issues[0]?.message || "invalid URL"}`);
93
+ }
94
+ parsed.gitUrl = val;
95
+ i += 1;
96
+ continue;
97
+ }
98
+ if (arg === "--port") {
99
+ const raw = readNextValue(i, arg);
100
+ const portNum = Number.parseInt(raw, 10);
101
+ if (!Number.isFinite(portNum) || portNum < 1 || portNum > 65535) {
102
+ throw new Error(`Invalid --port value: '${raw}'. Must be an integer between 1 and 65535.`);
103
+ }
104
+ parsed.port = portNum;
105
+ i += 1;
106
+ continue;
107
+ }
108
+ if (arg === "--host") {
109
+ parsed.host = readNextValue(i, arg);
110
+ i += 1;
111
+ continue;
112
+ }
113
+ if (arg === "--print-config") {
114
+ const rawClient = readNextValue(i, arg).trim().toLowerCase();
115
+ if (!SUPPORTED_CLIENTS.includes(rawClient)) {
116
+ throw new Error(`Unsupported client '${rawClient}'. Supported clients: ${SUPPORTED_CLIENTS.join(", ")}.`);
117
+ }
118
+ parsed.printConfig = rawClient;
119
+ i += 1;
120
+ continue;
121
+ }
122
+ throw new Error(`Unknown option: '${arg}'. Run 'nmcp --help' for usage.`);
123
+ }
124
+ return parsed;
125
+ };
126
+ const main = async () => {
127
+ let args;
128
+ try {
129
+ args = parseCliArgs(process.argv.slice(2));
130
+ }
131
+ catch (err) {
132
+ process.stderr.write(`Error: ${err instanceof Error ? err.message : String(err)}\n`);
133
+ process.exitCode = 1;
134
+ return;
135
+ }
136
+ if (args.help) {
137
+ printHelp();
138
+ return;
139
+ }
140
+ if (args.version) {
141
+ process.stdout.write(`${NMCP_VERSION}\n`);
142
+ return;
143
+ }
144
+ if (args.printConfig) {
145
+ const snippet = buildClientConfigSnippet(args.printConfig, {
146
+ readOnly: args.readOnly,
147
+ profile: args.profile
148
+ });
149
+ process.stdout.write(`${JSON.stringify(snippet.json, null, 4)}\n`);
150
+ return;
151
+ }
152
+ const serverOptions = {
153
+ readOnly: args.readOnly,
154
+ profile: args.profile,
155
+ coreUrl: args.coreUrl,
156
+ gitUrl: args.gitUrl
157
+ };
158
+ if (args.http) {
159
+ const httpToken = (process.env.NMCP_HTTP_TOKEN || "").trim();
160
+ const started = await startNmcpHttpServer({
161
+ createServer: () => createNmcpServer(serverOptions),
162
+ authToken: httpToken,
163
+ readOnly: args.readOnly,
164
+ host: args.host,
165
+ port: args.port
166
+ });
167
+ process.stderr.write(`[${NMCP_NAME} v${NMCP_VERSION}] Streamable HTTP MCP server listening on ${started.url} (readOnly=${String(args.readOnly)})\n`);
168
+ const shutdown = async () => {
169
+ await started.close().catch(() => { });
170
+ process.exit(0);
171
+ };
172
+ process.on("SIGINT", () => {
173
+ void shutdown();
174
+ });
175
+ process.on("SIGTERM", () => {
176
+ void shutdown();
177
+ });
178
+ return;
179
+ }
180
+ const server = createNmcpServer(serverOptions);
181
+ const transport = new StdioServerTransport();
182
+ await server.connect(transport);
183
+ const shutdown = async () => {
184
+ await server.close().catch(() => { });
185
+ process.exit(0);
186
+ };
187
+ process.on("SIGINT", () => {
188
+ void shutdown();
189
+ });
190
+ process.on("SIGTERM", () => {
191
+ void shutdown();
192
+ });
193
+ };
194
+ void main().catch((err) => {
195
+ process.stderr.write(`[${NMCP_NAME}] Fatal error: ${err instanceof Error ? err.message : String(err)}\n`);
196
+ process.exit(1);
197
+ });
198
+ //# sourceMappingURL=nmcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nmcp.js","sourceRoot":"","sources":["../../src/bin/nmcp.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,YAAY,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EAE3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAehD,MAAM,SAAS,GAAG,GAAS,EAAE;IACzB,MAAM,KAAK,GAAG;QACV,GAAG,SAAS,KAAK,YAA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ACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;YACvB,KAAK,QAAQ,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,OAAO;IACX,CAAC;IAED,MAAM,MAAM,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,MAAM,QAAQ,GAAG,KAAK,IAAmB,EAAE;QACvC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,KAAK,QAAQ,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,KAAK,QAAQ,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,SAAS,kBAAkB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export type SupportedClient = "antigravity" | "claude" | "cursor" | "opencode" | "windsurf";
2
+ export declare const SUPPORTED_CLIENTS: readonly SupportedClient[];
3
+ export interface IPrintConfigOptions {
4
+ readOnly?: boolean;
5
+ profile?: string;
6
+ }
7
+ export declare const buildClientConfigSnippet: (client: SupportedClient, options?: IPrintConfigOptions) => {
8
+ client: SupportedClient;
9
+ configPathHint: string;
10
+ json: Record<string, unknown>;
11
+ };
@@ -0,0 +1,57 @@
1
+ export const SUPPORTED_CLIENTS = [
2
+ "antigravity",
3
+ "claude",
4
+ "cursor",
5
+ "opencode",
6
+ "windsurf"
7
+ ];
8
+ export const buildClientConfigSnippet = (client, options = {}) => {
9
+ const args = [
10
+ "-y",
11
+ "@nibgat/nmcp"
12
+ ];
13
+ if (options.readOnly) {
14
+ args.push("--read-only");
15
+ }
16
+ if (options.profile && options.profile !== "default") {
17
+ args.push("--profile", options.profile);
18
+ }
19
+ if (client === "opencode") {
20
+ return {
21
+ client,
22
+ configPathHint: "opencode.json (or ~/.config/opencode/opencode.json)",
23
+ json: {
24
+ $schema: "https://opencode.ai/config.json",
25
+ mcp: {
26
+ nmcp: {
27
+ type: "local",
28
+ command: [
29
+ "npx",
30
+ ...args
31
+ ],
32
+ enabled: true
33
+ }
34
+ }
35
+ }
36
+ };
37
+ }
38
+ const pathHints = {
39
+ antigravity: "~/.gemini/antigravity/mcp_config.json",
40
+ claude: "claude_desktop_config.json",
41
+ cursor: ".cursor/mcp.json (or ~/.cursor/mcp.json)",
42
+ windsurf: "~/.codeium/windsurf/mcp_config.json"
43
+ };
44
+ return {
45
+ client,
46
+ configPathHint: pathHints[client],
47
+ json: {
48
+ mcpServers: {
49
+ nmcp: {
50
+ command: "npx",
51
+ args
52
+ }
53
+ }
54
+ }
55
+ };
56
+ };
57
+ //# sourceMappingURL=configSnippets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configSnippets.js","sourceRoot":"","sources":["../../src/cli/configSnippets.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,iBAAiB,GAA+B;IACzD,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;CACJ,CAAC;AAOX,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACpC,MAAuB,EACvB,UAA+B,EAAE,EAKnC,EAAE;IACA,MAAM,IAAI,GAAa;QACnB,IAAI;QACJ,cAAc;KACjB,CAAC;IAEF,IAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC7B,CAAC;IAED,IAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAClD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,IAAG,MAAM,KAAK,UAAU,EAAE,CAAC;QACvB,OAAO;YACH,MAAM;YACN,cAAc,EAAE,qDAAqD;YACrE,IAAI,EAAE;gBACF,OAAO,EAAE,iCAAiC;gBAC1C,GAAG,EAAE;oBACD,IAAI,EAAE;wBACF,IAAI,EAAE,OAAO;wBACb,OAAO,EAAE;4BACL,KAAK;4BACL,GAAG,IAAI;yBACV;wBACD,OAAO,EAAE,IAAI;qBAChB;iBACJ;aACJ;SACJ,CAAC;IACN,CAAC;IAED,MAAM,SAAS,GAAyD;QACpE,WAAW,EAAE,uCAAuC;QACpD,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,0CAA0C;QAClD,QAAQ,EAAE,qCAAqC;KAClD,CAAC;IAEF,OAAO;QACH,MAAM;QACN,cAAc,EAAE,SAAS,CAAC,MAAM,CAAC;QACjC,IAAI,EAAE;YACF,UAAU,EAAE;gBACR,IAAI,EAAE;oBACF,OAAO,EAAE,KAAK;oBACd,IAAI;iBACP;aACJ;SACJ;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ export declare const NMCP_NAME = "nmcp";
2
+ export declare const NMCP_VERSION = "1.0.0";
3
+ export declare const NMCP_DESCRIPTION = "N\u0130BGAT\u00AE Core-Complex Official Model Context Protocol (MCP) Server \u2014 AI Agent Bridge for Core Complex APIs, N - Git & ncli Pipelines";
4
+ export declare const DEFAULT_CORE_URL = "https://core.nibgat.space";
5
+ export declare const DEFAULT_GIT_URL = "https://git.nibgat.space";
6
+ export declare const DEFAULT_DOCS_URL = "https://docs.nibgat.space";
7
+ export declare const DEFAULT_HTTP_HOST = "127.0.0.1";
8
+ export declare const DEFAULT_HTTP_PORT = 3842;
9
+ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 10000;
10
+ export declare const HEALTH_CHECK_TIMEOUT_MS = 6000;
11
+ export declare const NCLI_HOME_DIR_NAME = ".ncli";
12
+ export declare const NCLI_VAULT_FILE_NAME = "credentials.enc";
13
+ export declare const NCLI_CONFIG_FILE_NAME = "config.json";
14
+ export declare const WRITE_TOOL_NAMES: Set<string>;
15
+ export declare const PUBLIC_HEALTH_TARGETS: readonly [{
16
+ readonly id: "core-api";
17
+ readonly name: "Core Complex API Gateway";
18
+ readonly url: "https://core.nibgat.space/healthcheck";
19
+ }, {
20
+ readonly id: "ngit-api";
21
+ readonly name: "N - Git Service API";
22
+ readonly url: "https://git.nibgat.space/api/v1/health";
23
+ }, {
24
+ readonly id: "docs-portal";
25
+ readonly name: "NİBGAT Documentation Portal";
26
+ readonly url: "https://docs.nibgat.space";
27
+ }, {
28
+ readonly id: "nfont-cdn";
29
+ readonly name: "N - Font Typography Service";
30
+ readonly url: "https://fonts.nibgat.space";
31
+ }];
@@ -0,0 +1,46 @@
1
+ export const NMCP_NAME = "nmcp";
2
+ export const NMCP_VERSION = "1.0.0";
3
+ export const NMCP_DESCRIPTION = "NİBGAT® Core-Complex Official Model Context Protocol (MCP) Server — AI Agent Bridge for Core Complex APIs, N - Git & ncli Pipelines";
4
+ export const DEFAULT_CORE_URL = "https://core.nibgat.space";
5
+ export const DEFAULT_GIT_URL = "https://git.nibgat.space";
6
+ export const DEFAULT_DOCS_URL = "https://docs.nibgat.space";
7
+ export const DEFAULT_HTTP_HOST = "127.0.0.1";
8
+ export const DEFAULT_HTTP_PORT = 3842;
9
+ export const DEFAULT_REQUEST_TIMEOUT_MS = 10_000;
10
+ export const HEALTH_CHECK_TIMEOUT_MS = 6_000;
11
+ export const NCLI_HOME_DIR_NAME = ".ncli";
12
+ export const NCLI_VAULT_FILE_NAME = "credentials.enc";
13
+ export const NCLI_CONFIG_FILE_NAME = "config.json";
14
+ export const WRITE_TOOL_NAMES = new Set([
15
+ "ngit_release_create",
16
+ "ngit_deployment_trigger",
17
+ "ngit_issue_create",
18
+ "nsupport_ticket_create",
19
+ "buyment_create_order",
20
+ "cloud_create_server",
21
+ "cloud_server_power",
22
+ "cloud_create_hardware_order"
23
+ ]);
24
+ export const PUBLIC_HEALTH_TARGETS = [
25
+ {
26
+ id: "core-api",
27
+ name: "Core Complex API Gateway",
28
+ url: "https://core.nibgat.space/healthcheck"
29
+ },
30
+ {
31
+ id: "ngit-api",
32
+ name: "N - Git Service API",
33
+ url: "https://git.nibgat.space/api/v1/health"
34
+ },
35
+ {
36
+ id: "docs-portal",
37
+ name: "NİBGAT Documentation Portal",
38
+ url: "https://docs.nibgat.space"
39
+ },
40
+ {
41
+ id: "nfont-cdn",
42
+ name: "N - Font Typography Service",
43
+ url: "https://fonts.nibgat.space"
44
+ }
45
+ ];
46
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,qIAAqI,CAAC;AAEtK,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAC1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAEnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS;IAC5C,qBAAqB;IACrB,yBAAyB;IACzB,mBAAmB;IACnB,wBAAwB;IACxB,sBAAsB;IACtB,qBAAqB;IACrB,oBAAoB;IACpB,6BAA6B;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC;QACI,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,0BAA0B;QAChC,GAAG,EAAE,uCAAuC;KAC/C;IACD;QACI,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,qBAAqB;QAC3B,GAAG,EAAE,wCAAwC;KAChD;IACD;QACI,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,6BAA6B;QACnC,GAAG,EAAE,2BAA2B;KACnC;IACD;QACI,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,6BAA6B;QACnC,GAAG,EAAE,4BAA4B;KACpC;CACK,CAAC"}
@@ -0,0 +1,187 @@
1
+ export interface IEcosystemService {
2
+ category: "gateway" | "identity" | "developer" | "communication" | "assets" | "portal" | "docs" | "commerce" | "cloud";
3
+ description: string;
4
+ docsUrl: string;
5
+ domain: string;
6
+ id: string;
7
+ name: string;
8
+ url: string;
9
+ }
10
+ export declare const PUBLIC_ECOSYSTEM_SERVICES: readonly IEcosystemService[];
11
+ export type NcliGuideTopic = "auth" | "pipeline" | "runner" | "git" | "registry" | "mail" | "support" | "profile" | "release" | "buyment" | "cloud";
12
+ export interface INcliCommandRecipe {
13
+ command: string;
14
+ description: string;
15
+ flags?: string[];
16
+ }
17
+ export interface INcliTopicGuide {
18
+ docsUrl: string;
19
+ prerequisites: string[];
20
+ recipes: INcliCommandRecipe[];
21
+ securityNotes: string[];
22
+ summary: string;
23
+ topic: NcliGuideTopic;
24
+ }
25
+ export declare const NCLI_COMMAND_GUIDES: Record<NcliGuideTopic, INcliTopicGuide>;
26
+ export declare const RESOURCE_ECOSYSTEM_ARCHITECTURE = "# N\u0130BGAT\u00AE Core Complex \u2014 Public Architecture Overview\n\n## 1. Domain & Service Map\n- **https://nibgat.space** \u2014 Corporate & public product showcase.\n- **https://core.nibgat.space** \u2014 Central Core Complex API Gateway (NGate) serving:\n - `/healthcheck` \u2014 Gateway liveness & readiness probe\n - `/nauth/*` \u2014 Identity, SSO sessions, OAuth 2.0, MFA/2FA\n - `/nchar/*` \u2014 User profile management & public developer profiles\n - `/nnotifier/*` \u2014 N - Mail domains, mailboxes, webmail, and user notifications\n - `/front/*` \u2014 Public announcements, products, legal documents, and N - Support tickets\n - `/organization/*` & `/static-data/*` \u2014 Public organization metadata and reference data\n- **https://nauth.nibgat.space** \u2014 N - Auth web login & SSO portal.\n- **https://nchar.nibgat.space** \u2014 N - Char account & profile portal.\n- **https://git.nibgat.space** \u2014 N - Git v2.0 platform:\n - Git Smart HTTP & SSH repository hosting\n - REST API at `/api/v1/*` (repos, issues, PRs, releases, deployments, runners, tokens, webhooks)\n - OCI Container Registry v2 at `/v2/*`\n- **https://mail.nibgat.space** \u2014 N - Mail webmail and mail domain workspace.\n- **https://support.nibgat.space** \u2014 N - Support ticket management portal.\n- **https://dashboard.nibgat.space** \u2014 Developer & user workspace dashboard.\n- **https://fonts.nibgat.space** \u2014 N - Font self-hosted typography CDN.\n- **https://cdn.nibgat.space** \u2014 Public edge CDN for media and static assets.\n- **https://ncore.nibgat.space** \u2014 NCore UI Kit 2.0 documentation & design system showcase.\n- **https://docs.nibgat.space** \u2014 Central developer documentation hub.\n- **https://cli.nibgat.space** \u2014 Official `ncli` CLI portal.\n- **https://mcp.nibgat.space** \u2014 Official `nmcp` MCP server portal.\n\n## 2. Authentication & Security Boundaries\n1. **N - Auth SSO Cookie (`nauth_sso_sid`)**: HttpOnly, SameSite=Lax, Secure cookie shared across trusted `*.nibgat.space` web origins.\n2. **Bearer Access Tokens**: Supported by Core Complex SSO/API endpoints (`Authorization: Bearer <token>`).\n3. **N - Git Personal Access Tokens (`ngit_pat_*`)**: SHA-256 hashed in RethinkDB, scoped (`repo:read`, `repo:write`, `registry:read`, `registry:write`).\n4. **N - Git Runner Tokens (`ngit_run_*`)**: Repository-scoped runner authentication for self-hosted CI/CD runners.\n5. **Local Encrypted Credential Vault**: `ncli` stores local credentials in `~/.ncli/credentials.enc` encrypted with AES-256-GCM; `nmcp` reuses this vault in read-only mode and redacts all secret material before returning tool outputs.\n\n## 3. Release-to-Deploy CI/CD Flow\n1. Developer commits a validated `.ngit-deploy.json` manifest at the repository root.\n2. Developer publishes a release via `ncli release create` or `ngit_release_create`.\n3. N - Git creates the annotated tag and dispatches an HMAC-SHA256 signed `X-NGit-Signature-256` webhook to the deployer / self-hosted runner.\n4. For `docker` pipelines: runner exports the exact Git archive, builds the container image, pushes `git.nibgat.space/<owner>/<image>:<tag>` and `:latest`, and performs a zero-downtime Docker Compose container recreate.\n5. For `static` pipelines: runner installs dependencies, runs the allowlisted `buildScript`, and atomically syncs `distDir` to `/var/www/<site>` via `rsync -a --delete`.\n6. Live stage transitions and logs stream to `GET /api/v1/repos/:owner/:repo/deployments`.\n";
27
+ export declare const RESOURCE_CLI_REFERENCE = "# ncli \u2014 Official N\u0130BGAT Core Complex CLI Reference\n\nDocumentation: https://docs.nibgat.space/cli\n\n## Installation\n```bash\nnpm install -g @nibgat/ncli\n# or run on demand:\nnpx @nibgat/ncli --help\n```\n\n## Global Flags & Environment Variables\n- `--profile <name>` / `NCLI_PROFILE`: Select named credential profile (default: `default`).\n- `--core-url <url>` / `NCLI_CORE_URL`: Override Core Complex API URL (default: `https://core.nibgat.space`).\n- `--git-url <url>` / `NCLI_GIT_URL`: Override N - Git API URL (default: `https://git.nibgat.space`).\n- `NCLI_TOKEN`: Bearer token for Core Complex APIs (takes precedence over vault).\n- `NGIT_TOKEN`: N - Git Personal Access Token (`ngit_pat_*`) for git.nibgat.space APIs.\n- `NCLI_SESSION_COOKIE`: Active N - Auth SSO session token/cookie for SSO endpoints.\n- `--json`: Machine-readable JSON output.\n\n## Command Tree\n### Authentication & Profiles\n- `ncli auth login [--profile <name>] [--token <pat>]`\n- `ncli auth status [--json]`\n- `ncli auth switch <profile>`\n- `ncli auth logout [--all]`\n\n### Profile (N - Char)\n- `ncli profile me`\n- `ncli profile show <username>`\n\n### N - Git Repositories, Issues & Releases\n- `ncli git repos list [--owner <slug>] [--query <q>]`\n- `ncli git repo info <owner>/<repo>`\n- `ncli git issues list <owner>/<repo> [--kind issue|pr] [--state open|closed|all]`\n- `ncli git issues create <owner>/<repo> --title <t> --body <b>`\n- `ncli release list <owner>/<repo>`\n- `ncli release create <owner>/<repo> --tag <vX.Y.Z> [--target main] [--title <t>] [--notes <md>]`\n\n### Pipelines & Deployments\n- `ncli pipeline init --type docker|static [...]`\n- `ncli pipeline validate [--file .ngit-deploy.json]`\n- `ncli pipeline status <owner>/<repo>`\n- `ncli deploy trigger <owner>/<repo> --ref <tag-or-branch>`\n\n### Self-Hosted Runners\n- `ncli runner init --repo <owner>/<repo> --name <runner>`\n- `ncli runner list --repo <owner>/<repo>`\n- `ncli runner start [--systemd]`\n- `ncli runner rotate-secret --repo <owner>/<repo>`\n\n### Container Registry (OCI v2)\n- `ncli registry login`\n- `ncli registry list [--owner <slug>]`\n\n### Mail & Support\n- `ncli mail domains list`\n- `ncli mail notifications list`\n- `ncli support list`\n- `ncli support create --subject <s> --description <d> [--category technical] [--priority normal]`\n";
28
+ export declare const PIPELINE_JSON_SCHEMA: {
29
+ $schema: string;
30
+ $id: string;
31
+ title: string;
32
+ description: string;
33
+ oneOf: ({
34
+ type: string;
35
+ additionalProperties: boolean;
36
+ required: string[];
37
+ properties: {
38
+ type: {
39
+ const: string;
40
+ };
41
+ image: {
42
+ type: string;
43
+ pattern: string;
44
+ description: string;
45
+ };
46
+ dockerfile: {
47
+ type: string;
48
+ default: string;
49
+ description: string;
50
+ };
51
+ context: {
52
+ type: string;
53
+ default: string;
54
+ description: string;
55
+ };
56
+ target: {
57
+ type: string;
58
+ pattern: string;
59
+ description: string;
60
+ };
61
+ composeService: {
62
+ type: string;
63
+ pattern: string;
64
+ description: string;
65
+ };
66
+ composeProject: {
67
+ type: string;
68
+ pattern: string;
69
+ };
70
+ composeDir: {
71
+ type: string;
72
+ pattern: string;
73
+ };
74
+ composeFiles: {
75
+ type: string;
76
+ maxItems: number;
77
+ items: {
78
+ type: string;
79
+ pattern: string;
80
+ };
81
+ };
82
+ onPush: {
83
+ type: string;
84
+ default: boolean;
85
+ };
86
+ branch: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ healthcheckUrl: {
91
+ type: string;
92
+ format: string;
93
+ };
94
+ timeoutSeconds: {
95
+ type: string;
96
+ minimum: number;
97
+ maximum: number;
98
+ };
99
+ buildScript?: undefined;
100
+ packageManager?: undefined;
101
+ distDir?: undefined;
102
+ targetDir?: undefined;
103
+ };
104
+ } | {
105
+ type: string;
106
+ additionalProperties: boolean;
107
+ required: string[];
108
+ properties: {
109
+ type: {
110
+ const: string;
111
+ };
112
+ buildScript: {
113
+ type: string;
114
+ default: string;
115
+ pattern: string;
116
+ description: string;
117
+ };
118
+ packageManager: {
119
+ type: string;
120
+ enum: string[];
121
+ default: string;
122
+ };
123
+ distDir: {
124
+ type: string;
125
+ default: string;
126
+ description: string;
127
+ };
128
+ targetDir: {
129
+ type: string;
130
+ pattern: string;
131
+ description: string;
132
+ };
133
+ onPush: {
134
+ type: string;
135
+ default: boolean;
136
+ };
137
+ branch: {
138
+ type: string;
139
+ description?: undefined;
140
+ };
141
+ healthcheckUrl: {
142
+ type: string;
143
+ format: string;
144
+ };
145
+ timeoutSeconds: {
146
+ type: string;
147
+ minimum: number;
148
+ maximum: number;
149
+ };
150
+ image?: undefined;
151
+ dockerfile?: undefined;
152
+ context?: undefined;
153
+ target?: undefined;
154
+ composeService?: undefined;
155
+ composeProject?: undefined;
156
+ composeDir?: undefined;
157
+ composeFiles?: undefined;
158
+ };
159
+ })[];
160
+ securityRules: string[];
161
+ examples: {
162
+ docker: {
163
+ type: string;
164
+ image: string;
165
+ dockerfile: string;
166
+ context: string;
167
+ target: string;
168
+ composeService: string;
169
+ onPush: boolean;
170
+ healthcheckUrl: string;
171
+ };
172
+ static: {
173
+ type: string;
174
+ packageManager: string;
175
+ buildScript: string;
176
+ distDir: string;
177
+ targetDir: string;
178
+ onPush: boolean;
179
+ healthcheckUrl: string;
180
+ };
181
+ };
182
+ };
183
+ export declare const RESOURCE_API_CATALOG = "# N\u0130BGAT\u00AE Core Complex \u2014 Public REST API Catalog\n\n## 1. Core Complex Gateway (`https://core.nibgat.space`)\n\n### Health\n- `GET /healthcheck` \u2014 Gateway health & service status (public)\n\n### N - Auth (Identity & SSO)\n- `GET /nauth/sso/session` \u2014 Inspect active SSO session\n- `GET /nauth/sso/sessions` \u2014 List active sessions for authenticated user\n- `POST /nauth/sso/logout` \u2014 End active SSO session\n- `GET /nauth/oauth/userinfo` \u2014 OpenID / OAuth2 userinfo endpoint\n- `GET /nauth/presence/public` \u2014 Public presence lookup\n\n### N - Char (Profiles)\n- `GET /nchar/sso/me` \u2014 Authenticated user's full N - Char profile\n- `PUT /nchar/sso/profile` \u2014 Update profile details\n- `GET /nchar/public/profile/:userName` \u2014 Public developer profile lookup (no auth required)\n\n### N - Notifier & N - Mail\n- `GET /nnotifier/sso/domains` \u2014 List mail domains (query: `organizationID`, `appID`)\n- `GET /nnotifier/sso/mailboxes` \u2014 List mailboxes (query: `domain`, `includeUsage`)\n- `GET /nnotifier/sso/aliases` \u2014 List mail aliases\n- `GET /nnotifier/sso/notifications` \u2014 List user notifications\n- `POST /nnotifier/sso/notifications/read` \u2014 Mark notification read\n\n### Front & N - Support\n- `GET /front/products` & `GET /front/services` & `GET /front/news` & `GET /front/announcements` \u2014 Public content feeds\n- `GET /front/sso/tickets` \u2014 List authenticated user's support tickets\n- `GET /front/sso/tickets/quota` \u2014 Ticket quota status\n- `GET /front/sso/tickets/:id` \u2014 Ticket details and replies\n- `POST /front/sso/tickets` \u2014 Create a new support ticket\n- `POST /front/sso/tickets/:id/replies` \u2014 Reply to a support ticket\n\n## 2. N - Git Platform (`https://git.nibgat.space/api/v1`)\n\n### Health & Identity\n- `GET /api/v1/health` \u2014 N - Git service, RethinkDB, and storage health\n- `GET /api/v1/me` \u2014 Active N - Git user, scopes, and auth method\n- `GET /api/v1/overview` \u2014 User dashboard overview & accessible repositories\n- `GET /api/v1/quota` \u2014 Repository quota status\n\n### Repositories, Branches & Code\n- `GET /api/v1/repos` \u2014 List repositories (query: `owner`, `q`)\n- `POST /api/v1/repos` \u2014 Create repository\n- `GET /api/v1/repos/:owner/:repo` \u2014 Repository metadata, branches, tags, counts\n- `GET /api/v1/repos/:owner/:repo/readme` \u2014 Rendered/raw README\n- `GET /api/v1/repos/:owner/:repo/branches` \u2014 Detailed branch list\n- `GET /api/v1/repos/:owner/:repo/commits` \u2014 Commit history\n\n### Releases, Deployments & Runners\n- `GET /api/v1/repos/:owner/:repo/releases` \u2014 List releases\n- `POST /api/v1/repos/:owner/:repo/releases` \u2014 Publish a release & trigger webhooks\n- `GET /api/v1/repos/:owner/:repo/deployments` \u2014 List recent CI/CD deployment runs & logs\n- `POST /api/v1/repos/:owner/:repo/deployments/trigger` \u2014 Manually trigger deployment for a ref\n- `GET /api/v1/repos/:owner/:repo/runners` \u2014 List self-hosted runners for a repository\n\n### Issues & Pull Requests\n- `GET /api/v1/repos/:owner/:repo/issues` \u2014 List issues & PRs (query: `kind`, `state`)\n- `POST /api/v1/repos/:owner/:repo/issues` \u2014 Create an issue or pull request\n\n### OCI Container Registry\n- `GET /api/v1/registry/repositories` \u2014 List OCI images, tags, digests, and pull commands\n- `DELETE /api/v1/registry/:owner/:image/tags/:tag` \u2014 Delete an OCI image tag\n\n## 3. N - Buyment Commerce & Billing (`https://core.nibgat.space/nbuyment`)\n- `GET /nbuyment/catalog` \u2014 Public product, plan, and VAT-inclusive TRY pricing catalog\n- `GET /nbuyment/sso/wallet` \u2014 Prepaid TRY wallet balance & double-entry ledger\n- `POST /nbuyment/sso/wallet/topup` \u2014 Initiate PayTR card or Bank Transfer wallet top-up\n- `GET /nbuyment/sso/orders` & `POST /nbuyment/sso/orders` \u2014 Order history & checkout\n- `GET /nbuyment/sso/subscriptions` \u2014 Active recurring subscriptions\n- `GET /nbuyment/sso/invoices` \u2014 Automated e-Fatura & e-Ar\u015Fiv invoices\n\n## 4. N - Cloud Infrastructure & Hardware (`https://core.nibgat.space/ncloud`)\n- `GET /ncloud/regions` \u2014 Global 7-region status map (`tr-ist-1` active; EU/US/AP coming soon)\n- `GET /ncloud/catalog` \u2014 Live cloud server, S3, container & physical hardware pricing\n- `GET /ncloud/sso/overview` \u2014 Wallet balance, active resources & estimated monthly spend\n- `GET /ncloud/sso/resources` & `POST /ncloud/sso/resources` \u2014 Manage N - Run, N - Storage, N - Net, N - Vault\n- `POST /ncloud/sso/servers` & `POST /ncloud/sso/servers/:id/power` \u2014 Deploy & control N - Compute servers\n- `GET /ncloud/sso/hardware/orders` & `POST /ncloud/sso/hardware/orders` \u2014 N - Metal rentals & N - Hardware purchases\n";
184
+ export declare const RESOURCE_BUYMENT_CATALOG = "# N\u0130BGAT\u00AE N - Buyment \u2014 Billing, Wallet & e-Invoicing Reference\n\nPortal: https://buyment.nibgat.space\nAPI Base: https://core.nibgat.space/nbuyment\n\n## Supported Commerce Modes\n- **Prepaid TRY Wallet**: Double-entry integer-kurus ledger used by N - Cloud hourly/monthly provisioning and instant add-ons.\n- **Recurring Subscriptions**: Monthly, semiannual, annual, and biennial plans across N - Git, N - Mail, N - Char, N - Element, and N - Cloud.\n- **One-Time Purchases**: Physical hardware orders (N - Hardware) and one-time add-ons.\n- **Payment Methods**: PayTR Card (iFrame & tokenized recurring) and Bank Transfer / EFT.\n- **Automated e-Invoicing**: Trendyol e-Faturam REST integration automatically issuing e-Fatura or e-Ar\u015Fiv invoices with integer kurus precision.\n";
185
+ export declare const RESOURCE_CLOUD_REGIONS = "# N\u0130BGAT\u00AE N - Cloud \u2014 Global Region Availability\n\n| Region Code | Location | Status | Orderable |\n| --- | --- | --- | --- |\n| `tr-ist-1` | \u0130stanbul, T\u00FCrkiye | **active** | Yes (~4 ms TR) |\n| `eu-de-1` | Falkenstein, Germany | coming_soon | Disabled (\u00C7ok Yak\u0131nda) |\n| `eu-de-2` | Nuremberg, Germany | coming_soon | Disabled (\u00C7ok Yak\u0131nda) |\n| `eu-fi-1` | Helsinki, Finland | coming_soon | Disabled (\u00C7ok Yak\u0131nda) |\n| `us-east-1` | Ashburn, United States | coming_soon | Disabled (\u00C7ok Yak\u0131nda) |\n| `us-west-1` | Hillsboro, United States | coming_soon | Disabled (\u00C7ok Yak\u0131nda) |\n| `ap-sg-1` | Singapore | coming_soon | Disabled (\u00C7ok Yak\u0131nda) |\n";
186
+ export declare const RESOURCE_CLOUD_CATALOG = "# N\u0130BGAT\u00AE N - Cloud \u2014 Cloud (70%) & Physical Hardware (30%) Portfolio\n\nPortal: https://cloud.nibgat.space\nAPI Base: https://core.nibgat.space/ncloud\n\n## Cloud Services (70%)\n- **N - Compute**: NVMe KVM Cloud Servers & Dedicated-Resource VDS in `tr-ist-1`.\n- **N - Run**: Managed container & serverless runtime environments.\n- **N - Storage**: S3-compatible object storage with lifecycle & lock support.\n- **N - Net**: Private VPC networks, port forwarding, and DNS zones.\n- **N - Vault**: Encrypted SFTP/Borg backup storage.\n\n## Physical Hardware (30%)\n- **N - Metal**: Dedicated bare-metal server rentals in Istanbul Tier-3 data center.\n- **N - Hardware**: Turnkey enterprise rack servers, AI GPU nodes, and workstations delivered via insured shipping or Istanbul colocation.\n";
187
+ export declare const RESOURCE_NCORE_STANDARDS = "# N\u0130BGAT\u00AE NCore UI Kit 2.0 & Frontend Engineering Standards\n\nDocumentation: https://ncore.nibgat.space\n\n## 1. Directory & Index Pattern\n- Every page, view, or reusable component lives in its own folder.\n- Main component entry MUST be `index.tsx` (never `Component.tsx`).\n- Component styles MUST live in sibling `stylesheet.ts` using `StyleSheet.create({...})` (never inline style hooks like `useStyles`).\n- Local type definitions MUST live in `type.ts` (singular, never `types.ts`).\n- Complex pages organize sub-sections inside `views/<section>/index.tsx`.\n\n## 2. Theme-First & Spacious-Only Rule\n- **Theme-First**: Always read tokens from `NCoreUIKitTheme.useContext()` (`colors`, `spaces`, `radiuses`, `configs`) before defining any custom values.\n- **Spacious Only (Mandatory)**: `initialSelectedGapPropagation` MUST ALWAYS be `\"spacious\"`. Never use `\"compact\"` gapPropagation or shrink primary buttons/inputs unnecessarily.\n- **Localization**: Always read user-facing text through `NCoreUIKitLocalize.useContext()` via `localize(\"key\")`.\n- **Web CSS**: Use NCore's `webStyle` utility for web-only CSS properties.\n- **NCore Primitives**: Prefer `PageContainer`, `MainHeader`, `Text`, `HighlightButton`, `Button`, `ThemeSwitcher`, `LocaleSwitcher`, and `NCoreUIKitMenu` over raw React Native primitives.\n\n## 3. Code Style & Formatting\n- 4-space indentation everywhere (including JSX props and `switch` cases), semicolons always, newline at EOF.\n- **Strict Multiline**: Every imported/exported symbol, destructured object property, array element (including `useState` tuples), and JSX prop goes on its own line.\n- **Longest-to-Shortest Ordering**: Sort imports, destructured members, object properties, and JSX props from longest line/identifier to shortest unless logic requires another order.\n- **Fail Fast**: Use early returns and write `if(!condition) {` with no space between `if` and `(`.\n- **Default Type Export**:\n```ts\nexport type {\n MyProps as default\n};\n```\n- **Default Value Export**: Stick `export default Component;` directly after the closing brace with no blank line.\n- **Post-Edit Validation**: Always run `yarn lint` and `yarn type-check` after frontend edits.\n";