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.
Files changed (189) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +3 -3
  3. package/dist/esm/apps/Helper/src/lib/layers/product.js +1 -1
  4. package/dist/esm/apps/Helper/src/lib/layers/project.js +7 -7
  5. package/dist/esm/apps/Helper/src/lib/layers/target.js +27 -11
  6. package/dist/esm/convention.d.ts +2 -0
  7. package/dist/esm/convention.js +1 -0
  8. package/dist/esm/dt/base/TBase.d.ts +2 -0
  9. package/dist/esm/dt/base/TBase.js +5 -0
  10. package/dist/esm/dt/base/TBoolean.d.ts +2 -0
  11. package/dist/esm/dt/base/TBoolean.js +3 -0
  12. package/dist/esm/dt/base/TInt.d.ts +2 -0
  13. package/dist/esm/dt/base/TInt.js +3 -0
  14. package/dist/esm/dt/base/TNumber.d.ts +2 -0
  15. package/dist/esm/dt/base/TNumber.js +3 -0
  16. package/dist/esm/dt/base/TObject.d.ts +2 -0
  17. package/dist/esm/dt/base/TObject.js +37 -0
  18. package/dist/esm/dt/final/TApiKey.d.ts +2 -0
  19. package/dist/esm/dt/final/TApiKey.js +3 -0
  20. package/dist/esm/dt/final/TDateISO8601.d.ts +2 -0
  21. package/dist/esm/dt/final/TDateISO8601.js +3 -0
  22. package/dist/esm/dt/final/TDomainName.d.ts +2 -0
  23. package/dist/esm/dt/final/TDomainName.js +3 -0
  24. package/dist/esm/dt/final/TEmail.d.ts +2 -0
  25. package/dist/esm/dt/final/TEmail.js +3 -0
  26. package/dist/esm/dt/final/TEncryptionKey.d.ts +2 -0
  27. package/dist/esm/dt/final/TEncryptionKey.js +3 -0
  28. package/dist/esm/dt/final/TFile.d.ts +2 -0
  29. package/dist/esm/dt/final/TFile.js +3 -0
  30. package/dist/esm/dt/final/TIPv4.d.ts +2 -0
  31. package/dist/esm/dt/final/TIPv4.js +3 -0
  32. package/dist/esm/dt/final/TIPv6.d.ts +2 -0
  33. package/dist/esm/dt/final/TIPv6.js +3 -0
  34. package/dist/esm/dt/final/TJWT.d.ts +2 -0
  35. package/dist/esm/dt/final/TJWT.js +3 -0
  36. package/dist/esm/dt/final/TPassword.d.ts +2 -0
  37. package/dist/esm/dt/final/TPassword.js +3 -0
  38. package/dist/esm/dt/final/TSSHPrivateKey.d.ts +2 -0
  39. package/dist/esm/dt/final/TSSHPrivateKey.js +3 -0
  40. package/dist/esm/dt/final/TTime.d.ts +2 -0
  41. package/dist/esm/dt/final/TTime.js +3 -0
  42. package/dist/esm/dt/final/TURL.d.ts +2 -0
  43. package/dist/esm/dt/final/TURL.js +3 -0
  44. package/dist/esm/dt/index.d.ts +1 -0
  45. package/dist/esm/dt/targets/json-schema.d.ts +36 -0
  46. package/dist/esm/error/funcs.d.ts +4 -0
  47. package/dist/esm/error/funcs.js +5 -1
  48. package/dist/esm/error/index.d.ts +1 -1
  49. package/dist/esm/error/index.js +1 -1
  50. package/dist/esm/i18n/locales/de.js +2 -0
  51. package/dist/esm/i18n/locales/en.js +2 -0
  52. package/dist/esm/i18n/locales/es.js +2 -0
  53. package/dist/esm/i18n/locales/fr.js +2 -0
  54. package/dist/esm/i18n/types.d.ts +1 -1
  55. package/dist/esm/index.d.ts +3 -0
  56. package/dist/esm/index.js +3 -0
  57. package/dist/esm/index.node-express.d.ts +2 -0
  58. package/dist/esm/index.node-express.js +1 -0
  59. package/dist/esm/index.node-hono.d.ts +2 -0
  60. package/dist/esm/index.node-hono.js +1 -0
  61. package/dist/esm/index.node-mcp-express.d.ts +3 -0
  62. package/dist/esm/index.node-mcp-express.js +2 -0
  63. package/dist/esm/index.node-mcp-hono.d.ts +3 -0
  64. package/dist/esm/index.node-mcp-hono.js +2 -0
  65. package/dist/esm/index.node-mcp.d.ts +3 -1
  66. package/dist/esm/index.node-mcp.js +3 -1
  67. package/dist/esm/product/manifest.d.ts +2 -0
  68. package/dist/esm/products/Helper/i18n.d.ts +2 -0
  69. package/dist/esm/std/impl/SimpleMapI18nManager.d.ts +1 -1
  70. package/dist/esm/std/impl/SimpleMapI18nManager.js +4 -2
  71. package/dist/esm/std/lib/settings.js +4 -5
  72. package/dist/esm/target/edge-worker-hono-server/SyncEdgeWorkerHonoServerManager.d.ts +8 -2
  73. package/dist/esm/target/edge-worker-hono-server/SyncEdgeWorkerHonoServerManager.js +20 -9
  74. package/dist/esm/target/index.d.ts +2 -1
  75. package/dist/esm/target/index.js +1 -1
  76. package/dist/esm/target/lib/client/AuthDataStore.d.ts +5 -0
  77. package/dist/esm/target/lib/client/AuthDataStore.js +1 -0
  78. package/dist/esm/target/lib/client/impl/InMemoryAuthDataStore.d.ts +7 -0
  79. package/dist/esm/target/lib/client/impl/InMemoryAuthDataStore.js +20 -0
  80. package/dist/esm/target/lib/client/impl/MixedServerClientManager.d.ts +15 -0
  81. package/dist/esm/target/lib/client/impl/MixedServerClientManager.js +44 -0
  82. package/dist/esm/target/lib/json-schema/error.d.ts +3 -0
  83. package/dist/esm/target/lib/json-schema/error.js +14 -0
  84. package/dist/esm/target/lib/json-schema/input.d.ts +16 -0
  85. package/dist/esm/target/lib/json-schema/input.js +67 -0
  86. package/dist/esm/target/lib/json-schema/output.d.ts +19 -0
  87. package/dist/esm/target/lib/json-schema/output.js +128 -0
  88. package/dist/esm/target/lib/manifest.d.ts +32 -1
  89. package/dist/esm/target/lib/manifest.js +22 -1
  90. package/dist/esm/target/lib/mcp-server/MCPServerRequestHandler.d.ts +16 -0
  91. package/dist/esm/target/lib/mcp-server/MCPServerRequestHandler.js +54 -0
  92. package/dist/esm/target/lib/mcp-server/consts.d.ts +1 -0
  93. package/dist/esm/target/lib/mcp-server/consts.js +1 -0
  94. package/dist/esm/target/lib/mcp-server/funcs.d.ts +13 -0
  95. package/dist/esm/target/lib/mcp-server/funcs.js +84 -0
  96. package/dist/esm/target/lib/mcp-server/http/MCPHTTPRequestHandlerBuilder.d.ts +14 -0
  97. package/dist/esm/target/lib/mcp-server/http/MCPHTTPRequestHandlerBuilder.js +1 -0
  98. package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.d.ts +5 -0
  99. package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.js +18 -0
  100. package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.d.ts +15 -0
  101. package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.js +88 -0
  102. package/dist/esm/target/lib/mcp-server/http/express/types.d.ts +3 -0
  103. package/dist/esm/target/lib/mcp-server/http/express/types.js +1 -0
  104. package/dist/esm/target/lib/mcp-server/http/funcs.d.ts +6 -0
  105. package/dist/esm/target/lib/mcp-server/http/funcs.js +50 -0
  106. package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.d.ts +5 -0
  107. package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.js +18 -0
  108. package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoProtocolRequestHandlerBuilder.d.ts +15 -0
  109. package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoProtocolRequestHandlerBuilder.js +88 -0
  110. package/dist/esm/target/lib/mcp-server/http/hono/types.d.ts +3 -0
  111. package/dist/esm/target/lib/mcp-server/http/hono/types.js +1 -0
  112. package/dist/esm/target/lib/mcp-server/stdio/MCPStdioRequestHandler.d.ts +31 -0
  113. package/dist/esm/target/lib/mcp-server/stdio/MCPStdioRequestHandler.js +108 -0
  114. package/dist/esm/target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.d.ts +7 -0
  115. package/dist/esm/target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.js +36 -0
  116. package/dist/esm/target/lib/mcp-server/stdio/consts.d.ts +2 -0
  117. package/dist/esm/target/lib/mcp-server/stdio/consts.js +3 -0
  118. package/dist/esm/target/lib/mcp-server/stdio/funcs.d.ts +2 -0
  119. package/dist/esm/target/lib/mcp-server/stdio/funcs.js +10 -0
  120. package/dist/esm/target/lib/mcp-server/stdio/input.d.ts +10 -0
  121. package/dist/esm/target/lib/mcp-server/stdio/input.js +15 -0
  122. package/dist/esm/target/lib/mcp-server/types.d.ts +2 -0
  123. package/dist/esm/target/lib/mcp-server/types.js +1 -0
  124. package/dist/esm/target/lib/openapi/OpenAPISpecBuilder.d.ts +25 -0
  125. package/dist/esm/target/lib/openapi/OpenAPISpecBuilder.js +135 -0
  126. package/dist/esm/target/lib/openapi/funcs.d.ts +11 -0
  127. package/dist/esm/target/lib/openapi/funcs.js +148 -0
  128. package/dist/esm/target/lib/openapi/types.d.ts +98 -0
  129. package/dist/esm/target/lib/openapi/types.js +1 -0
  130. package/dist/esm/target/lib/rn/input.d.ts +3 -0
  131. package/dist/esm/target/lib/server/AuthCookieCreator.d.ts +2 -1
  132. package/dist/esm/target/lib/server/ServerBooter.d.ts +4 -2
  133. package/dist/esm/target/lib/server/ServerBooter.js +44 -11
  134. package/dist/esm/target/lib/server/ServerManager.d.ts +29 -9
  135. package/dist/esm/target/lib/server/ServerRequestHandler.d.ts +10 -6
  136. package/dist/esm/target/lib/server/ServerRequestHandler.js +35 -25
  137. package/dist/esm/target/lib/server/consts.d.ts +4 -0
  138. package/dist/esm/target/lib/server/consts.js +26 -0
  139. package/dist/esm/target/lib/server-express/CORSMiddlewareBuilder.d.ts +15 -0
  140. package/dist/esm/target/lib/server-express/CORSMiddlewareBuilder.js +55 -0
  141. package/dist/esm/target/lib/server-express/funcs.d.ts +2 -1
  142. package/dist/esm/target/lib/server-express/funcs.js +6 -5
  143. package/dist/esm/target/lib/server-hono/CORSMiddlewareBuilder.d.ts +14 -0
  144. package/dist/esm/target/lib/server-hono/CORSMiddlewareBuilder.js +46 -0
  145. package/dist/esm/target/lib/server-hono/funcs.d.ts +2 -1
  146. package/dist/esm/target/lib/server-hono/funcs.js +6 -3
  147. package/dist/esm/target/lib/shared.d.ts +5 -0
  148. package/dist/esm/target/lib/shared.js +3 -1
  149. package/dist/esm/target/nextjs-server/NextJSServerManager.d.ts +5 -1
  150. package/dist/esm/target/nextjs-server/NextJSServerManager.js +6 -0
  151. package/dist/esm/target/node-express-server/NodeExpressServerManager.d.ts +12 -4
  152. package/dist/esm/target/node-express-server/NodeExpressServerManager.js +34 -15
  153. package/dist/esm/target/node-hono-server/NodeHonoServerManager.d.ts +11 -3
  154. package/dist/esm/target/node-hono-server/NodeHonoServerManager.js +31 -12
  155. package/dist/esm/target/{node-mcp-server/NodeLocalStdioMCPServerManager.d.ts → node-mcp-server-stdio/NodeMCPStdioServerManager.d.ts} +12 -21
  156. package/dist/esm/target/node-mcp-server-stdio/NodeMCPStdioServerManager.js +108 -0
  157. package/dist/esm/testing/impl/newNodeAppTester.js +5 -0
  158. package/dist/esm/uc/UC.d.ts +2 -0
  159. package/dist/esm/uc/UC.js +16 -1
  160. package/dist/esm/uc/cardinality.d.ts +7 -0
  161. package/dist/esm/uc/cardinality.js +14 -0
  162. package/dist/esm/uc/examples.d.ts +2 -0
  163. package/dist/esm/uc/examples.js +12 -0
  164. package/dist/esm/uc/helpers/UCOutputReader.d.ts +2 -2
  165. package/dist/esm/uc/helpers/UCOutputReader.js +2 -2
  166. package/dist/esm/uc/index.d.ts +2 -0
  167. package/dist/esm/uc/index.js +2 -0
  168. package/dist/esm/uc/input-field.d.ts +3 -6
  169. package/dist/esm/uc/input-field.js +5 -21
  170. package/dist/esm/uc/metadata.d.ts +7 -0
  171. package/dist/esm/uc/metadata.js +10 -0
  172. package/dist/esm/uc/opi.d.ts +3 -1
  173. package/dist/esm/uc/opi.js +4 -1
  174. package/dist/esm/uc/output-field.d.ts +14 -1
  175. package/dist/esm/uc/output-field.js +11 -1
  176. package/dist/esm/uc/utils/ucHTTPContract.js +1 -1
  177. package/dist/esm/utils/bundling/funcs.js +1 -1
  178. package/dist/esm/utils/bundling/vite/plugin.d.ts +1 -1
  179. package/dist/esm/utils/http/types.d.ts +5 -0
  180. package/dist/esm/utils/index.d.ts +2 -1
  181. package/dist/esm/utils/index.js +1 -0
  182. package/dist/esm/utils/streams/funcs.d.ts +2 -0
  183. package/dist/esm/utils/streams/funcs.js +10 -0
  184. package/package.json +25 -14
  185. package/dist/esm/target/node-mcp-server/NodeLocalStdioMCPServerManager.js +0 -183
  186. package/dist/esm/target/node-mcp-server/funcs.d.ts +0 -7
  187. package/dist/esm/target/node-mcp-server/funcs.js +0 -45
  188. package/dist/esm/target/node-mcp-server/types.d.ts +0 -19
  189. /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
- npx libmodulor CreateProject --projectName my-super-project
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.28.0/LICENSE)
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 'libmodulor/locales/${I18N_DEFAULT_LANG}';
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.12",
91
- "@types/node": "^25.6.0",
92
- "@vitest/coverage-v8": "^3.2.4",
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.7.0",
97
+ "fast-check": "^4.8.0",
98
98
  "helmet": "^8.1.0",
99
- "jose": "^6.2.2",
99
+ "jose": "^6.2.3",
100
100
  "typescript": "^6.0.3",
101
- "vite": "^6.4.2",
102
- "vitest": "^3.2.4"
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 NODE_MCP_SERVER_CONTAINER_TS = `import { Container } from 'inversify';
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 { NodeLocalStdioMCPServerManager } from '${LIB_NAME}/node-mcp';
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
- .bind<ServerManager>('ServerManager')
126
- .to(NodeLocalStdioMCPServerManager);
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 NODE_MCP_SERVER_INDEX_TS = `import { MCPServerBooter } from '${LIB_NAME}/node-mcp';
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 NODE_MCP_SERVER_SETTINGS_TS = `import {
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'], NODE_MCP_SERVER_CONTAINER_TS],
193
- [['.', 'index.ts'], NODE_MCP_SERVER_INDEX_TS],
194
- [['.', 'settings.ts'], NODE_MCP_SERVER_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(),
@@ -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;
@@ -83,3 +83,4 @@ export const APPS_PATH_FROM_PRODUCT_TARGET_PATH = [
83
83
  APPS_ROOT_DIR_NAME, // src/apps
84
84
  ];
85
85
  export const TARGET_NAME_PLACEHOLDER = 'node-express-server';
86
+ export const TARGET_DEF_FILE_NAME = 'def.ts';
@@ -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;
@@ -66,6 +66,11 @@ export class TBase {
66
66
  isSensitive() {
67
67
  return false;
68
68
  }
69
+ jsonSchemaType() {
70
+ return {
71
+ type: 'string',
72
+ };
73
+ }
69
74
  rnInputMode() {
70
75
  return 'text';
71
76
  }
@@ -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
  }
@@ -36,6 +36,9 @@ export class TBoolean extends TBase {
36
36
  htmlInputType() {
37
37
  return 'checkbox';
38
38
  }
39
+ jsonSchemaType() {
40
+ return { type: 'boolean' };
41
+ }
39
42
  validate() {
40
43
  const validation = super.validate();
41
44
  if (!validation.isOK()) {
@@ -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;
@@ -34,6 +34,9 @@ export class TInt extends TNumber {
34
34
  getConstraints() {
35
35
  return this.constraints;
36
36
  }
37
+ jsonSchemaType() {
38
+ return { type: 'integer' };
39
+ }
37
40
  max() {
38
41
  return this.constraints?.max ?? TInt.DEFAULT_MAX;
39
42
  }
@@ -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;
@@ -49,6 +49,9 @@ export class TNumber extends TBase {
49
49
  htmlInputType() {
50
50
  return 'number';
51
51
  }
52
+ jsonSchemaType() {
53
+ return { type: 'number' };
54
+ }
52
55
  max() {
53
56
  return this.constraints?.max ?? TNumber.DEFAULT_MAX;
54
57
  }
@@ -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
  }
@@ -9,6 +9,9 @@ export class TApiKey extends TString {
9
9
  htmlInputType() {
10
10
  return 'password';
11
11
  }
12
+ jsonSchemaType() {
13
+ return { format: 'password', type: 'string' };
14
+ }
12
15
  isSensitive() {
13
16
  return true;
14
17
  }
@@ -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
  }
@@ -15,6 +15,9 @@ export class TDateISO8601 extends TString {
15
15
  htmlInputType() {
16
16
  return 'date';
17
17
  }
18
+ jsonSchemaType() {
19
+ return { format: 'date', type: 'string' };
20
+ }
18
21
  validate() {
19
22
  const validation = super.validate();
20
23
  if (!validation.isOK()) {
@@ -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
  }
@@ -16,6 +16,9 @@ export class TDomainName extends TString {
16
16
  htmlInputType() {
17
17
  return 'url';
18
18
  }
19
+ jsonSchemaType() {
20
+ return { format: 'hostname', type: 'string' };
21
+ }
19
22
  rnInputMode() {
20
23
  return 'url';
21
24
  }
@@ -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
  }
@@ -18,6 +18,9 @@ export class TEmail extends TString {
18
18
  htmlInputType() {
19
19
  return 'email';
20
20
  }
21
+ jsonSchemaType() {
22
+ return { format: 'email', type: 'string' };
23
+ }
21
24
  rnInputMode() {
22
25
  return 'email';
23
26
  }
@@ -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
  }
@@ -9,6 +9,9 @@ export class TEncryptionKey extends TString {
9
9
  htmlInputType() {
10
10
  return 'password';
11
11
  }
12
+ jsonSchemaType() {
13
+ return { format: 'password', type: 'string' };
14
+ }
12
15
  isSensitive() {
13
16
  return true;
14
17
  }
@@ -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;
@@ -53,6 +53,9 @@ export class TFile extends TObject {
53
53
  htmlInputType() {
54
54
  return 'file';
55
55
  }
56
+ jsonSchemaType() {
57
+ return { format: 'binary', type: 'string' };
58
+ }
56
59
  validate() {
57
60
  const validation = super.validate();
58
61
  if (!validation.isOK()) {
@@ -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
  }
@@ -13,4 +13,7 @@ export class TIPv4 extends TString {
13
13
  example() {
14
14
  return '255.255.255.255';
15
15
  }
16
+ jsonSchemaType() {
17
+ return { format: 'ipv4', type: 'string' };
18
+ }
16
19
  }
@@ -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
  }
@@ -14,4 +14,7 @@ export class TIPv6 extends TString {
14
14
  example() {
15
15
  return '2001:0db8:85a3:0000:0000:8a2e:0370:7334';
16
16
  }
17
+ jsonSchemaType() {
18
+ return { format: 'ipv6', type: 'string' };
19
+ }
17
20
  }
@@ -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
  }
@@ -9,6 +9,9 @@ export class TJWT extends TString {
9
9
  htmlInputType() {
10
10
  return 'password';
11
11
  }
12
+ jsonSchemaType() {
13
+ return { format: 'password', type: 'string' };
14
+ }
12
15
  isSensitive() {
13
16
  return true;
14
17
  }
@@ -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
  }