@h-ai/core 0.1.0-alpha.71 → 0.1.0-alpha.73
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/README.en.md +1 -1
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/browser.js +2 -2
- package/dist/{chunk-QPG7M3S3.js → chunk-JFTGUOMK.js} +7 -5
- package/dist/{chunk-QPG7M3S3.js.map → chunk-JFTGUOMK.js.map} +1 -1
- package/dist/node.js +4 -2
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -602,7 +602,7 @@ unsubscribe()
|
|
|
602
602
|
|
|
603
603
|
## Application lifecycle
|
|
604
604
|
|
|
605
|
-
`core.module.createRuntime([{ name, enabled?, start, close }])` starts in declaration order, closes in reverse order and merges concurrent calls. It registers cleanup before partial initialization. Failed close retains that module and dependencies for the next close/start retry. Errors expose module, phase, code and configuration paths, never raw configuration or SDK exceptions. Base/API/fullstack and the admin use this helper.
|
|
605
|
+
`core.module.createRuntime([{ name, enabled?, start, close }])` starts in declaration order, closes in reverse order and merges concurrent calls. It registers cleanup before partial initialization. Failed close retains that module and dependencies for the next close/start retry. Errors expose module, phase, code and configuration paths, never raw configuration or SDK exceptions. Base/API/fullstack and the admin use this helper. The short error message also includes the error code and field paths to identify missing environment variables.
|
|
606
606
|
|
|
607
607
|
## Error messages and correlated logs
|
|
608
608
|
|
package/README.ja.md
CHANGED
|
@@ -602,7 +602,7 @@ unsubscribe()
|
|
|
602
602
|
|
|
603
603
|
## アプリケーションのライフサイクル
|
|
604
604
|
|
|
605
|
-
`core.module.createRuntime([{ name, enabled?, start, close }])` は宣言順で起動し、逆順で終了して並行呼出しを統合します。部分初期化前に清理義務を登録し、終了失敗時はモジュールと依存を保持して次回 close/start で再試行します。エラーはモジュール・段階・コード・設定パスのみを示し、値や SDK 例外を公開しません。base/API/fullstack と管理画面が利用します。
|
|
605
|
+
`core.module.createRuntime([{ name, enabled?, start, close }])` は宣言順で起動し、逆順で終了して並行呼出しを統合します。部分初期化前に清理義務を登録し、終了失敗時はモジュールと依存を保持して次回 close/start で再試行します。エラーはモジュール・段階・コード・設定パスのみを示し、値や SDK 例外を公開しません。base/API/fullstack と管理画面が利用します。 短いエラーメッセージにもコードと設定パスを含め、不足する環境変数を特定できます。
|
|
606
606
|
|
|
607
607
|
## エラー表示とログの関連付け
|
|
608
608
|
|
package/README.md
CHANGED
|
@@ -602,7 +602,7 @@ unsubscribe()
|
|
|
602
602
|
|
|
603
603
|
## 应用生命周期编排
|
|
604
604
|
|
|
605
|
-
`core.module.createRuntime([{ name, enabled?, start, close }])` 按声明启动、反序关闭,合并并发调用。启动前登记部分资源的清理义务;失败回滚。关闭失败停在该模块并保留依赖,下次 close/start 重试,避免先关闭仍被使用的数据库。错误仅保留模块、阶段、错误码和配置字段路径;不转发配置值或 SDK 原始异常。base/API/fullstack 和管理台均使用此入口。
|
|
605
|
+
`core.module.createRuntime([{ name, enabled?, start, close }])` 按声明启动、反序关闭,合并并发调用。启动前登记部分资源的清理义务;失败回滚。关闭失败停在该模块并保留依赖,下次 close/start 重试,避免先关闭仍被使用的数据库。错误仅保留模块、阶段、错误码和配置字段路径;不转发配置值或 SDK 原始异常。base/API/fullstack 和管理台均使用此入口。 简短错误消息也包含错误码与字段路径,便于定位缺失的环境变量。
|
|
606
606
|
|
|
607
607
|
## 错误提示与关联日志
|
|
608
608
|
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __commonJS, __toESM, createCore, i18n, err, HaiCommonError, requestContext, sanitize, emitLogRecord, sanitizeLogFields } from './chunk-
|
|
2
|
-
export { CoreConfigSchema, EnvSchema, HaiCommonError, HaiConfigError, LogFormatSchema, LogLevelSchema, LoggingConfigSchema, err, ok } from './chunk-
|
|
1
|
+
import { __commonJS, __toESM, createCore, i18n, err, HaiCommonError, requestContext, sanitize, emitLogRecord, sanitizeLogFields } from './chunk-JFTGUOMK.js';
|
|
2
|
+
export { CoreConfigSchema, EnvSchema, HaiCommonError, HaiConfigError, LogFormatSchema, LogLevelSchema, LoggingConfigSchema, err, ok } from './chunk-JFTGUOMK.js';
|
|
3
3
|
|
|
4
4
|
// ../../node_modules/loglevel/lib/loglevel.js
|
|
5
5
|
var require_loglevel = __commonJS({
|
|
@@ -20000,14 +20000,14 @@ var typeUtils = {
|
|
|
20000
20000
|
};
|
|
20001
20001
|
|
|
20002
20002
|
// src/utils/core-util-sanitize.ts
|
|
20003
|
-
var CREDENTIAL_TEXT = /\b(?:Bearer|Basic)\s+[\w.~+/-]+=*|\b(?:[\w-]*[_-])?(?:password|passwd|passcode|secret|token|session(?:[_-]?id)?|authorization|cookie|csrf|credential|api[_-]?key|private[_-]?key|(?:access|refresh|id|csrf)token|(?:otp|totp|verification|verify|captcha|sms|email|auth|one[_-]?time|two[_-]?factor)[_-]?code)(?:\\?["'])?\s*[:=]\s*(?:(?:Bearer|Basic)\s+)?(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\\"(?:[^\\]|\\\\\\\\|\\\\\\"|\\\\[^"\\])*\\"|[^\s,;&}\]]+)/gi;
|
|
20003
|
+
var CREDENTIAL_TEXT = /\b(?:Bearer|Basic)\s+[\w.~+/-]+=*|\b(?:[\w-]*[_-])?(?:password|passwd|passcode|secret|token|session(?:[_-]?id)?|authorization|cookie|csrf|credential|captcha|reauthentication|ticket|api[_-]?key|private[_-]?key|(?:access|refresh|id|csrf)token|(?:otp|totp|verification|verify|captcha|sms|email|auth|one[_-]?time|two[_-]?factor)[_-]?code)(?:\\?["'])?\s*[:=]\s*(?:(?:Bearer|Basic)\s+)?(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\\"(?:[^\\]|\\\\\\\\|\\\\\\"|\\\\[^"\\])*\\"|[^\s,;&}\]]+)/gi;
|
|
20004
20004
|
function sanitizeText(text, secretValues = []) {
|
|
20005
20005
|
let result = text;
|
|
20006
20006
|
for (const value of [...new Set(secretValues)].filter(Boolean).sort((a, b) => b.length - a.length))
|
|
20007
20007
|
result = result.replaceAll(value, "[REDACTED]");
|
|
20008
20008
|
return result.replace(/\b[a-z][a-z\d+.-]*:\/\/[^\s<>"']+/gi, (url2) => sanitizeUrl(url2)).replace(CREDENTIAL_TEXT, (match) => match.includes("[REDACTED") ? match : "[REDACTED]");
|
|
20009
20009
|
}
|
|
20010
|
-
var DEFAULT_SENSITIVE_KEY_REGEX = /(?:^|_)(?:pass|passcode|password|secret|authorization|cookie|otp|session|token)$|(?:^|_)(?:otp|totp|verification|verify|captcha|sms|email|auth|one_time|two_factor)_code$|(?:^|_)private_key$|(?:^|_)access_key(?:_id|_secret)?$|(?:^|_)secret_access_key$|(?:^|_)api(?:_[a-z0-9]+)*_key$|^apikey$/i;
|
|
20010
|
+
var DEFAULT_SENSITIVE_KEY_REGEX = /(?:^|_)(?:pass|passcode|password|secret|authorization|cookie|otp|captcha|reauthentication|ticket|session|token)$|(?:^|_)(?:otp|totp|verification|verify|captcha|sms|email|auth|one_time|two_factor)_code$|(?:^|_)private_key$|(?:^|_)access_key(?:_id|_secret)?$|(?:^|_)secret_access_key$|(?:^|_)api(?:_[a-z0-9]+)*_key$|^apikey$/i;
|
|
20011
20011
|
var DEFAULT_SENSITIVE_REPLACEMENT = "[REDACTED]";
|
|
20012
20012
|
var URL_LIKE_KEY_REGEX = /(?:^|_)(?:url|uri|endpoint)(?:_|$)/;
|
|
20013
20013
|
var SENSITIVE_KEY_CACHE_LIMIT = 512;
|
|
@@ -20890,7 +20890,9 @@ function failure2(module, phase, detail) {
|
|
|
20890
20890
|
}
|
|
20891
20891
|
}
|
|
20892
20892
|
const code = detail && typeof detail === "object" && "code" in detail && (typeof detail.code === "number" || typeof detail.code === "string") ? detail.code : void 0;
|
|
20893
|
-
|
|
20893
|
+
const message = i18n.coreM(phase === "start" ? "core_runtimeStartFailed" : "core_runtimeCloseFailed", { params: { module } });
|
|
20894
|
+
const diagnostics = [code, ...new Set(fields)].filter((value) => value !== void 0).join(", ");
|
|
20895
|
+
return { success: false, error: { ...HaiCommonError.INIT_FAILED, message: diagnostics ? `${message} (${diagnostics})` : message, ext: { module, phase, ...code !== void 0 ? { code } : {}, ...fields.length ? { fields } : {} } } };
|
|
20894
20896
|
}
|
|
20895
20897
|
function createRuntime(definitions) {
|
|
20896
20898
|
const steps = definitions.map((step) => ({ ...step }));
|
|
@@ -21295,5 +21297,5 @@ function createCore(loggerFns) {
|
|
|
21295
21297
|
}
|
|
21296
21298
|
|
|
21297
21299
|
export { CoreConfigSchema, EnvSchema, HaiCommonError, HaiConfigError, LogFormatSchema, LogLevelSchema, LoggingConfigSchema, __commonJS, __toESM, createCore, emitLogRecord, err, i18n, installRequestContext, installRequestLocales, ok, requestContext, sanitize, sanitizeLogFields, typeUtils };
|
|
21298
|
-
//# sourceMappingURL=chunk-
|
|
21299
|
-
//# sourceMappingURL=chunk-
|
|
21300
|
+
//# sourceMappingURL=chunk-JFTGUOMK.js.map
|
|
21301
|
+
//# sourceMappingURL=chunk-JFTGUOMK.js.map
|