libmodulor 0.17.0 → 0.18.1
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 +14 -0
- package/README.md +1 -1
- package/dist/esm/app/workers/AppSrcFilePathBuilder.js +1 -1
- package/dist/esm/apps/Helper/src/lib/project.js +53 -8
- package/dist/esm/apps/Helper/src/ucds/CreateProjectUCD.js +1 -1
- package/dist/esm/dt/DataType.d.ts +9 -9
- package/dist/esm/dt/base/TBase.d.ts +1 -1
- package/dist/esm/dt/base/TBoolean.d.ts +1 -1
- package/dist/esm/dt/base/TInt.d.ts +1 -1
- package/dist/esm/dt/base/TNumber.d.ts +1 -1
- package/dist/esm/dt/final/TDateISO8601.d.ts +1 -1
- package/dist/esm/dt/final/TEmail.js +1 -1
- package/dist/esm/dt/final/TFile.d.ts +1 -1
- package/dist/esm/dt/final/TGeolocation.d.ts +1 -1
- package/dist/esm/dt/final/TJSONString.d.ts +1 -1
- package/dist/esm/dt/final/TJSONString.js +1 -1
- package/dist/esm/dt/final/TJWT.d.ts +1 -1
- package/dist/esm/dt/final/TJWT.js +1 -1
- package/dist/esm/dt/final/TURL.d.ts +1 -1
- package/dist/esm/dt/final/TURL.js +1 -1
- package/dist/esm/dt/index.d.ts +16 -16
- package/dist/esm/dt/index.js +8 -8
- package/dist/esm/i18n/locales/en.js +2 -2
- package/dist/esm/i18n/locales/fr.js +3 -3
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.react.d.ts +3 -3
- package/dist/esm/index.web.d.ts +1 -1
- package/dist/esm/index.web.js +1 -1
- package/dist/esm/std/HTTPAPICallExecutor.d.ts +2 -5
- package/dist/esm/std/HTTPAPICaller.d.ts +6 -0
- package/dist/esm/std/consts.d.ts +1 -1
- package/dist/esm/std/impl/JoseJWTManager.js +1 -1
- package/dist/esm/std/impl/MistralAILLMManager.js +2 -2
- package/dist/esm/std/impl/NodeCryptoManager.d.ts +1 -1
- package/dist/esm/std/impl/NodeEnvironmentManager.js +1 -1
- package/dist/esm/std/impl/NodeFSManager.js +1 -1
- package/dist/esm/std/impl/OllamaLLMManager.js +1 -1
- package/dist/esm/std/impl/OpenAILLMManager.js +2 -2
- package/dist/esm/std/impl/SimpleHTTPAPICaller.js +2 -2
- package/dist/esm/std/impl/WebCryptoManager.d.ts +1 -1
- package/dist/esm/std/index.d.ts +3 -3
- package/dist/esm/std/index.js +3 -3
- package/dist/esm/target/lib/cli/CommandExecutor.js +2 -2
- package/dist/esm/target/lib/react/DIContextProvider.d.ts +2 -2
- package/dist/esm/target/lib/react/DIContextProvider.js +4 -3
- package/dist/esm/target/lib/react/StyleContextProvider.d.ts +2 -2
- package/dist/esm/target/lib/react/StyleContextProvider.js +3 -2
- package/dist/esm/target/lib/react/UCContainer.js +4 -3
- package/dist/esm/target/lib/react/UCEntrypoint.d.ts +1 -1
- package/dist/esm/target/lib/react/UCEntrypoint.js +2 -2
- package/dist/esm/target/lib/react/UCOutputFieldValueFragment.d.ts +1 -1
- package/dist/esm/target/lib/react/UCOutputFieldValueFragment.js +2 -2
- package/dist/esm/target/lib/react/UCPanel.js +12 -15
- package/dist/esm/target/lib/server/RequestChecker.js +1 -1
- package/dist/esm/target/lib/server/ServerRequestHandler.js +3 -3
- package/dist/esm/target/node-core-cli/NodeCoreCLIManager.js +1 -1
- package/dist/esm/target/node-core-cli/commands.js +1 -1
- package/dist/esm/target/node-express-server/NodeExpressServerManager.js +1 -1
- package/dist/esm/target/node-hono-server/NodeHonoServerManager.js +1 -1
- package/dist/esm/target/node-mcp-server/NodeLocalStdioMCPServerManager.js +2 -2
- package/dist/esm/target/node-mcp-server/funcs.js +1 -1
- package/dist/esm/target/react-native-pure/UCAutoExecLoader.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCAutoExecLoader.js +2 -2
- package/dist/esm/target/react-native-pure/UCEntrypointTouchable.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCEntrypointTouchable.js +2 -3
- package/dist/esm/target/react-native-pure/UCExecTouchable.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCExecTouchable.js +2 -3
- package/dist/esm/target/react-native-pure/UCForm.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCForm.js +2 -4
- package/dist/esm/target/react-native-pure/UCFormField.js +4 -7
- package/dist/esm/target/react-native-pure/UCFormFieldControl.js +12 -12
- package/dist/esm/target/react-native-pure/UCFormFieldDesc.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormFieldDesc.js +2 -2
- package/dist/esm/target/react-native-pure/UCFormFieldErr.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormFieldErr.js +2 -2
- package/dist/esm/target/react-native-pure/UCFormFieldLabel.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormFieldLabel.js +2 -4
- package/dist/esm/target/react-native-pure/UCFormSubmitControl.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormSubmitControl.js +2 -3
- package/dist/esm/target/react-native-pure/UCOutputFieldValue.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCOutputFieldValue.js +2 -3
- package/dist/esm/target/react-web-pure/UCAutoExecLoader.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCAutoExecLoader.js +2 -2
- package/dist/esm/target/react-web-pure/UCEntrypointTouchable.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCEntrypointTouchable.js +2 -2
- package/dist/esm/target/react-web-pure/UCExecTouchable.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCExecTouchable.js +2 -2
- package/dist/esm/target/react-web-pure/UCForm.js +3 -4
- package/dist/esm/target/react-web-pure/UCFormField.js +4 -7
- package/dist/esm/target/react-web-pure/UCFormFieldControl.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCFormFieldControl.js +5 -7
- package/dist/esm/target/react-web-pure/UCFormFieldDesc.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCFormFieldDesc.js +2 -2
- package/dist/esm/target/react-web-pure/UCFormFieldErr.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCFormFieldErr.js +2 -2
- package/dist/esm/target/react-web-pure/UCFormFieldLabel.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCFormFieldLabel.js +2 -4
- package/dist/esm/target/react-web-pure/UCFormSubmitControl.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCFormSubmitControl.js +2 -2
- package/dist/esm/target/react-web-pure/UCOutputFieldValue.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCOutputFieldValue.js +2 -3
- package/dist/esm/testing/AppTester.d.ts +2 -2
- package/dist/esm/testing/AppTester.js +2 -2
- package/dist/esm/testing/UCDefASTParser.js +1 -1
- package/dist/esm/testing/impl/SimpleAppDocsEmitter.js +1 -1
- package/dist/esm/testing/impl/TypeScriptLibUCDefASTParser.d.ts +1 -1
- package/dist/esm/testing/impl/TypeScriptLibUCDefASTParser.js +2 -3
- package/dist/esm/testing/index.d.ts +6 -6
- package/dist/esm/testing/index.js +2 -2
- package/dist/esm/testing/uc-auth.js +1 -1
- package/dist/esm/testing/workers/AppTesterCtxInitializer.js +1 -1
- package/dist/esm/testing/workers/UCExecutor.js +1 -1
- package/dist/esm/testing/workers/checkers/UCDefSourcesChecker.d.ts +1 -1
- package/dist/esm/testing/workers/checkers/UCDefSourcesChecker.js +3 -3
- package/dist/esm/uc/UC.d.ts +2 -2
- package/dist/esm/uc/UC.js +2 -2
- package/dist/esm/uc/UCInputField.d.ts +1 -1
- package/dist/esm/uc/helpers/UCOutputReader.d.ts +3 -3
- package/dist/esm/uc/impl/HTTPUCTransporter.d.ts +1 -1
- package/dist/esm/uc/impl/HTTPUCTransporter.js +3 -4
- package/dist/esm/uc/impl/InMemoryUCDataStore.d.ts +1 -1
- package/dist/esm/uc/impl/KnexUCDataStore.d.ts +1 -1
- package/dist/esm/uc/impl/SimpleUCManager.d.ts +2 -2
- package/dist/esm/uc/index.d.ts +30 -30
- package/dist/esm/uc/index.js +30 -30
- package/dist/esm/uc/io/input/AggregateInput.d.ts +1 -1
- package/dist/esm/uc/io/input/ListInput.d.ts +1 -1
- package/dist/esm/uc/main.d.ts +1 -1
- package/dist/esm/uc/manager.d.ts +2 -2
- package/dist/esm/uc/output-part.d.ts +1 -1
- package/dist/esm/uc/policy.d.ts +1 -1
- package/dist/esm/uc/transporter.d.ts +1 -1
- package/dist/esm/uc/utils/appendUCInputToURL.d.ts +1 -1
- package/dist/esm/uc/utils/fmtVal.d.ts +1 -1
- package/dist/esm/uc/utils/rInput.d.ts +1 -1
- package/dist/esm/uc/utils/recIs.d.ts +1 -1
- package/dist/esm/uc/utils/ucHTTPContract.d.ts +1 -1
- package/dist/esm/uc/utils/ucMountingPoint.d.ts +1 -1
- package/dist/esm/uc/workers/SimpleAggregateFinder.d.ts +1 -1
- package/dist/esm/uc/workers/SimpleAggregateOwnershipChecker.d.ts +2 -2
- package/dist/esm/uc/workers/UCBuilder.d.ts +1 -1
- package/dist/esm/uc/workers/UCExecChecker.d.ts +1 -1
- package/dist/esm/uc/workers/UCInputFilesProcessor.d.ts +1 -1
- package/dist/esm/uc/workers/UCInputValidator.d.ts +1 -1
- package/dist/esm/utils/index.d.ts +1 -1
- package/dist/esm/utils/ioc/bindNodeCore.js +1 -1
- package/dist/esm/utils/numbers/fmt.js +1 -1
- package/package.json +8 -8
- package/pnpm-workspace.yaml +5 -4
- package/tsconfig.json +36 -0
package/dist/esm/std/consts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmailManagerSettings } from './EmailManager.js';
|
|
2
|
-
import type { JWTManagerSettings } from './JWTManager.js';
|
|
3
2
|
import type { JobManagerSettings } from './JobManager.js';
|
|
3
|
+
import type { JWTManagerSettings } from './JWTManager.js';
|
|
4
4
|
import type { LoggerSettings } from './Logger.js';
|
|
5
5
|
export declare const STD_DEFAULT_EMAIL_MANAGER_SETTINGS: EmailManagerSettings;
|
|
6
6
|
export declare const STD_DEFAULT_JOB_MANAGER_SETTINGS: JobManagerSettings;
|
|
@@ -11,7 +11,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
13
|
import { inject, injectable } from 'inversify';
|
|
14
|
-
import {
|
|
14
|
+
import { decodeJwt, decodeProtectedHeader, importPKCS8, importSPKI, jwtVerify, SignJWT, } from 'jose';
|
|
15
15
|
import { JWSSignatureVerificationFailed } from 'jose/errors';
|
|
16
16
|
import { UnauthorizedError } from '../../error/index.js';
|
|
17
17
|
import { assertIsDefined } from '../../utils/index.js';
|
|
@@ -29,8 +29,8 @@ let MistralAILLMManager = class MistralAILLMManager {
|
|
|
29
29
|
async send(req, opts) {
|
|
30
30
|
return await this.httpAPICaller.exec({
|
|
31
31
|
authorizationHeader: {
|
|
32
|
-
value: opts?.auth?.apiKey ?? this.s().mai_api_key,
|
|
33
32
|
prefix: 'Bearer',
|
|
33
|
+
value: opts?.auth?.apiKey ?? this.s().mai_api_key,
|
|
34
34
|
},
|
|
35
35
|
errBuilder: async (error) => {
|
|
36
36
|
if ('message' in error) {
|
|
@@ -40,8 +40,8 @@ let MistralAILLMManager = class MistralAILLMManager {
|
|
|
40
40
|
},
|
|
41
41
|
method: 'POST',
|
|
42
42
|
req: {
|
|
43
|
-
envelope: 'json',
|
|
44
43
|
builder: async () => req,
|
|
44
|
+
envelope: 'json',
|
|
45
45
|
},
|
|
46
46
|
urlBuilder: async () => `${MistralAILLMManager_1.BASE_URL}/chat/completions`,
|
|
47
47
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Password, UIntQuantity, UUID } from '../../dt/index.js';
|
|
2
2
|
import type { BufferManagerBase64String } from '../BufferManager.js';
|
|
3
|
-
import type { CryptoManager, CryptoManagerBinaryToTextEncoding,
|
|
3
|
+
import type { CryptoManager, CryptoManagerBinaryToTextEncoding, CryptoManagerHash, CryptoManagerHashAlgorithm, CryptoManagerHMACKey, CryptoManagerHMACKeyEncoding, CryptoManagerRandomString, CryptoManagerSalt, CryptoManagerSaltedScrypt } from '../CryptoManager.js';
|
|
4
4
|
export declare class NodeCryptoManager implements CryptoManager {
|
|
5
5
|
clear(): Promise<void>;
|
|
6
6
|
hash(algorithm: CryptoManagerHashAlgorithm, base: string, binaryToTextEncoding: CryptoManagerBinaryToTextEncoding): CryptoManagerHash;
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { appendFile, chmod, cp, mkdir,
|
|
7
|
+
import { appendFile, chmod, cp, mkdir, readdir, readFile, rm, stat, writeFile, } from 'node:fs/promises';
|
|
8
8
|
import { extname, join, parse } from 'node:path';
|
|
9
9
|
import { injectable } from 'inversify';
|
|
10
10
|
import { FSManagerItemInfoType, } from '../FSManager.js';
|
|
@@ -36,12 +36,12 @@ let OllamaLLMManager = class OllamaLLMManager {
|
|
|
36
36
|
choices: [{ message: { content: res.response } }],
|
|
37
37
|
}),
|
|
38
38
|
req: {
|
|
39
|
-
envelope: 'json',
|
|
40
39
|
builder: async () => ({
|
|
41
40
|
model: req.model,
|
|
42
41
|
prompt: firstMessage.content,
|
|
43
42
|
stream: false,
|
|
44
43
|
}),
|
|
44
|
+
envelope: 'json',
|
|
45
45
|
},
|
|
46
46
|
urlBuilder: async () => `${this.s().oll_base_url}/api/generate`,
|
|
47
47
|
});
|
|
@@ -29,14 +29,14 @@ let OpenAILLMManager = class OpenAILLMManager {
|
|
|
29
29
|
async send(req, opts) {
|
|
30
30
|
return await this.httpAPICaller.exec({
|
|
31
31
|
authorizationHeader: {
|
|
32
|
-
value: opts?.auth?.apiKey ?? this.s().oai_api_key,
|
|
33
32
|
prefix: 'Bearer',
|
|
33
|
+
value: opts?.auth?.apiKey ?? this.s().oai_api_key,
|
|
34
34
|
},
|
|
35
35
|
errBuilder: async (error) => error.error.message,
|
|
36
36
|
method: 'POST',
|
|
37
37
|
req: {
|
|
38
|
-
envelope: 'json',
|
|
39
38
|
builder: async () => req,
|
|
39
|
+
envelope: 'json',
|
|
40
40
|
},
|
|
41
41
|
urlBuilder: async () => `${OpenAILLMManager_1.BASE_URL}/chat/completions`,
|
|
42
42
|
});
|
|
@@ -96,13 +96,13 @@ let SimpleHTTPAPICaller = class SimpleHTTPAPICaller {
|
|
|
96
96
|
}
|
|
97
97
|
if (authorizationHeader) {
|
|
98
98
|
const { prefix, value } = authorizationHeader;
|
|
99
|
-
headers
|
|
99
|
+
headers.Authorization = [prefix, value].join(' ').trim();
|
|
100
100
|
}
|
|
101
101
|
if (basicAuth) {
|
|
102
102
|
const { password, username } = basicAuth;
|
|
103
103
|
const prefix = 'Basic';
|
|
104
104
|
const value = this.bufferManager.encodeBase64([username, password].join(':'));
|
|
105
|
-
headers
|
|
105
|
+
headers.Authorization = [prefix, value].join(' ').trim();
|
|
106
106
|
}
|
|
107
107
|
if (additionalHeadersBuilder) {
|
|
108
108
|
const additionalHeaders = await additionalHeadersBuilder();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Password, UIntQuantity, UUID } from '../../dt/index.js';
|
|
2
2
|
import type { BufferManagerBase64String } from '../BufferManager.js';
|
|
3
|
-
import type { CryptoManager,
|
|
3
|
+
import type { CryptoManager, CryptoManagerHash, CryptoManagerHashAlgorithm, CryptoManagerHMACKey, CryptoManagerHMACKeyEncoding, CryptoManagerRandomString, CryptoManagerSalt, CryptoManagerSaltedScrypt } from '../CryptoManager.js';
|
|
4
4
|
export declare class WebCryptoManager implements CryptoManager {
|
|
5
5
|
clear(): Promise<void>;
|
|
6
6
|
hash(_algorithm: CryptoManagerHashAlgorithm, _base: string): CryptoManagerHash;
|
package/dist/esm/std/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './consts.js';
|
|
2
1
|
export * from './BufferManager.js';
|
|
3
2
|
export * from './ClockManager.js';
|
|
4
3
|
export * from './CryptoManager.js';
|
|
4
|
+
export * from './consts.js';
|
|
5
5
|
export * from './EmailManager.js';
|
|
6
6
|
export * from './EnvironmentManager.js';
|
|
7
7
|
export * from './ExternalResourceInstaller.js';
|
|
8
8
|
export * from './ExternalResourceManager.js';
|
|
9
|
-
export * from './FSManager.js';
|
|
10
9
|
export * from './FormDataBuilder.js';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './FSManager.js';
|
|
12
11
|
export * from './HTTPAPICallExecutor.js';
|
|
12
|
+
export * from './HTTPAPICaller.js';
|
|
13
13
|
export * from './I18nManager.js';
|
|
14
14
|
export * from './JobManager.js';
|
|
15
15
|
export * from './JWTManager.js';
|
package/dist/esm/std/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './consts.js';
|
|
2
1
|
export * from './BufferManager.js';
|
|
3
2
|
export * from './ClockManager.js';
|
|
4
3
|
export * from './CryptoManager.js';
|
|
4
|
+
export * from './consts.js';
|
|
5
5
|
export * from './EmailManager.js';
|
|
6
6
|
export * from './EnvironmentManager.js';
|
|
7
7
|
export * from './ExternalResourceInstaller.js';
|
|
8
8
|
export * from './ExternalResourceManager.js';
|
|
9
|
-
export * from './FSManager.js';
|
|
10
9
|
export * from './FormDataBuilder.js';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './FSManager.js';
|
|
12
11
|
export * from './HTTPAPICallExecutor.js';
|
|
12
|
+
export * from './HTTPAPICaller.js';
|
|
13
13
|
export * from './I18nManager.js';
|
|
14
14
|
export * from './JobManager.js';
|
|
15
15
|
export * from './JWTManager.js';
|
|
@@ -57,7 +57,7 @@ let CommandExecutor = class CommandExecutor {
|
|
|
57
57
|
async version() {
|
|
58
58
|
let i = 0;
|
|
59
59
|
let currentPath = CommandExecutor_1.VERSION_FETCH_START_PATH;
|
|
60
|
-
let file
|
|
60
|
+
let file;
|
|
61
61
|
while (i < CommandExecutor_1.VERSION_FETCH_MAX_TRIES && !file) {
|
|
62
62
|
const items = await this.fsManager.ls(currentPath, {
|
|
63
63
|
withFullPath: true,
|
|
@@ -75,7 +75,7 @@ let CommandExecutor = class CommandExecutor {
|
|
|
75
75
|
const { version } = JSON.parse(contents);
|
|
76
76
|
return version;
|
|
77
77
|
}
|
|
78
|
-
catch (
|
|
78
|
+
catch (_err) {
|
|
79
79
|
return CommandExecutor_1.DEFAULT_VERSION;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Container } from 'inversify';
|
|
2
|
-
import
|
|
2
|
+
import { type PropsWithChildren, type ReactElement } from 'react';
|
|
3
3
|
import { WordingManager } from '../../../i18n/index.js';
|
|
4
4
|
import type { I18nManager } from '../../../std/index.js';
|
|
5
5
|
export interface DIContextT {
|
|
@@ -7,7 +7,7 @@ export interface DIContextT {
|
|
|
7
7
|
i18nManager: I18nManager;
|
|
8
8
|
wordingManager: WordingManager;
|
|
9
9
|
}
|
|
10
|
-
export declare const DIContext:
|
|
10
|
+
export declare const DIContext: import("react").Context<DIContextT | null>;
|
|
11
11
|
export declare function useDIContext(): DIContextT;
|
|
12
12
|
type Props = Pick<DIContextT, 'container'>;
|
|
13
13
|
export declare function DIContextProvider({ children, container, }: PropsWithChildren<Props>): ReactElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useState, } from 'react';
|
|
2
3
|
import { WordingManager } from '../../../i18n/index.js';
|
|
3
4
|
export const DIContext = createContext(null);
|
|
4
5
|
export function useDIContext() {
|
|
@@ -11,9 +12,9 @@ export function useDIContext() {
|
|
|
11
12
|
export function DIContextProvider({ children, container, }) {
|
|
12
13
|
const [i18nManager] = useState(container.get('I18nManager'));
|
|
13
14
|
const [wordingManager] = useState(container.get(WordingManager));
|
|
14
|
-
return (
|
|
15
|
+
return (_jsx(DIContext.Provider, { value: {
|
|
15
16
|
container,
|
|
16
17
|
i18nManager,
|
|
17
18
|
wordingManager,
|
|
18
|
-
}
|
|
19
|
+
}, children: children }));
|
|
19
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type PropsWithChildren, type ReactElement } from 'react';
|
|
2
2
|
import type { Color, DataType } from '../../../dt/index.js';
|
|
3
3
|
import type { UCFormFieldControlProps } from './form.js';
|
|
4
4
|
export interface StyleDef {
|
|
@@ -24,7 +24,7 @@ export interface StyleContextT {
|
|
|
24
24
|
outputFieldValue?: StyleDef | undefined;
|
|
25
25
|
renderFormFieldControl?: <T extends DataType>(props: UCFormFieldControlProps<T>) => ReactElement | null;
|
|
26
26
|
}
|
|
27
|
-
export declare const StyleContext:
|
|
27
|
+
export declare const StyleContext: import("react").Context<StyleContextT>;
|
|
28
28
|
export declare function useStyleContext(): StyleContextT;
|
|
29
29
|
type Props = StyleContextT;
|
|
30
30
|
export declare function StyleContextProvider({ children, ...rest }: PropsWithChildren<Props>): ReactElement;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, } from 'react';
|
|
2
3
|
export const StyleContext = createContext({});
|
|
3
4
|
export function useStyleContext() {
|
|
4
5
|
return useContext(StyleContext);
|
|
5
6
|
}
|
|
6
7
|
export function StyleContextProvider({ children, ...rest }) {
|
|
7
|
-
return (
|
|
8
|
+
return (_jsx(StyleContext.Provider, { value: rest, children: children }));
|
|
8
9
|
}
|
|
9
10
|
export function styleDef(def, k1, fallback) {
|
|
10
11
|
const main = def?.[k1];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState, } from 'react';
|
|
2
3
|
import { UCExecChecker, } from '../../../uc/index.js';
|
|
3
4
|
import { useDIContext } from './DIContextProvider.js';
|
|
4
5
|
export function UCContainer({ children, uc, }) {
|
|
@@ -16,10 +17,10 @@ export function UCContainer({ children, uc, }) {
|
|
|
16
17
|
}, [uc, ucExecChecker]);
|
|
17
18
|
if (isAllowed === undefined) {
|
|
18
19
|
// TODO : Add some loader while we check if can do
|
|
19
|
-
return
|
|
20
|
+
return _jsx(_Fragment, {});
|
|
20
21
|
}
|
|
21
22
|
if (isAllowed === false) {
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
|
-
return
|
|
25
|
+
return _jsx(_Fragment, { children: children });
|
|
25
26
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import type { UCInput, UCOPIBase } from '../../../uc/index.js';
|
|
3
3
|
import type { UCEntrypointCtx } from './entrypoint.js';
|
|
4
4
|
import type { RenderUCEntrypointTouchable } from './touchable.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useDIContext } from './DIContextProvider.js';
|
|
3
3
|
import { UCContainer } from './UCContainer.js';
|
|
4
4
|
export function UCEntrypoint({ onPress, path, renderTouchable, uc }) {
|
|
5
5
|
const { wordingManager } = useDIContext();
|
|
6
6
|
const wording = wordingManager.uc(uc.def);
|
|
7
|
-
return (
|
|
7
|
+
return (_jsx(UCContainer, { uc: uc, children: renderTouchable({ onPress, path, uc, wording }) }));
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import type { DataType } from '../../../dt/index.js';
|
|
3
3
|
import type { UCOPIBase, UCOutputField } from '../../../uc/index.js';
|
|
4
4
|
export interface Props<OPI extends UCOPIBase, T extends DataType> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export function UCOutputFieldValueFragment({ f, value }) {
|
|
3
3
|
const { def: { type }, } = f;
|
|
4
4
|
type.assign(value);
|
|
5
|
-
return
|
|
5
|
+
return _jsx(_Fragment, { children: type.fmt() });
|
|
6
6
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { ucIsDisabled, } from '../../../uc/index.js';
|
|
3
4
|
import { sleep } from '../../../utils/index.js';
|
|
4
5
|
import { useDIContext } from './DIContextProvider.js';
|
|
@@ -42,18 +43,14 @@ export function UCPanel({ autoExec = false, clearAfterExec = true, onDone, onErr
|
|
|
42
43
|
execState,
|
|
43
44
|
uc,
|
|
44
45
|
};
|
|
45
|
-
return (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
renderExecTouchable({
|
|
56
|
-
...ctx,
|
|
57
|
-
onSubmit: exec,
|
|
58
|
-
})))));
|
|
46
|
+
return (_jsxs(UCContainer, { uc: uc, children: [autoExec && ctx.disabled && renderAutoExecLoader(), !autoExec && (_jsxs(_Fragment, { children: [needsInputFilling &&
|
|
47
|
+
renderForm({
|
|
48
|
+
...ctx,
|
|
49
|
+
onChange,
|
|
50
|
+
onSubmit: exec,
|
|
51
|
+
}), !needsInputFilling &&
|
|
52
|
+
renderExecTouchable({
|
|
53
|
+
...ctx,
|
|
54
|
+
onSubmit: exec,
|
|
55
|
+
})] }))] }));
|
|
59
56
|
}
|
|
@@ -33,9 +33,9 @@ let RequestChecker = class RequestChecker {
|
|
|
33
33
|
const isSSLCertificateCheck = !!url.match(/^\/\.well-known\/acme-challenge\/(.*)/); // http://localhost:8443/.well-known/acme-challenge/ywml7k8e8qxdjwFf1pN4hIKWJ1Jrc0CvAP3t9PSmnzw
|
|
34
34
|
this.logger.trace('Request checker', {
|
|
35
35
|
isNotProd,
|
|
36
|
-
isSSLCertificateCheck,
|
|
37
36
|
isSecure,
|
|
38
37
|
isSecureForwarded,
|
|
38
|
+
isSSLCertificateCheck,
|
|
39
39
|
});
|
|
40
40
|
const allowed = isSecure || isSecureForwarded || isNotProd || isSSLCertificateCheck;
|
|
41
41
|
if (!allowed) {
|
|
@@ -119,7 +119,7 @@ let ServerRequestHandler = class ServerRequestHandler {
|
|
|
119
119
|
try {
|
|
120
120
|
uc.fill((await req.bodyFromJSON()));
|
|
121
121
|
}
|
|
122
|
-
catch (
|
|
122
|
+
catch (_err) {
|
|
123
123
|
// Ignore any JSON.parse error as everything is validated afterwards
|
|
124
124
|
}
|
|
125
125
|
break;
|
|
@@ -165,14 +165,14 @@ let ServerRequestHandler = class ServerRequestHandler {
|
|
|
165
165
|
async applyRedirectSideEffect(res, item) {
|
|
166
166
|
if (!item ||
|
|
167
167
|
!('redirect' in item) ||
|
|
168
|
-
typeof item
|
|
168
|
+
typeof item.redirect !== 'string') {
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
const { redirect } = item;
|
|
172
172
|
res.redirect(redirect);
|
|
173
173
|
}
|
|
174
174
|
async applySetAuthSideEffect(res, item) {
|
|
175
|
-
if (!item || !('jwt' in item) || typeof item
|
|
175
|
+
if (!item || !('jwt' in item) || typeof item.jwt !== 'string') {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
const { jwt } = item;
|
|
@@ -15,7 +15,7 @@ import { inject, injectable } from 'inversify';
|
|
|
15
15
|
import { TBoolean } from '../../dt/index.js';
|
|
16
16
|
import { WordingManager } from '../../i18n/index.js';
|
|
17
17
|
import { ProductUCsLoader } from '../../product/index.js';
|
|
18
|
-
import {
|
|
18
|
+
import { ucifRepeatability, ucMountingPoint, } from '../../uc/index.js';
|
|
19
19
|
import { CommandExecutor } from '../lib/cli/CommandExecutor.js';
|
|
20
20
|
import { print } from '../lib/cli/renderer.js';
|
|
21
21
|
import { showHelp } from './commands.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ucifIsMandatory, ucMountingPoint } from '../../uc/index.js';
|
|
2
2
|
import { fmtBold, fmtCommand, fmtPadEndFor, fmtSection, } from '../../utils/index.js';
|
|
3
3
|
import { print } from '../lib/cli/renderer.js';
|
|
4
4
|
const FLAG_PREFIX = '--';
|
|
@@ -16,10 +16,10 @@ import cookieParser from 'cookie-parser';
|
|
|
16
16
|
import express, {} from 'express';
|
|
17
17
|
import fileUpload from 'express-fileupload';
|
|
18
18
|
import { inject, injectable } from 'inversify';
|
|
19
|
-
import { stop } from '../lib/server-node/stop.js';
|
|
20
19
|
import { EntrypointsBuilder } from '../lib/server/EntrypointsBuilder.js';
|
|
21
20
|
import { ServerRequestHandler, } from '../lib/server/ServerRequestHandler.js';
|
|
22
21
|
import { ServerSSLCertLoader } from '../lib/server/ServerSSLCertLoader.js';
|
|
22
|
+
import { stop } from '../lib/server-node/stop.js';
|
|
23
23
|
import { HelmetMiddlewareBuilder } from './middlewares/HelmetMiddlewareBuilder.js';
|
|
24
24
|
let NodeExpressServerManager = class NodeExpressServerManager {
|
|
25
25
|
entrypointsBuilder;
|
|
@@ -20,10 +20,10 @@ import { logger } from 'hono/logger';
|
|
|
20
20
|
import { secureHeaders } from 'hono/secure-headers';
|
|
21
21
|
import { inject, injectable } from 'inversify';
|
|
22
22
|
import { fromFormData } from '../../utils/index.js';
|
|
23
|
-
import { stop } from '../lib/server-node/stop.js';
|
|
24
23
|
import { EntrypointsBuilder } from '../lib/server/EntrypointsBuilder.js';
|
|
25
24
|
import { ServerRequestHandler, } from '../lib/server/ServerRequestHandler.js';
|
|
26
25
|
import { ServerSSLCertLoader } from '../lib/server/ServerSSLCertLoader.js';
|
|
26
|
+
import { stop } from '../lib/server-node/stop.js';
|
|
27
27
|
let NodeHonoServerManager = class NodeHonoServerManager {
|
|
28
28
|
entrypointsBuilder;
|
|
29
29
|
environmentManager;
|
|
@@ -15,7 +15,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
15
15
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
16
16
|
import { inject, injectable } from 'inversify';
|
|
17
17
|
import { WordingManager } from '../../i18n/index.js';
|
|
18
|
-
import { UCBuilder,
|
|
18
|
+
import { UCBuilder, ucifIsMandatory, ucMountingPoint, } from '../../uc/index.js';
|
|
19
19
|
import { propertyType, resError, resObj } from './funcs.js';
|
|
20
20
|
/**
|
|
21
21
|
* A simple MCP Server implementation
|
|
@@ -82,7 +82,7 @@ let NodeLocalStdioMCPServerManager = class NodeLocalStdioMCPServerManager {
|
|
|
82
82
|
}
|
|
83
83
|
const inputSchema = this.buildInputSchema(uc);
|
|
84
84
|
const mountingPoint = uc.def.ext?.cmd?.mountAt ?? ucMountingPoint(uc);
|
|
85
|
-
const tool = { name: mountingPoint
|
|
85
|
+
const tool = { inputSchema, name: mountingPoint };
|
|
86
86
|
this.tools.set(mountingPoint, { appName: appManifest.name, tool, ucd });
|
|
87
87
|
}
|
|
88
88
|
async mountStaticDir(_dirPath) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
export declare function UCAutoExecLoader(): ReactElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ActivityIndicator } from 'react-native';
|
|
3
3
|
import { useStyleContext } from '../lib/react/StyleContextProvider.js';
|
|
4
4
|
export function UCAutoExecLoader() {
|
|
5
5
|
const { autoExecLoader } = useStyleContext();
|
|
6
|
-
return
|
|
6
|
+
return _jsx(ActivityIndicator, { style: autoExecLoader?.style });
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import type { UCInput, UCOPIBase } from '../../uc/index.js';
|
|
3
3
|
import type { UCEntrypointTouchableProps } from '../lib/react/touchable.js';
|
|
4
4
|
export declare function UCEntrypointTouchable<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>({ onPress, wording, }: UCEntrypointTouchableProps<I, OPI0, OPI1>): ReactElement;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Pressable, Text } from 'react-native';
|
|
3
3
|
import { useStyleContext } from '../lib/react/StyleContextProvider.js';
|
|
4
4
|
export function UCEntrypointTouchable({ onPress, wording, }) {
|
|
5
5
|
const { entrypointTouchable } = useStyleContext();
|
|
6
|
-
return (
|
|
7
|
-
React.createElement(Text, { style: entrypointTouchable?.style }, wording.label)));
|
|
6
|
+
return (_jsx(Pressable, { onPress: onPress, children: _jsx(Text, { style: entrypointTouchable?.style, children: wording.label }) }));
|
|
8
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import type { UCInput, UCOPIBase } from '../../uc/index.js';
|
|
3
3
|
import type { UCExecTouchableProps } from '../lib/react/touchable.js';
|
|
4
4
|
export declare function UCExecTouchable<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>({ disabled, execState, onSubmit, uc, }: UCExecTouchableProps<I, OPI0, OPI1>): ReactElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Pressable, Text } from 'react-native';
|
|
3
3
|
import { useDIContext } from '../lib/react/DIContextProvider.js';
|
|
4
4
|
import { useStyleContext } from '../lib/react/StyleContextProvider.js';
|
|
@@ -6,6 +6,5 @@ export function UCExecTouchable({ disabled, execState, onSubmit, uc, }) {
|
|
|
6
6
|
const { wordingManager } = useDIContext();
|
|
7
7
|
const { execTouchable } = useStyleContext();
|
|
8
8
|
const label = wordingManager.ucISubmit(uc.def, execState);
|
|
9
|
-
return (
|
|
10
|
-
React.createElement(Text, { style: execTouchable?.style }, label)));
|
|
9
|
+
return (_jsx(Pressable, { disabled: disabled, onPress: onSubmit, children: _jsx(Text, { style: execTouchable?.style, children: label }) }));
|
|
11
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import type { UCInput, UCOPIBase } from '../../uc/index.js';
|
|
3
3
|
import type { UCFormProps } from '../lib/react/form.js';
|
|
4
4
|
export declare function UCForm<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>({ disabled, execState, onChange, onSubmit, uc, }: UCFormProps<I, OPI0, OPI1>): ReactElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useStyleContext } from '../lib/react/StyleContextProvider.js';
|
|
4
4
|
import { UCFormField } from './UCFormField.js';
|
|
@@ -8,7 +8,5 @@ export function UCForm({ disabled, execState, onChange, onSubmit, uc, }) {
|
|
|
8
8
|
const onPress = async () => {
|
|
9
9
|
await onSubmit();
|
|
10
10
|
};
|
|
11
|
-
return (
|
|
12
|
-
uc.inputFieldsForForm().map((f) => (React.createElement(UCFormField, { disabled: disabled, execState: execState, f: f, key: f.key, onChange: onChange }))),
|
|
13
|
-
React.createElement(UCFormSubmitControl, { execState: execState, disabled: disabled, onPress: onPress, uc: uc })));
|
|
11
|
+
return (_jsxs(View, { style: form?.style, children: [uc.inputFieldsForForm().map((f) => (_jsx(UCFormField, { disabled: disabled, execState: execState, f: f, onChange: onChange }, f.key))), _jsx(UCFormSubmitControl, { disabled: disabled, execState: execState, onPress: onPress, uc: uc })] }));
|
|
14
12
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
4
|
import { useDIContext } from '../lib/react/DIContextProvider.js';
|
|
4
|
-
import { useStyleContext } from '../lib/react/StyleContextProvider.js';
|
|
5
5
|
import { UC_FORM_FIELD_ELEMENTS, validateFormField, } from '../lib/react/form.js';
|
|
6
|
+
import { useStyleContext } from '../lib/react/StyleContextProvider.js';
|
|
6
7
|
import { UCFormFieldControl } from './UCFormFieldControl.js';
|
|
7
8
|
import { UCFormFieldDesc } from './UCFormFieldDesc.js';
|
|
8
9
|
import { UCFormFieldErr } from './UCFormFieldErr.js';
|
|
@@ -16,9 +17,5 @@ export function UCFormField({ disabled, execState, f, onChange: onChangeBase, on
|
|
|
16
17
|
onChangeBase(f, op, v);
|
|
17
18
|
};
|
|
18
19
|
const elements = only ?? UC_FORM_FIELD_ELEMENTS;
|
|
19
|
-
return (
|
|
20
|
-
elements.includes('label') && React.createElement(UCFormFieldLabel, { f: f }),
|
|
21
|
-
elements.includes('control') && (React.createElement(UCFormFieldControl, { disabled: disabled, execState: execState, f: f, onChange: onChange })),
|
|
22
|
-
elements.includes('err') && errMsg && (React.createElement(UCFormFieldErr, { errMsg: errMsg })),
|
|
23
|
-
elements.includes('desc') && React.createElement(UCFormFieldDesc, { f: f })));
|
|
20
|
+
return (_jsxs(View, { style: formField?.style, children: [elements.includes('label') && _jsx(UCFormFieldLabel, { f: f }), elements.includes('control') && (_jsx(UCFormFieldControl, { disabled: disabled, execState: execState, f: f, onChange: onChange })), elements.includes('err') && errMsg && (_jsx(UCFormFieldErr, { errMsg: errMsg })), elements.includes('desc') && _jsx(UCFormFieldDesc, { f: f })] }));
|
|
24
21
|
}
|