@toolfactory.dev/core 1.0.0-rc
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/LICENSE +21 -0
- package/README.md +88 -0
- package/out/codegen/access-stubs.d.ts +2 -0
- package/out/codegen/access-stubs.js +6 -0
- package/out/codegen/auth-module-names.d.ts +11 -0
- package/out/codegen/auth-module-names.js +34 -0
- package/out/codegen/auth-pipeline-render.d.ts +10 -0
- package/out/codegen/auth-pipeline-render.js +157 -0
- package/out/codegen/auth-stub-bootstrap.d.ts +42 -0
- package/out/codegen/auth-stub-bootstrap.js +252 -0
- package/out/codegen/document-validation.d.ts +22 -0
- package/out/codegen/document-validation.js +76 -0
- package/out/codegen/generated-layout.d.ts +15 -0
- package/out/codegen/generated-layout.js +53 -0
- package/out/codegen/index.d.ts +20 -0
- package/out/codegen/index.js +20 -0
- package/out/codegen/langium-cli-types.d.ts +45 -0
- package/out/codegen/langium-cli-types.js +1 -0
- package/out/codegen/logging-adapter-bootstrap.d.ts +6 -0
- package/out/codegen/logging-adapter-bootstrap.js +69 -0
- package/out/codegen/mcp-host-credential-validation.d.ts +5 -0
- package/out/codegen/mcp-host-credential-validation.js +15 -0
- package/out/codegen/mcp-host-product-runtime.d.ts +22 -0
- package/out/codegen/mcp-host-product-runtime.js +413 -0
- package/out/codegen/project-bootstrap.d.ts +29 -0
- package/out/codegen/project-bootstrap.js +153 -0
- package/out/codegen/render-http-mcp-server.d.ts +3 -0
- package/out/codegen/render-http-mcp-server.js +194 -0
- package/out/codegen/render-mcp-host-shared.d.ts +7 -0
- package/out/codegen/render-mcp-host-shared.js +671 -0
- package/out/codegen/render-oauth-http-mcp-server.d.ts +5 -0
- package/out/codegen/render-oauth-http-mcp-server.js +220 -0
- package/out/codegen/render-stdio-mcp-server.d.ts +5 -0
- package/out/codegen/render-stdio-mcp-server.js +58 -0
- package/out/codegen/write-demos-test-support.d.ts +2 -0
- package/out/codegen/write-demos-test-support.js +28 -0
- package/out/codegen/zod-codegen.d.ts +9 -0
- package/out/codegen/zod-codegen.js +149 -0
- package/out/scripts/generated-scripts-banner.d.ts +2 -0
- package/out/scripts/generated-scripts-banner.js +2 -0
- package/out/scripts/render-kill-listeners-on-port.mjs.d.ts +1 -0
- package/out/scripts/render-kill-listeners-on-port.mjs.js +81 -0
- package/out/scripts/render-load-env-local.mjs.d.ts +1 -0
- package/out/scripts/render-load-env-local.mjs.js +67 -0
- package/out/scripts/render-require-env.mjs.d.ts +1 -0
- package/out/scripts/render-require-env.mjs.js +36 -0
- package/out/scripts/write-generated-scripts.d.ts +4 -0
- package/out/scripts/write-generated-scripts.js +24 -0
- package/package.json +58 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { URI } from 'langium';
|
|
5
|
+
export function collectLangiumDocumentErrors(document) {
|
|
6
|
+
const errors = [];
|
|
7
|
+
for (const parserError of document.parseResult?.parserErrors ?? []) {
|
|
8
|
+
errors.push({
|
|
9
|
+
severity: 1,
|
|
10
|
+
message: parserError.message,
|
|
11
|
+
range: {
|
|
12
|
+
start: { line: 0, character: 0 },
|
|
13
|
+
end: { line: 0, character: 0 }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
for (const diagnostic of document.diagnostics ?? []) {
|
|
18
|
+
if (diagnostic.severity === 1) {
|
|
19
|
+
errors.push({
|
|
20
|
+
severity: diagnostic.severity,
|
|
21
|
+
message: diagnostic.message,
|
|
22
|
+
range: {
|
|
23
|
+
start: {
|
|
24
|
+
line: diagnostic.range.start.line,
|
|
25
|
+
character: diagnostic.range.start.character ?? 0
|
|
26
|
+
},
|
|
27
|
+
end: {
|
|
28
|
+
line: diagnostic.range.end?.line ?? diagnostic.range.start.line,
|
|
29
|
+
character: diagnostic.range.end?.character ?? diagnostic.range.start.character ?? 0
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return errors;
|
|
36
|
+
}
|
|
37
|
+
export function printDocumentValidationErrors(document, errors) {
|
|
38
|
+
for (const diagnostic of errors) {
|
|
39
|
+
const hasRange = diagnostic.range.start.line > 0 ||
|
|
40
|
+
diagnostic.range.start.character > 0 ||
|
|
41
|
+
diagnostic.range.end.character > diagnostic.range.start.character;
|
|
42
|
+
const location = hasRange ? `line ${diagnostic.range.start.line + 1}: ` : '';
|
|
43
|
+
const snippet = hasRange && diagnostic.range.end.character > diagnostic.range.start.character
|
|
44
|
+
? ` [${document.textDocument.getText(diagnostic.range)}]`
|
|
45
|
+
: '';
|
|
46
|
+
console.error(chalk.red(`${location}${diagnostic.message}${snippet}`));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function reportValidationErrorsAndExit(fileName, document, errors) {
|
|
50
|
+
console.error(chalk.red(`Cannot generate — fix ${errors.length} validation error(s) in ${path.basename(fileName)} first:`));
|
|
51
|
+
printDocumentValidationErrors(document, errors);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
throw new Error('unreachable');
|
|
54
|
+
}
|
|
55
|
+
export async function assertDocumentValidForGenerate(fileName, services, options = {}) {
|
|
56
|
+
const extensions = services.LanguageMetaData.fileExtensions;
|
|
57
|
+
if (!extensions.includes(path.extname(fileName))) {
|
|
58
|
+
console.error(chalk.yellow(`Please choose a file with one of these extensions: ${extensions}.`));
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
if (!fs.existsSync(fileName)) {
|
|
62
|
+
console.error(chalk.red(`File ${fileName} does not exist.`));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
options.beforeBuild?.();
|
|
66
|
+
const document = await services.shared.workspace.LangiumDocuments.getOrCreateDocument(URI.file(path.resolve(fileName)));
|
|
67
|
+
await services.shared.workspace.DocumentBuilder.build([document], { validation: true });
|
|
68
|
+
let errors = collectLangiumDocumentErrors(document);
|
|
69
|
+
if (options.extraErrors) {
|
|
70
|
+
errors = [...errors, ...(await options.extraErrors(document))];
|
|
71
|
+
}
|
|
72
|
+
if (errors.length > 0) {
|
|
73
|
+
reportValidationErrorsAndExit(fileName, document, errors);
|
|
74
|
+
}
|
|
75
|
+
return document;
|
|
76
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { McpHostProduct } from './mcp-host-product-runtime.js';
|
|
2
|
+
/** Relative `.js` import spec from one `.ts` file to another. */
|
|
3
|
+
export declare function relativeJsImportPath(fromTsPath: string, toTsPath: string): string;
|
|
4
|
+
/** `generated/{hostProduct}/tools/{basename}-tools.ts` */
|
|
5
|
+
export declare function resolveGeneratedToolsPath(projectRoot: string, hostProduct: McpHostProduct, dslBasename: string): string;
|
|
6
|
+
/** Host product segment from a tools module path (`generated/api2ai/tools/…`). */
|
|
7
|
+
export declare function resolveHostProductFromGeneratedToolsPath(toolsModuleTsPath: string): McpHostProduct;
|
|
8
|
+
/** `generated/{product}/cli` for a tools module under `generated/{product}/tools/`. */
|
|
9
|
+
export declare function resolveGeneratedCliDir(toolsModuleTsPath: string): string;
|
|
10
|
+
export declare function resolveProjectRootFromGeneratedCliDir(cliDir: string): string;
|
|
11
|
+
/** Fail when CLI destination path product segment does not match the generating CLI. */
|
|
12
|
+
export declare function assertGeneratedToolsDestinationMatchesHostProduct(toolsModuleTsPath: string, hostProduct: McpHostProduct): void;
|
|
13
|
+
/** Relative import from a generated cli/tools file to `src/utils/logging-adapter.ts`. */
|
|
14
|
+
export declare function relativeImportToLoggingAdapter(fromGeneratedTsPath: string, projectRoot: string): string;
|
|
15
|
+
export declare function loggingAdapterImportForCliFile(cliFileTsPath: string, projectRoot: string): string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
/** Relative `.js` import spec from one `.ts` file to another. */
|
|
3
|
+
export function relativeJsImportPath(fromTsPath, toTsPath) {
|
|
4
|
+
let rel = path
|
|
5
|
+
.relative(path.dirname(path.resolve(fromTsPath)), path.resolve(toTsPath))
|
|
6
|
+
.split(path.sep)
|
|
7
|
+
.join('/');
|
|
8
|
+
if (!rel.startsWith('.')) {
|
|
9
|
+
rel = `./${rel}`;
|
|
10
|
+
}
|
|
11
|
+
return rel.replace(/\.ts$/, '.js');
|
|
12
|
+
}
|
|
13
|
+
/** `generated/{hostProduct}/tools/{basename}-tools.ts` */
|
|
14
|
+
export function resolveGeneratedToolsPath(projectRoot, hostProduct, dslBasename) {
|
|
15
|
+
return path.join(projectRoot, 'generated', hostProduct, 'tools', `${dslBasename}-tools.ts`);
|
|
16
|
+
}
|
|
17
|
+
/** Host product segment from a tools module path (`generated/api2ai/tools/…`). */
|
|
18
|
+
export function resolveHostProductFromGeneratedToolsPath(toolsModuleTsPath) {
|
|
19
|
+
const toolsDir = path.dirname(path.resolve(toolsModuleTsPath));
|
|
20
|
+
if (path.basename(toolsDir) !== 'tools') {
|
|
21
|
+
throw new Error(`Expected tools module under generated/<product>/tools/: ${toolsModuleTsPath}`);
|
|
22
|
+
}
|
|
23
|
+
const product = path.basename(path.dirname(toolsDir));
|
|
24
|
+
if (product !== 'api2ai' && product !== 'db2ai') {
|
|
25
|
+
throw new Error(`Unknown host product in tools path: ${product}`);
|
|
26
|
+
}
|
|
27
|
+
return product;
|
|
28
|
+
}
|
|
29
|
+
/** `generated/{product}/cli` for a tools module under `generated/{product}/tools/`. */
|
|
30
|
+
export function resolveGeneratedCliDir(toolsModuleTsPath) {
|
|
31
|
+
const toolsDir = path.dirname(path.resolve(toolsModuleTsPath));
|
|
32
|
+
if (path.basename(toolsDir) !== 'tools') {
|
|
33
|
+
return path.join(toolsDir, 'cli');
|
|
34
|
+
}
|
|
35
|
+
return path.join(path.dirname(toolsDir), 'cli');
|
|
36
|
+
}
|
|
37
|
+
export function resolveProjectRootFromGeneratedCliDir(cliDir) {
|
|
38
|
+
return path.resolve(cliDir, '..', '..', '..');
|
|
39
|
+
}
|
|
40
|
+
/** Fail when CLI destination path product segment does not match the generating CLI. */
|
|
41
|
+
export function assertGeneratedToolsDestinationMatchesHostProduct(toolsModuleTsPath, hostProduct) {
|
|
42
|
+
const actual = resolveHostProductFromGeneratedToolsPath(toolsModuleTsPath);
|
|
43
|
+
if (actual !== hostProduct) {
|
|
44
|
+
throw new Error(`[generate] destination "${toolsModuleTsPath}" is for host product "${actual}", but this CLI generates "${hostProduct}". Use generated/${hostProduct}/tools/<name>-tools.ts.`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** Relative import from a generated cli/tools file to `src/utils/logging-adapter.ts`. */
|
|
48
|
+
export function relativeImportToLoggingAdapter(fromGeneratedTsPath, projectRoot) {
|
|
49
|
+
return relativeJsImportPath(fromGeneratedTsPath, path.join(projectRoot, 'src', 'utils', 'logging-adapter.ts'));
|
|
50
|
+
}
|
|
51
|
+
export function loggingAdapterImportForCliFile(cliFileTsPath, projectRoot) {
|
|
52
|
+
return relativeImportToLoggingAdapter(cliFileTsPath, projectRoot);
|
|
53
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared codegen helpers.
|
|
3
|
+
* Extracted incrementally from api2ai/db2ai CLI code.
|
|
4
|
+
*/
|
|
5
|
+
export { authorizeExportName, prepareInputExportName } from './access-stubs.js';
|
|
6
|
+
export * from './auth-module-names.js';
|
|
7
|
+
export * from './auth-pipeline-render.js';
|
|
8
|
+
export * from './auth-stub-bootstrap.js';
|
|
9
|
+
export * from './logging-adapter-bootstrap.js';
|
|
10
|
+
export * from './document-validation.js';
|
|
11
|
+
export * from './langium-cli-types.js';
|
|
12
|
+
export * from './generated-layout.js';
|
|
13
|
+
export * from './project-bootstrap.js';
|
|
14
|
+
export { renderStdioMcpServerSource } from './render-stdio-mcp-server.js';
|
|
15
|
+
export { renderOAuthHttpMcpServerSource } from './render-oauth-http-mcp-server.js';
|
|
16
|
+
export { renderPassthroughHttpMcpServerSource, renderPublicHttpMcpServerSource } from './render-http-mcp-server.js';
|
|
17
|
+
export { renderMcpHostSharedSource } from './render-mcp-host-shared.js';
|
|
18
|
+
export { writeGeneratedDemosTestSupport } from './write-demos-test-support.js';
|
|
19
|
+
export { writeGeneratedScripts } from '../scripts/write-generated-scripts.js';
|
|
20
|
+
export * from './zod-codegen.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared codegen helpers.
|
|
3
|
+
* Extracted incrementally from api2ai/db2ai CLI code.
|
|
4
|
+
*/
|
|
5
|
+
export { authorizeExportName, prepareInputExportName } from './access-stubs.js';
|
|
6
|
+
export * from './auth-module-names.js';
|
|
7
|
+
export * from './auth-pipeline-render.js';
|
|
8
|
+
export * from './auth-stub-bootstrap.js';
|
|
9
|
+
export * from './logging-adapter-bootstrap.js';
|
|
10
|
+
export * from './document-validation.js';
|
|
11
|
+
export * from './langium-cli-types.js';
|
|
12
|
+
export * from './generated-layout.js';
|
|
13
|
+
export * from './project-bootstrap.js';
|
|
14
|
+
export { renderStdioMcpServerSource } from './render-stdio-mcp-server.js';
|
|
15
|
+
export { renderOAuthHttpMcpServerSource } from './render-oauth-http-mcp-server.js';
|
|
16
|
+
export { renderPassthroughHttpMcpServerSource, renderPublicHttpMcpServerSource } from './render-http-mcp-server.js';
|
|
17
|
+
export { renderMcpHostSharedSource } from './render-mcp-host-shared.js';
|
|
18
|
+
export { writeGeneratedDemosTestSupport } from './write-demos-test-support.js';
|
|
19
|
+
export { writeGeneratedScripts } from '../scripts/write-generated-scripts.js';
|
|
20
|
+
export * from './zod-codegen.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type CliLangiumDocument = {
|
|
2
|
+
uri?: {
|
|
3
|
+
toString(): string;
|
|
4
|
+
};
|
|
5
|
+
diagnostics?: Array<{
|
|
6
|
+
severity?: number;
|
|
7
|
+
message: string;
|
|
8
|
+
range: {
|
|
9
|
+
start: {
|
|
10
|
+
line: number;
|
|
11
|
+
character?: number;
|
|
12
|
+
};
|
|
13
|
+
end?: {
|
|
14
|
+
line: number;
|
|
15
|
+
character?: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
textDocument: {
|
|
20
|
+
getText(range: unknown): string;
|
|
21
|
+
};
|
|
22
|
+
parseResult?: {
|
|
23
|
+
value?: unknown;
|
|
24
|
+
parserErrors?: Array<{
|
|
25
|
+
message: string;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type CliLangiumServices = {
|
|
30
|
+
LanguageMetaData: {
|
|
31
|
+
fileExtensions: readonly string[];
|
|
32
|
+
};
|
|
33
|
+
shared: {
|
|
34
|
+
workspace: {
|
|
35
|
+
LangiumDocuments: {
|
|
36
|
+
getOrCreateDocument(uri: unknown): Promise<CliLangiumDocument>;
|
|
37
|
+
};
|
|
38
|
+
DocumentBuilder: {
|
|
39
|
+
build(documents: CliLangiumDocument[], options: {
|
|
40
|
+
validation: boolean;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** @deprecated Use relativeImportToLoggingAdapter — nested layout uses ../../../src/utils/logging-adapter.js */
|
|
2
|
+
export declare const LOGGING_ADAPTER_IMPORT_FROM_GENERATED = "../../../src/utils/logging-adapter.js";
|
|
3
|
+
export declare function resolveLoggingAdapterPath(projectRoot: string): string;
|
|
4
|
+
export declare function renderLoggingAdapterStubContent(): string;
|
|
5
|
+
export declare function ensureLoggingAdapterStubAtProjectRoot(projectRoot: string): string;
|
|
6
|
+
export declare function ensureLoggingAdapterStubFromSource(source: string): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { resolveBootstrapProjectRootFromSource } from './project-bootstrap.js';
|
|
4
|
+
/** @deprecated Use relativeImportToLoggingAdapter — nested layout uses ../../../src/utils/logging-adapter.js */
|
|
5
|
+
export const LOGGING_ADAPTER_IMPORT_FROM_GENERATED = '../../../src/utils/logging-adapter.js';
|
|
6
|
+
export function resolveLoggingAdapterPath(projectRoot) {
|
|
7
|
+
return path.join(projectRoot, 'src', 'utils', 'logging-adapter.ts');
|
|
8
|
+
}
|
|
9
|
+
export function renderLoggingAdapterStubContent() {
|
|
10
|
+
return `/**
|
|
11
|
+
* Logging adapter (write-once — customize this file; re-generate does not overwrite).
|
|
12
|
+
* Default: stderr with ANSI colors. debug() only when process.env.LOG_LEVEL === 'debug'.
|
|
13
|
+
* Optional prefix: process.env.LOG_SERVICE_PREFIX (set by init / demo npm scripts).
|
|
14
|
+
*/
|
|
15
|
+
const GRAY = '\\x1b[90m';
|
|
16
|
+
const RESET = '\\x1b[0m';
|
|
17
|
+
const YELLOW = '\\x1b[33m';
|
|
18
|
+
const RED = '\\x1b[31m';
|
|
19
|
+
|
|
20
|
+
function servicePrefix(): string {
|
|
21
|
+
const raw = process.env.LOG_SERVICE_PREFIX?.trim();
|
|
22
|
+
return raw && raw.length > 0 ? '[' + raw + '] ' : '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function formatLine(level: string, color: string, message: string, context?: object): string {
|
|
26
|
+
const suffix =
|
|
27
|
+
context !== undefined && Object.keys(context).length > 0 ? ' ' + JSON.stringify(context) : '';
|
|
28
|
+
return color + '[' + level + '] ' + servicePrefix() + message + suffix + RESET;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class LoggingAdapter {
|
|
32
|
+
debug(message: string, context?: object): void {
|
|
33
|
+
if (process.env.LOG_LEVEL !== 'debug') {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
console.error(formatLine('debug', GRAY, message, context));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
info(message: string, context?: object): void {
|
|
40
|
+
console.error(formatLine('info', RESET, message, context));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
warn(message: string, context?: object): void {
|
|
44
|
+
console.error(formatLine('warn', YELLOW, message, context));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
error(message: string, context?: object): void {
|
|
48
|
+
console.error(formatLine('error', RED, message, context));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const loggingAdapter = new LoggingAdapter();
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
export function ensureLoggingAdapterStubAtProjectRoot(projectRoot) {
|
|
56
|
+
const utilsDir = path.join(projectRoot, 'src', 'utils');
|
|
57
|
+
const dest = resolveLoggingAdapterPath(projectRoot);
|
|
58
|
+
if (!fs.existsSync(utilsDir)) {
|
|
59
|
+
fs.mkdirSync(utilsDir, { recursive: true });
|
|
60
|
+
}
|
|
61
|
+
if (!fs.existsSync(dest)) {
|
|
62
|
+
fs.writeFileSync(dest, renderLoggingAdapterStubContent(), 'utf-8');
|
|
63
|
+
}
|
|
64
|
+
return dest;
|
|
65
|
+
}
|
|
66
|
+
export function ensureLoggingAdapterStubFromSource(source) {
|
|
67
|
+
const projectRoot = resolveBootstrapProjectRootFromSource(source);
|
|
68
|
+
return ensureLoggingAdapterStubAtProjectRoot(projectRoot);
|
|
69
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal relay credential helpers for generated MCP hosts.
|
|
3
|
+
* Cryptographic validation belongs in src/hooks (checked tools, verifyCredential).
|
|
4
|
+
*/
|
|
5
|
+
export function hostCredentialValidationRelaySource() {
|
|
6
|
+
return `
|
|
7
|
+
function resolveRelayHostCredential(
|
|
8
|
+
rawCredential: string | undefined
|
|
9
|
+
): { credential?: string } {
|
|
10
|
+
if (!rawCredential?.trim()) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
return { credential: rawCredential.trim() };
|
|
14
|
+
}`.trim();
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product-specific fragments for generated MCP host runtimes (api2ai vs db2ai).
|
|
3
|
+
*/
|
|
4
|
+
export type McpHostProduct = 'api2ai' | 'db2ai';
|
|
5
|
+
/** Parameter name when GeneratedHostModule is required only for db2ai branches (api2ai → eslint _ prefix). */
|
|
6
|
+
export declare function generatedModuleParam(product: McpHostProduct): string;
|
|
7
|
+
export declare function hostCoreTypes(product: McpHostProduct): string;
|
|
8
|
+
export declare function dbOnlyHelperFunctions(product: McpHostProduct): string;
|
|
9
|
+
export declare function readGeneratedModuleTail(product: McpHostProduct): string;
|
|
10
|
+
export declare function withDbConnectionHostContextFn(product: McpHostProduct): string;
|
|
11
|
+
export declare function validateHostAtStartupFn(product: McpHostProduct): string;
|
|
12
|
+
export declare function resolveHostContextForCallFn(product: McpHostProduct): string;
|
|
13
|
+
export declare function validateHttpMcpHostAtStartupFn(product: McpHostProduct): string;
|
|
14
|
+
export declare function resolveHostContextForHttpCallFn(product: McpHostProduct, httpMcpProfile: HttpMcpHostProfile): string;
|
|
15
|
+
export type HttpMcpHostProfile = 'public' | 'passthrough';
|
|
16
|
+
export declare function validateOAuthHttpHostAtStartupFn(product: McpHostProduct): string;
|
|
17
|
+
export declare function resolveHostContextForOAuthSessionDbBranch(product: McpHostProduct): string;
|
|
18
|
+
/** Skip baseUrl for db2ai modules that export connectionEnv (.db2ai SQL tools). */
|
|
19
|
+
export declare function oauthHostContextBaseUrlFieldsFn(product: McpHostProduct): string;
|
|
20
|
+
export declare function requireBaseUrlEnvArgvCheck(product: McpHostProduct, hostConfigExpr: string): string;
|
|
21
|
+
/** @deprecated use validateHttpMcpHostAtStartupFn */
|
|
22
|
+
export declare function validateStatelessHttpHostAtStartupFn(product: McpHostProduct): string;
|