@fenglimg/fabric-shared 1.0.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/dist/chunk-2MXNG23L.js +605 -0
- package/dist/chunk-LXNCAKJZ.js +0 -0
- package/dist/i18n/index.d.ts +22 -0
- package/dist/i18n/index.js +18 -0
- package/dist/index.d.ts +2030 -0
- package/dist/index.js +401 -0
- package/dist/types/index.d.ts +55 -0
- package/dist/types/index.js +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type Locale = "en" | "zh-CN";
|
|
2
|
+
interface Messages {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
5
|
+
type TranslationKey = string;
|
|
6
|
+
type Translator = (key: TranslationKey, vars?: Record<string, string>) => string;
|
|
7
|
+
|
|
8
|
+
declare const defaultMessages: Record<Locale, Messages>;
|
|
9
|
+
declare function createTranslator(locale: Locale, messages?: Record<Locale, Messages>): Translator;
|
|
10
|
+
|
|
11
|
+
declare function detectNodeLocale(): Locale;
|
|
12
|
+
|
|
13
|
+
declare function normalizeLocale(raw: string | null | undefined): Locale;
|
|
14
|
+
|
|
15
|
+
declare const PROTECTED_TOKENS: readonly ["fab_get_rules", "fab_append_intent", "fab_update_registry", "fabric_rules", "ledger_entry", "ledger_entry_id", "agent_meta", "AGENTS.md", "FABRIC.md", ".fabric/agents.meta.json", ".fabric/human-lock.json", ".fabric/init-context.json", ".fabric/forensic.json", ".intent-ledger.jsonl", "@HUMAN", "CORE RULES", "DO NOT TRANSLATE", "MUST", "NEVER"];
|
|
16
|
+
type ProtectedToken = (typeof PROTECTED_TOKENS)[number];
|
|
17
|
+
|
|
18
|
+
declare const enMessages: Messages;
|
|
19
|
+
|
|
20
|
+
declare const zhCNMessages: Messages;
|
|
21
|
+
|
|
22
|
+
export { type Locale, type Messages, PROTECTED_TOKENS, type ProtectedToken, type TranslationKey, type Translator, createTranslator, defaultMessages, detectNodeLocale, enMessages, normalizeLocale, zhCNMessages };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PROTECTED_TOKENS,
|
|
3
|
+
createTranslator,
|
|
4
|
+
defaultMessages,
|
|
5
|
+
detectNodeLocale,
|
|
6
|
+
enMessages,
|
|
7
|
+
normalizeLocale,
|
|
8
|
+
zhCNMessages
|
|
9
|
+
} from "../chunk-2MXNG23L.js";
|
|
10
|
+
export {
|
|
11
|
+
PROTECTED_TOKENS,
|
|
12
|
+
createTranslator,
|
|
13
|
+
defaultMessages,
|
|
14
|
+
detectNodeLocale,
|
|
15
|
+
enMessages,
|
|
16
|
+
normalizeLocale,
|
|
17
|
+
zhCNMessages
|
|
18
|
+
};
|