libmodulor 0.28.0 → 0.30.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/CHANGELOG.md +57 -0
- package/README.md +3 -3
- package/dist/esm/apps/Helper/src/lib/layers/product.js +1 -1
- package/dist/esm/apps/Helper/src/lib/layers/project.js +7 -7
- package/dist/esm/apps/Helper/src/lib/layers/target.js +27 -11
- package/dist/esm/convention.d.ts +2 -0
- package/dist/esm/convention.js +1 -0
- package/dist/esm/dt/base/TBase.d.ts +2 -0
- package/dist/esm/dt/base/TBase.js +5 -0
- package/dist/esm/dt/base/TBoolean.d.ts +2 -0
- package/dist/esm/dt/base/TBoolean.js +3 -0
- package/dist/esm/dt/base/TInt.d.ts +2 -0
- package/dist/esm/dt/base/TInt.js +3 -0
- package/dist/esm/dt/base/TNumber.d.ts +2 -0
- package/dist/esm/dt/base/TNumber.js +3 -0
- package/dist/esm/dt/base/TObject.d.ts +2 -0
- package/dist/esm/dt/base/TObject.js +37 -0
- package/dist/esm/dt/final/TApiKey.d.ts +2 -0
- package/dist/esm/dt/final/TApiKey.js +3 -0
- package/dist/esm/dt/final/TDateISO8601.d.ts +2 -0
- package/dist/esm/dt/final/TDateISO8601.js +3 -0
- package/dist/esm/dt/final/TDomainName.d.ts +2 -0
- package/dist/esm/dt/final/TDomainName.js +3 -0
- package/dist/esm/dt/final/TEmail.d.ts +2 -0
- package/dist/esm/dt/final/TEmail.js +3 -0
- package/dist/esm/dt/final/TEncryptionKey.d.ts +2 -0
- package/dist/esm/dt/final/TEncryptionKey.js +3 -0
- package/dist/esm/dt/final/TFile.d.ts +2 -0
- package/dist/esm/dt/final/TFile.js +3 -0
- package/dist/esm/dt/final/TIPv4.d.ts +2 -0
- package/dist/esm/dt/final/TIPv4.js +3 -0
- package/dist/esm/dt/final/TIPv6.d.ts +2 -0
- package/dist/esm/dt/final/TIPv6.js +3 -0
- package/dist/esm/dt/final/TJWT.d.ts +2 -0
- package/dist/esm/dt/final/TJWT.js +3 -0
- package/dist/esm/dt/final/TPassword.d.ts +2 -0
- package/dist/esm/dt/final/TPassword.js +3 -0
- package/dist/esm/dt/final/TSSHPrivateKey.d.ts +2 -0
- package/dist/esm/dt/final/TSSHPrivateKey.js +3 -0
- package/dist/esm/dt/final/TTime.d.ts +2 -0
- package/dist/esm/dt/final/TTime.js +3 -0
- package/dist/esm/dt/final/TURL.d.ts +2 -0
- package/dist/esm/dt/final/TURL.js +3 -0
- package/dist/esm/dt/index.d.ts +1 -0
- package/dist/esm/dt/targets/json-schema.d.ts +36 -0
- package/dist/esm/error/funcs.d.ts +4 -0
- package/dist/esm/error/funcs.js +5 -1
- package/dist/esm/error/index.d.ts +1 -1
- package/dist/esm/error/index.js +1 -1
- package/dist/esm/i18n/locales/de.js +2 -0
- package/dist/esm/i18n/locales/en.js +2 -0
- package/dist/esm/i18n/locales/es.js +2 -0
- package/dist/esm/i18n/locales/fr.js +2 -0
- package/dist/esm/i18n/types.d.ts +1 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.node-express.d.ts +2 -0
- package/dist/esm/index.node-express.js +1 -0
- package/dist/esm/index.node-hono.d.ts +2 -0
- package/dist/esm/index.node-hono.js +1 -0
- package/dist/esm/index.node-mcp-express.d.ts +3 -0
- package/dist/esm/index.node-mcp-express.js +2 -0
- package/dist/esm/index.node-mcp-hono.d.ts +3 -0
- package/dist/esm/index.node-mcp-hono.js +2 -0
- package/dist/esm/index.node-mcp.d.ts +3 -1
- package/dist/esm/index.node-mcp.js +3 -1
- package/dist/esm/product/manifest.d.ts +2 -0
- package/dist/esm/products/Helper/i18n.d.ts +2 -0
- package/dist/esm/std/impl/SimpleMapI18nManager.d.ts +1 -1
- package/dist/esm/std/impl/SimpleMapI18nManager.js +4 -2
- package/dist/esm/std/lib/settings.js +4 -5
- package/dist/esm/target/edge-worker-hono-server/SyncEdgeWorkerHonoServerManager.d.ts +8 -2
- package/dist/esm/target/edge-worker-hono-server/SyncEdgeWorkerHonoServerManager.js +20 -9
- package/dist/esm/target/index.d.ts +2 -1
- package/dist/esm/target/index.js +1 -1
- package/dist/esm/target/lib/client/AuthDataStore.d.ts +5 -0
- package/dist/esm/target/lib/client/AuthDataStore.js +1 -0
- package/dist/esm/target/lib/client/impl/InMemoryAuthDataStore.d.ts +7 -0
- package/dist/esm/target/lib/client/impl/InMemoryAuthDataStore.js +20 -0
- package/dist/esm/target/lib/client/impl/MixedServerClientManager.d.ts +15 -0
- package/dist/esm/target/lib/client/impl/MixedServerClientManager.js +44 -0
- package/dist/esm/target/lib/json-schema/error.d.ts +3 -0
- package/dist/esm/target/lib/json-schema/error.js +14 -0
- package/dist/esm/target/lib/json-schema/input.d.ts +16 -0
- package/dist/esm/target/lib/json-schema/input.js +67 -0
- package/dist/esm/target/lib/json-schema/output.d.ts +19 -0
- package/dist/esm/target/lib/json-schema/output.js +128 -0
- package/dist/esm/target/lib/manifest.d.ts +32 -1
- package/dist/esm/target/lib/manifest.js +22 -1
- package/dist/esm/target/lib/mcp-server/MCPServerRequestHandler.d.ts +16 -0
- package/dist/esm/target/lib/mcp-server/MCPServerRequestHandler.js +54 -0
- package/dist/esm/target/lib/mcp-server/consts.d.ts +1 -0
- package/dist/esm/target/lib/mcp-server/consts.js +1 -0
- package/dist/esm/target/lib/mcp-server/funcs.d.ts +13 -0
- package/dist/esm/target/lib/mcp-server/funcs.js +84 -0
- package/dist/esm/target/lib/mcp-server/http/MCPHTTPRequestHandlerBuilder.d.ts +14 -0
- package/dist/esm/target/lib/mcp-server/http/MCPHTTPRequestHandlerBuilder.js +1 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.d.ts +5 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.js +18 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.d.ts +15 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.js +88 -0
- package/dist/esm/target/lib/mcp-server/http/express/types.d.ts +3 -0
- package/dist/esm/target/lib/mcp-server/http/express/types.js +1 -0
- package/dist/esm/target/lib/mcp-server/http/funcs.d.ts +6 -0
- package/dist/esm/target/lib/mcp-server/http/funcs.js +50 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.d.ts +5 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.js +18 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoProtocolRequestHandlerBuilder.d.ts +15 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoProtocolRequestHandlerBuilder.js +88 -0
- package/dist/esm/target/lib/mcp-server/http/hono/types.d.ts +3 -0
- package/dist/esm/target/lib/mcp-server/http/hono/types.js +1 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioRequestHandler.d.ts +31 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioRequestHandler.js +108 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.d.ts +7 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.js +36 -0
- package/dist/esm/target/lib/mcp-server/stdio/consts.d.ts +2 -0
- package/dist/esm/target/lib/mcp-server/stdio/consts.js +3 -0
- package/dist/esm/target/lib/mcp-server/stdio/funcs.d.ts +2 -0
- package/dist/esm/target/lib/mcp-server/stdio/funcs.js +10 -0
- package/dist/esm/target/lib/mcp-server/stdio/input.d.ts +10 -0
- package/dist/esm/target/lib/mcp-server/stdio/input.js +15 -0
- package/dist/esm/target/lib/mcp-server/types.d.ts +2 -0
- package/dist/esm/target/lib/mcp-server/types.js +1 -0
- package/dist/esm/target/lib/openapi/OpenAPISpecBuilder.d.ts +25 -0
- package/dist/esm/target/lib/openapi/OpenAPISpecBuilder.js +135 -0
- package/dist/esm/target/lib/openapi/funcs.d.ts +11 -0
- package/dist/esm/target/lib/openapi/funcs.js +148 -0
- package/dist/esm/target/lib/openapi/types.d.ts +98 -0
- package/dist/esm/target/lib/openapi/types.js +1 -0
- package/dist/esm/target/lib/rn/input.d.ts +3 -0
- package/dist/esm/target/lib/server/AuthCookieCreator.d.ts +2 -1
- package/dist/esm/target/lib/server/ServerBooter.d.ts +4 -2
- package/dist/esm/target/lib/server/ServerBooter.js +44 -11
- package/dist/esm/target/lib/server/ServerManager.d.ts +29 -9
- package/dist/esm/target/lib/server/ServerRequestHandler.d.ts +10 -6
- package/dist/esm/target/lib/server/ServerRequestHandler.js +35 -25
- package/dist/esm/target/lib/server/consts.d.ts +4 -0
- package/dist/esm/target/lib/server/consts.js +26 -0
- package/dist/esm/target/lib/server-express/CORSMiddlewareBuilder.d.ts +15 -0
- package/dist/esm/target/lib/server-express/CORSMiddlewareBuilder.js +55 -0
- package/dist/esm/target/lib/server-express/funcs.d.ts +2 -1
- package/dist/esm/target/lib/server-express/funcs.js +6 -5
- package/dist/esm/target/lib/server-hono/CORSMiddlewareBuilder.d.ts +14 -0
- package/dist/esm/target/lib/server-hono/CORSMiddlewareBuilder.js +46 -0
- package/dist/esm/target/lib/server-hono/funcs.d.ts +2 -1
- package/dist/esm/target/lib/server-hono/funcs.js +6 -3
- package/dist/esm/target/lib/shared.d.ts +5 -0
- package/dist/esm/target/lib/shared.js +3 -1
- package/dist/esm/target/nextjs-server/NextJSServerManager.d.ts +5 -1
- package/dist/esm/target/nextjs-server/NextJSServerManager.js +6 -0
- package/dist/esm/target/node-express-server/NodeExpressServerManager.d.ts +12 -4
- package/dist/esm/target/node-express-server/NodeExpressServerManager.js +34 -15
- package/dist/esm/target/node-hono-server/NodeHonoServerManager.d.ts +11 -3
- package/dist/esm/target/node-hono-server/NodeHonoServerManager.js +31 -12
- package/dist/esm/target/{node-mcp-server/NodeLocalStdioMCPServerManager.d.ts → node-mcp-server-stdio/NodeMCPStdioServerManager.d.ts} +12 -21
- package/dist/esm/target/node-mcp-server-stdio/NodeMCPStdioServerManager.js +108 -0
- package/dist/esm/testing/impl/newNodeAppTester.js +5 -0
- package/dist/esm/uc/UC.d.ts +2 -0
- package/dist/esm/uc/UC.js +16 -1
- package/dist/esm/uc/cardinality.d.ts +7 -0
- package/dist/esm/uc/cardinality.js +14 -0
- package/dist/esm/uc/examples.d.ts +2 -0
- package/dist/esm/uc/examples.js +12 -0
- package/dist/esm/uc/helpers/UCOutputReader.d.ts +2 -2
- package/dist/esm/uc/helpers/UCOutputReader.js +2 -2
- package/dist/esm/uc/index.d.ts +2 -0
- package/dist/esm/uc/index.js +2 -0
- package/dist/esm/uc/input-field.d.ts +3 -6
- package/dist/esm/uc/input-field.js +5 -21
- package/dist/esm/uc/metadata.d.ts +7 -0
- package/dist/esm/uc/metadata.js +10 -0
- package/dist/esm/uc/opi.d.ts +3 -1
- package/dist/esm/uc/opi.js +4 -1
- package/dist/esm/uc/output-field.d.ts +14 -1
- package/dist/esm/uc/output-field.js +11 -1
- package/dist/esm/uc/utils/ucHTTPContract.js +1 -1
- package/dist/esm/utils/bundling/funcs.js +1 -1
- package/dist/esm/utils/bundling/vite/plugin.d.ts +1 -1
- package/dist/esm/utils/http/types.d.ts +5 -0
- package/dist/esm/utils/index.d.ts +2 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/streams/funcs.d.ts +2 -0
- package/dist/esm/utils/streams/funcs.js +10 -0
- package/package.json +25 -14
- package/dist/esm/target/node-mcp-server/NodeLocalStdioMCPServerManager.js +0 -183
- package/dist/esm/target/node-mcp-server/funcs.d.ts +0 -7
- package/dist/esm/target/node-mcp-server/funcs.js +0 -45
- package/dist/esm/target/node-mcp-server/types.d.ts +0 -19
- /package/dist/esm/{target/node-mcp-server/types.js → dt/targets/json-schema.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v0.30.0 (2026-05-25)
|
|
4
|
+
|
|
5
|
+
### ✨ Features
|
|
6
|
+
|
|
7
|
+
- Added cardinality support for use case output fields.
|
|
8
|
+
- Introduced target capability definitions to expose target features programmatically (see it in action here https://libmodulor.c100k.eu/docs/references/targets).
|
|
9
|
+
- Added a fully local MCP stdio server implementation.
|
|
10
|
+
- Added streamable HTTP support for MCP targets on Express and Hono.
|
|
11
|
+
- Added an option to dangerously skip public API key and auth checks for MCP targets.
|
|
12
|
+
|
|
13
|
+
### 🛠 OpenAPI & JSON Schema
|
|
14
|
+
|
|
15
|
+
- Fixed OpenAPI target handling for:
|
|
16
|
+
- `null` schemas
|
|
17
|
+
- nullable schemas
|
|
18
|
+
- empty `204` responses
|
|
19
|
+
- missing `additionalProperties`
|
|
20
|
+
- missing required fields
|
|
21
|
+
- Fixed JSON schema output generation to build schemas directly from definitions.
|
|
22
|
+
|
|
23
|
+
### ♻️ Refactors
|
|
24
|
+
|
|
25
|
+
- Renamed the MCP target to `node-mcp-server-stdio` (**breaking change**).
|
|
26
|
+
- Exposed `rawErr` in `ServerRequestHandler`.
|
|
27
|
+
- Harmonized import extensions across examples.
|
|
28
|
+
|
|
29
|
+
### 📦 Dependencies
|
|
30
|
+
|
|
31
|
+
- Bumped various minor and patch dependencies.
|
|
32
|
+
- Upgraded:
|
|
33
|
+
- Vite → 8.x
|
|
34
|
+
- Vitest → 4.x
|
|
35
|
+
|
|
36
|
+
### 📚 Documentation & Examples
|
|
37
|
+
|
|
38
|
+
- Updated changelog and command documentation.
|
|
39
|
+
- Adjusted Swagger example configuration to work correctly with CORS.
|
|
40
|
+
|
|
41
|
+
See all the changes here : https://github.com/c100k/libmodulor/compare/v0.29.0...master
|
|
42
|
+
|
|
43
|
+
## v0.29.0 (2026-05-10)
|
|
44
|
+
|
|
45
|
+
Report an error when the `onClose` handler of SSE has been missed only when it has streamed once.
|
|
46
|
+
|
|
47
|
+
Introduce the automatic generation of [OpenAPI](https://www.openapis.org) specs for server targets.
|
|
48
|
+
It is disabled by default.
|
|
49
|
+
To opt-in, simply open the server's `settings.ts` and set `server_expose_openapi_spec: true`.
|
|
50
|
+
When the server starts, the spec is generated on the fly and made available at `/api/openapi.json`.
|
|
51
|
+
This path is customizable by setting `server_expose_openapi_spec_at`.
|
|
52
|
+
See it in action in the [Playground](https://libmodulor.c100k.eu/docs/examples/Playground).
|
|
53
|
+
|
|
54
|
+
Introduce [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) settings for server targets.
|
|
55
|
+
It is disabled by default.
|
|
56
|
+
Settings available : `server_cors_credentials`, `server_cors_headers`, `server_cors_methods`, `server_cors_origins`.
|
|
57
|
+
|
|
58
|
+
See all the changes here : https://github.com/c100k/libmodulor/compare/v0.28.0...master
|
|
59
|
+
|
|
3
60
|
## v0.28.0 (2026-05-01)
|
|
4
61
|
|
|
5
62
|
Replace `Provider` by `Factory` in Dependency Injection (`inversify`). If you're using `bindProvider`, simply replace it by `bindFactory`.
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Here is how to easily create all of them, in a brand new project :
|
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
# Create a project
|
|
24
|
-
|
|
24
|
+
pnpx libmodulor CreateProject --projectName my-super-project
|
|
25
25
|
cd my-super-project
|
|
26
26
|
|
|
27
27
|
# Create an app
|
|
@@ -37,7 +37,7 @@ pnpm libmodulor CreateProduct --productName CustomerPortal
|
|
|
37
37
|
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-express-server
|
|
38
38
|
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-hono-server
|
|
39
39
|
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-core-cli
|
|
40
|
-
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-mcp-server
|
|
40
|
+
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-mcp-server-stdio
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
For more params, checkout the help section : `pnpm libmodulor --help`.
|
|
@@ -50,4 +50,4 @@ If you think you can help in any way, feel free to contact me (cf. `author` in `
|
|
|
50
50
|
|
|
51
51
|
## ⚖️ License
|
|
52
52
|
|
|
53
|
-
[LGPL-3.0](https://github.com/c100k/libmodulor/blob/v0.
|
|
53
|
+
[LGPL-3.0](https://github.com/c100k/libmodulor/blob/v0.30.0/LICENSE)
|
|
@@ -2,7 +2,7 @@ import { PRODUCT_I18N_FILE_NAME, PRODUCT_I18N_NAME, PRODUCT_MANIFEST_FILE_NAME,
|
|
|
2
2
|
import { I18N_DEFAULT_LANG } from '../../../../../i18n/index.js';
|
|
3
3
|
import { LIB_NAME } from '../consts.js';
|
|
4
4
|
const I18N_TS = `import type { ProductI18n } from '${LIB_NAME}';
|
|
5
|
-
import { I18n${I18N_DEFAULT_LANG.toLocaleUpperCase()} } from '
|
|
5
|
+
import { I18n${I18N_DEFAULT_LANG.toLocaleUpperCase()} } from '${LIB_NAME}/locales/${I18N_DEFAULT_LANG}';
|
|
6
6
|
|
|
7
7
|
export const ${PRODUCT_I18N_NAME} = {
|
|
8
8
|
${I18N_DEFAULT_LANG}: {
|
|
@@ -87,19 +87,19 @@ export const PACKAGE_JSON = (name) => `{
|
|
|
87
87
|
"reflect-metadata": "^0.2.2"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@biomejs/biome": "^2.4.
|
|
91
|
-
"@types/node": "^25.
|
|
92
|
-
"@vitest/coverage-v8": "^
|
|
90
|
+
"@biomejs/biome": "^2.4.15",
|
|
91
|
+
"@types/node": "^25.8.0",
|
|
92
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
93
93
|
"buffer": "^6.0.3",
|
|
94
94
|
"cookie-parser": "^1.4.7",
|
|
95
95
|
"express": "^5.2.1",
|
|
96
96
|
"express-fileupload": "^1.5.2",
|
|
97
|
-
"fast-check": "^4.
|
|
97
|
+
"fast-check": "^4.8.0",
|
|
98
98
|
"helmet": "^8.1.0",
|
|
99
|
-
"jose": "^6.2.
|
|
99
|
+
"jose": "^6.2.3",
|
|
100
100
|
"typescript": "^6.0.3",
|
|
101
|
-
"vite": "^
|
|
102
|
-
"vitest": "^
|
|
101
|
+
"vite": "^8.0.13",
|
|
102
|
+
"vitest": "^4.1.6"
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
`;
|
|
@@ -56,6 +56,8 @@ import {
|
|
|
56
56
|
import { bindNodeCore } from '${LIB_NAME}/node';
|
|
57
57
|
import {
|
|
58
58
|
bindServer,
|
|
59
|
+
type MCPHTTPExpressRequestHandlerBuilder,
|
|
60
|
+
MCPHTTPExpressFakeRequestHandlerBuilder,
|
|
59
61
|
NodeExpressServerManager,
|
|
60
62
|
} from '${LIB_NAME}/node-express';
|
|
61
63
|
|
|
@@ -69,6 +71,9 @@ bindNodeCore(container);
|
|
|
69
71
|
bindServer(container);
|
|
70
72
|
bindProduct(container, ${PRODUCT_MANIFEST_NAME}, ${PRODUCT_I18N_NAME});
|
|
71
73
|
|
|
74
|
+
container
|
|
75
|
+
.bind<MCPHTTPExpressRequestHandlerBuilder>('MCPHTTPRequestHandlerBuilder')
|
|
76
|
+
.to(MCPHTTPExpressFakeRequestHandlerBuilder);
|
|
72
77
|
container.bind<ServerManager>('ServerManager').to(NodeExpressServerManager);
|
|
73
78
|
|
|
74
79
|
export default container;
|
|
@@ -84,6 +89,8 @@ import {
|
|
|
84
89
|
import { bindNodeCore } from '${LIB_NAME}/node';
|
|
85
90
|
import {
|
|
86
91
|
bindServer,
|
|
92
|
+
type MCPHTTPHonoRequestHandlerBuilder,
|
|
93
|
+
MCPHTTPHonoFakeRequestHandlerBuilder,
|
|
87
94
|
NodeHonoServerManager,
|
|
88
95
|
} from '${LIB_NAME}/node-hono';
|
|
89
96
|
|
|
@@ -97,20 +104,27 @@ bindNodeCore(container);
|
|
|
97
104
|
bindServer(container);
|
|
98
105
|
bindProduct(container, ${PRODUCT_MANIFEST_NAME}, ${PRODUCT_I18N_NAME});
|
|
99
106
|
|
|
107
|
+
container
|
|
108
|
+
.bind<MCPHTTPHonoRequestHandlerBuilder>('MCPHTTPRequestHandlerBuilder')
|
|
109
|
+
.to(MCPHTTPHonoFakeRequestHandlerBuilder);
|
|
100
110
|
container.bind<ServerManager>('ServerManager').to(NodeHonoServerManager);
|
|
101
111
|
|
|
102
112
|
export default container;
|
|
103
113
|
`;
|
|
104
|
-
const
|
|
114
|
+
const NODE_MCP_SERVER_STDIO_CONTAINER_TS = `import { Container } from 'inversify';
|
|
105
115
|
import {
|
|
106
116
|
bindCommon,
|
|
107
117
|
bindProduct,
|
|
108
118
|
CONTAINER_OPTS,
|
|
109
119
|
type ServerManager,
|
|
120
|
+
type UCClientConfirmManager,
|
|
110
121
|
updateSettings,
|
|
111
122
|
} from '${LIB_NAME}';
|
|
112
123
|
import { bindNodeCore } from '${LIB_NAME}/node';
|
|
113
|
-
import {
|
|
124
|
+
import {
|
|
125
|
+
MCPStdioUCClientConfirmManager,
|
|
126
|
+
NodeMCPStdioServerManager,
|
|
127
|
+
} from '${LIB_NAME}/node-mcp';
|
|
114
128
|
|
|
115
129
|
${COMMON_CONTAINER_IMPORTS}
|
|
116
130
|
|
|
@@ -121,13 +135,15 @@ updateSettings<S>(container, settings);
|
|
|
121
135
|
bindNodeCore(container);
|
|
122
136
|
bindProduct(container, Manifest, I18n);
|
|
123
137
|
|
|
124
|
-
container
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
(await container.rebind<UCClientConfirmManager>('UCClientConfirmManager')).to(
|
|
139
|
+
MCPStdioUCClientConfirmManager,
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
container.bind<ServerManager>('ServerManager').to(NodeMCPStdioServerManager);
|
|
127
143
|
|
|
128
144
|
export default container;
|
|
129
145
|
`;
|
|
130
|
-
const
|
|
146
|
+
const NODE_MCP_SERVER_STDIO_INDEX_TS = `import { MCPServerBooter } from '${LIB_NAME}/node-mcp';
|
|
131
147
|
|
|
132
148
|
import container from './container.js';
|
|
133
149
|
|
|
@@ -135,7 +151,7 @@ await container.get(MCPServerBooter).exec({
|
|
|
135
151
|
srcImporter: (path) => import(path),
|
|
136
152
|
});
|
|
137
153
|
`;
|
|
138
|
-
const
|
|
154
|
+
const NODE_MCP_SERVER_STDIO_SETTINGS_TS = `import {
|
|
139
155
|
type LoggerSettings,
|
|
140
156
|
type ServerClientManagerSettings,
|
|
141
157
|
TARGET_DEFAULT_SERVER_CLIENT_MANAGER_SETTINGS,
|
|
@@ -188,10 +204,10 @@ const MAPPING = {
|
|
|
188
204
|
[['.', 'index.ts'], SERVER_INDEX_TS],
|
|
189
205
|
[['.', 'settings.ts'], SERVER_SETTINGS_TS],
|
|
190
206
|
]),
|
|
191
|
-
'node-mcp-server': new Map([
|
|
192
|
-
[['.', 'container.ts'],
|
|
193
|
-
[['.', 'index.ts'],
|
|
194
|
-
[['.', 'settings.ts'],
|
|
207
|
+
'node-mcp-server-stdio': new Map([
|
|
208
|
+
[['.', 'container.ts'], NODE_MCP_SERVER_STDIO_CONTAINER_TS],
|
|
209
|
+
[['.', 'index.ts'], NODE_MCP_SERVER_STDIO_INDEX_TS],
|
|
210
|
+
[['.', 'settings.ts'], NODE_MCP_SERVER_STDIO_SETTINGS_TS],
|
|
195
211
|
]),
|
|
196
212
|
'node-stricli-cli': new Map(),
|
|
197
213
|
'react-native-pure': new Map(),
|
package/dist/esm/convention.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AppName } from './app/index.js';
|
|
2
|
+
import type { FileName } from './dt/index.js';
|
|
2
3
|
import type { ProductName } from './product/index.js';
|
|
3
4
|
import type { TargetName } from './target/index.js';
|
|
4
5
|
import type { UCName } from './uc/index.js';
|
|
@@ -60,3 +61,4 @@ export declare const UC_POLICY_FILE_NAME_SUFFIX: string;
|
|
|
60
61
|
export declare const PRODUCT_ROOT_FROM_PRODUCT_TARGET_PATH: string[];
|
|
61
62
|
export declare const APPS_PATH_FROM_PRODUCT_TARGET_PATH: string[];
|
|
62
63
|
export declare const TARGET_NAME_PLACEHOLDER: TargetName;
|
|
64
|
+
export declare const TARGET_DEF_FILE_NAME: FileName;
|
package/dist/esm/convention.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IconCode } from '../../icon/index.js';
|
|
2
2
|
import type { DataType } from '../DataType.js';
|
|
3
3
|
import type { Color } from '../final/TColor.js';
|
|
4
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
4
5
|
import type { RNInputMode } from '../targets/rn.js';
|
|
5
6
|
import type { HTMLInputType } from '../targets/web.js';
|
|
6
7
|
import { Validation } from '../Validation.js';
|
|
@@ -54,6 +55,7 @@ export declare abstract class TBase<T extends DataType> {
|
|
|
54
55
|
hasStrictOptions(): boolean;
|
|
55
56
|
htmlInputType(): HTMLInputType;
|
|
56
57
|
isSensitive(): boolean;
|
|
58
|
+
jsonSchemaType(): JSONSchemaType;
|
|
57
59
|
rnInputMode(): RNInputMode;
|
|
58
60
|
setDefaultValue(defaultValue: T): this;
|
|
59
61
|
setExamples(examples: T[]): this;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
1
2
|
import type { HTMLInputType } from '../targets/web.js';
|
|
2
3
|
import type { Validation } from '../Validation.js';
|
|
3
4
|
import { TBase, type TName } from './TBase.js';
|
|
@@ -7,5 +8,6 @@ export declare class TBoolean extends TBase<boolean> {
|
|
|
7
8
|
example(): boolean;
|
|
8
9
|
fmt(ifNullOrUndefined?: string | undefined): string;
|
|
9
10
|
htmlInputType(): HTMLInputType;
|
|
11
|
+
jsonSchemaType(): JSONSchemaType;
|
|
10
12
|
validate(): Validation;
|
|
11
13
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Unit } from '../../utils/index.js';
|
|
2
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
2
3
|
import type { RNInputMode } from '../targets/rn.js';
|
|
3
4
|
import type { Validation } from '../Validation.js';
|
|
4
5
|
import type { TName } from './TBase.js';
|
|
@@ -13,6 +14,7 @@ export declare class TInt<T extends Int = Int> extends TNumber<T> {
|
|
|
13
14
|
assign(raw: unknown): this;
|
|
14
15
|
example(): T;
|
|
15
16
|
getConstraints(): TIntConstraints | undefined;
|
|
17
|
+
jsonSchemaType(): JSONSchemaType;
|
|
16
18
|
max(): NonNullable<TIntConstraints['max']>;
|
|
17
19
|
min(): NonNullable<TIntConstraints['min']>;
|
|
18
20
|
rnInputMode(): RNInputMode;
|
package/dist/esm/dt/base/TInt.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Unit } from '../../utils/index.js';
|
|
2
2
|
import type { UIntQuantity } from '../final/TUIntQuantity.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { RNInputMode } from '../targets/rn.js';
|
|
4
5
|
import type { HTMLInputType } from '../targets/web.js';
|
|
5
6
|
import type { Validation } from '../Validation.js';
|
|
@@ -24,6 +25,7 @@ export declare class TNumber<T extends number = number> extends TBase<T> {
|
|
|
24
25
|
getDecimalsCount(): UIntQuantity | undefined;
|
|
25
26
|
getStep(): T | undefined;
|
|
26
27
|
htmlInputType(): HTMLInputType;
|
|
28
|
+
jsonSchemaType(): JSONSchemaType;
|
|
27
29
|
max(): NonNullable<TNumberConstraints<number>['max']>;
|
|
28
30
|
min(): NonNullable<TNumberConstraints<number>['min']>;
|
|
29
31
|
rnInputMode(): RNInputMode;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EnumOf } from '../../utils/index.js';
|
|
2
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
2
3
|
import type { Validation } from '../Validation.js';
|
|
3
4
|
import { TBase, type TName } from './TBase.js';
|
|
4
5
|
export declare const TObjectShapeValidationStrategy: {
|
|
@@ -30,6 +31,7 @@ export declare class TObject<T extends object> extends TBase<T> {
|
|
|
30
31
|
tName(): TName;
|
|
31
32
|
example(): T;
|
|
32
33
|
fmt(ifNullOrUndefined?: string | undefined): string;
|
|
34
|
+
jsonSchemaType(): JSONSchemaType;
|
|
33
35
|
validate(): Validation;
|
|
34
36
|
private valueAndExampleHaveSameKeys;
|
|
35
37
|
}
|
|
@@ -36,6 +36,43 @@ export class TObject extends TBase {
|
|
|
36
36
|
}
|
|
37
37
|
return JSON.stringify(this.raw);
|
|
38
38
|
}
|
|
39
|
+
jsonSchemaType() {
|
|
40
|
+
const example = this.example();
|
|
41
|
+
const exampleKV = Object.entries(example);
|
|
42
|
+
const properties = exampleKV.reduce((acc, [key, value]) => {
|
|
43
|
+
const k = key;
|
|
44
|
+
const typeofv = typeof value;
|
|
45
|
+
// TODO : Make this work recursively
|
|
46
|
+
switch (typeofv) {
|
|
47
|
+
case 'boolean':
|
|
48
|
+
acc[k] = { type: 'boolean' };
|
|
49
|
+
break;
|
|
50
|
+
case 'bigint':
|
|
51
|
+
case 'number':
|
|
52
|
+
acc[k] = { type: 'number' };
|
|
53
|
+
break;
|
|
54
|
+
case 'object':
|
|
55
|
+
acc[k] = {
|
|
56
|
+
additionalProperties: false,
|
|
57
|
+
properties: {},
|
|
58
|
+
type: 'object',
|
|
59
|
+
};
|
|
60
|
+
break;
|
|
61
|
+
case 'function':
|
|
62
|
+
case 'symbol':
|
|
63
|
+
case 'undefined':
|
|
64
|
+
// Nothing to do
|
|
65
|
+
break;
|
|
66
|
+
case 'string':
|
|
67
|
+
acc[k] = { type: 'string' };
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
typeofv;
|
|
71
|
+
}
|
|
72
|
+
return acc;
|
|
73
|
+
}, {});
|
|
74
|
+
return { additionalProperties: false, properties, type: 'object' };
|
|
75
|
+
}
|
|
39
76
|
validate() {
|
|
40
77
|
const validation = super.validate();
|
|
41
78
|
if (!validation.isOK()) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { HTMLInputType } from '../targets/web.js';
|
|
4
5
|
export type ApiKey = string;
|
|
5
6
|
export declare class TApiKey extends TString<ApiKey> {
|
|
6
7
|
tName(): TName;
|
|
7
8
|
example(): ApiKey;
|
|
8
9
|
htmlInputType(): HTMLInputType;
|
|
10
|
+
jsonSchemaType(): JSONSchemaType;
|
|
9
11
|
isSensitive(): boolean;
|
|
10
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { HTMLInputType } from '../targets/web.js';
|
|
4
5
|
import type { Validation } from '../Validation.js';
|
|
5
6
|
export type DateISO8601 = string;
|
|
@@ -8,5 +9,6 @@ export declare class TDateISO8601 extends TString<DateISO8601> {
|
|
|
8
9
|
example(): DateISO8601;
|
|
9
10
|
fmt(ifNullOrUndefined?: string | undefined): string;
|
|
10
11
|
htmlInputType(): HTMLInputType;
|
|
12
|
+
jsonSchemaType(): JSONSchemaType;
|
|
11
13
|
validate(): Validation;
|
|
12
14
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString, type TStringConstraints } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { RNInputMode } from '../targets/rn.js';
|
|
4
5
|
import type { HTMLInputType } from '../targets/web.js';
|
|
5
6
|
export type DomainName = string;
|
|
@@ -9,5 +10,6 @@ export declare class TDomainName extends TString<DomainName> {
|
|
|
9
10
|
tName(): TName;
|
|
10
11
|
example(): DomainName;
|
|
11
12
|
htmlInputType(): HTMLInputType;
|
|
13
|
+
jsonSchemaType(): JSONSchemaType;
|
|
12
14
|
rnInputMode(): RNInputMode;
|
|
13
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString, type TStringConstraints } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { RNInputMode } from '../targets/rn.js';
|
|
4
5
|
import type { HTMLInputType } from '../targets/web.js';
|
|
5
6
|
export type Email = string;
|
|
@@ -9,5 +10,6 @@ export declare class TEmail extends TString<Email> {
|
|
|
9
10
|
tName(): TName;
|
|
10
11
|
example(): Email;
|
|
11
12
|
htmlInputType(): HTMLInputType;
|
|
13
|
+
jsonSchemaType(): JSONSchemaType;
|
|
12
14
|
rnInputMode(): RNInputMode;
|
|
13
15
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { HTMLInputType } from '../targets/web.js';
|
|
4
5
|
export type EncryptionKey = string;
|
|
5
6
|
export declare class TEncryptionKey extends TString<EncryptionKey> {
|
|
6
7
|
tName(): TName;
|
|
7
8
|
example(): EncryptionKey;
|
|
8
9
|
htmlInputType(): HTMLInputType;
|
|
10
|
+
jsonSchemaType(): JSONSchemaType;
|
|
9
11
|
isSensitive(): boolean;
|
|
10
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConstraintsForHuman, TName } from '../base/TBase.js';
|
|
2
2
|
import { TObject } from '../base/TObject.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { HTMLInputType } from '../targets/web.js';
|
|
4
5
|
import type { Validation } from '../Validation.js';
|
|
5
6
|
import { type FileMimeType } from './TFileMimeType.js';
|
|
@@ -25,6 +26,7 @@ export declare class TFile extends TObject<File> {
|
|
|
25
26
|
example(): File;
|
|
26
27
|
getConstraintsForHuman(): ConstraintsForHuman | null;
|
|
27
28
|
htmlInputType(): HTMLInputType;
|
|
29
|
+
jsonSchemaType(): JSONSchemaType;
|
|
28
30
|
validate(): Validation;
|
|
29
31
|
getFileConstraints(): TFileConstraints;
|
|
30
32
|
fmtBytes(bytes: number, decimals?: number): string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString, type TStringConstraints } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
export type IPv4 = `${number}.${number}.${number}.${number}`;
|
|
4
5
|
export declare class TIPv4 extends TString<IPv4> {
|
|
5
6
|
static readonly FORMAT: RegExp;
|
|
6
7
|
constructor(constraints?: TStringConstraints);
|
|
7
8
|
tName(): TName;
|
|
8
9
|
example(): IPv4;
|
|
10
|
+
jsonSchemaType(): JSONSchemaType;
|
|
9
11
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString, type TStringConstraints } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
export type IPv6 = `${string}:${string}:${string}:${string}:${string}:${string}:${string}:${string}`;
|
|
4
5
|
export declare class TIPv6 extends TString<IPv6> {
|
|
5
6
|
static readonly FORMAT: RegExp;
|
|
6
7
|
constructor(constraints?: TStringConstraints);
|
|
7
8
|
tName(): TName;
|
|
8
9
|
example(): IPv6;
|
|
10
|
+
jsonSchemaType(): JSONSchemaType;
|
|
9
11
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { HTMLInputType } from '../targets/web.js';
|
|
4
5
|
import type { Validation } from '../Validation.js';
|
|
5
6
|
export type JWT = string;
|
|
@@ -7,6 +8,7 @@ export declare class TJWT extends TString<JWT> {
|
|
|
7
8
|
tName(): TName;
|
|
8
9
|
example(): JWT;
|
|
9
10
|
htmlInputType(): HTMLInputType;
|
|
11
|
+
jsonSchemaType(): JSONSchemaType;
|
|
10
12
|
isSensitive(): boolean;
|
|
11
13
|
validate(): Validation;
|
|
12
14
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { TName } from '../base/TBase.js';
|
|
2
2
|
import { TString } from '../base/TString.js';
|
|
3
|
+
import type { JSONSchemaType } from '../targets/json-schema.js';
|
|
3
4
|
import type { HTMLInputType } from '../targets/web.js';
|
|
4
5
|
export type Password = string;
|
|
5
6
|
export declare class TPassword extends TString<Password> {
|
|
6
7
|
tName(): TName;
|
|
7
8
|
example(): Password;
|
|
8
9
|
htmlInputType(): HTMLInputType;
|
|
10
|
+
jsonSchemaType(): JSONSchemaType;
|
|
9
11
|
isSensitive(): boolean;
|
|
10
12
|
}
|