@sfmc-bds/cli 0.2.0-beta.6 → 0.2.0-beta.8
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/argv-parse.d.ts +0 -2
- package/dist/argv-parse.d.ts.map +1 -1
- package/dist/argv-parse.js +1 -5
- package/dist/argv-parse.js.map +2 -2
- package/dist/cli-gate.d.ts.map +1 -1
- package/dist/cli-gate.js +0 -2
- package/dist/cli-gate.js.map +2 -2
- package/dist/command-surface.d.ts +5 -12
- package/dist/command-surface.d.ts.map +1 -1
- package/dist/command-surface.js +6 -62
- package/dist/command-surface.js.map +2 -2
- package/dist/help-text.d.ts.map +1 -1
- package/dist/help-text.js +6 -10
- package/dist/help-text.js.map +2 -2
- package/dist/i18n/locales/en.d.ts +9 -87
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +9 -90
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN.js +9 -90
- package/dist/i18n/locales/zh-CN.js.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +2 -2
- package/dist/main.js +3 -6
- package/dist/main.js.map +2 -2
- package/dist/module-commands.d.ts +6 -25
- package/dist/module-commands.d.ts.map +1 -1
- package/dist/module-commands.js +107 -127
- package/dist/module-commands.js.map +2 -2
- package/dist/module-pack-build.d.ts.map +1 -1
- package/dist/module-pack-build.js +4 -0
- package/dist/module-pack-build.js.map +2 -2
- package/dist/module-toggle.d.ts +33 -0
- package/dist/module-toggle.d.ts.map +1 -0
- package/dist/module-toggle.js +28 -0
- package/dist/module-toggle.js.map +7 -0
- package/dist/pack-lifecycle.d.ts.map +1 -1
- package/dist/pack-lifecycle.js +4 -0
- package/dist/pack-lifecycle.js.map +2 -2
- package/dist/remote-agent.js +5 -5
- package/dist/remote-agent.js.map +2 -2
- package/dist/repl.d.ts +0 -2
- package/dist/repl.d.ts.map +1 -1
- package/dist/repl.js +2 -31
- package/dist/repl.js.map +2 -2
- package/dist/runtime.d.ts +4 -13
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +15 -27
- package/dist/runtime.js.map +2 -2
- package/dist/services.d.ts +0 -2
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +0 -4
- package/dist/services.js.map +2 -2
- package/package.json +6 -6
- package/dist/module-publish.d.ts +0 -69
- package/dist/module-publish.d.ts.map +0 -1
- package/dist/module-publish.js +0 -478
- package/dist/module-publish.js.map +0 -7
- package/dist/module-watch.d.ts +0 -32
- package/dist/module-watch.d.ts.map +0 -1
- package/dist/module-watch.js +0 -171
- package/dist/module-watch.js.map +0 -7
- package/dist/module-wizard.d.ts +0 -12
- package/dist/module-wizard.d.ts.map +0 -1
- package/dist/module-wizard.js +0 -297
- package/dist/module-wizard.js.map +0 -7
package/dist/argv-parse.d.ts
CHANGED
|
@@ -8,6 +8,4 @@ export declare function parseGlobalArgv(raw: string[]): ParsedArgv;
|
|
|
8
8
|
export declare function mapPacksSubAlias(sub: string | undefined): string | undefined;
|
|
9
9
|
/** 是否为顶层模块短命令(install / uninstall / search …) */
|
|
10
10
|
export declare function isModuleInstallShorthand(cmd: string | undefined): boolean;
|
|
11
|
-
/** @deprecated 使用 resolveModuleTopShorthand;保留别名避免外部破坏 */
|
|
12
|
-
export declare function resolveModuleShorthandSub(cmd: string | undefined): string | undefined;
|
|
13
11
|
//# sourceMappingURL=argv-parse.d.ts.map
|
package/dist/argv-parse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argv-parse.d.ts","sourceRoot":"","sources":["../src/argv-parse.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAIF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAU,CAWzD;AAED,mBAAmB;AACnB,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAI5E;AAED,iDAAiD;AACjD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzE
|
|
1
|
+
{"version":3,"file":"argv-parse.d.ts","sourceRoot":"","sources":["../src/argv-parse.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAIF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAU,CAWzD;AAED,mBAAmB;AACnB,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAI5E;AAED,iDAAiD;AACjD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzE"}
|
package/dist/argv-parse.js
CHANGED
|
@@ -20,13 +20,9 @@ function mapPacksSubAlias(sub) {
|
|
|
20
20
|
function isModuleInstallShorthand(cmd) {
|
|
21
21
|
return resolveModuleTopShorthand(cmd) !== void 0;
|
|
22
22
|
}
|
|
23
|
-
function resolveModuleShorthandSub(cmd) {
|
|
24
|
-
return resolveModuleTopShorthand(cmd);
|
|
25
|
-
}
|
|
26
23
|
export {
|
|
27
24
|
isModuleInstallShorthand,
|
|
28
25
|
mapPacksSubAlias,
|
|
29
|
-
parseGlobalArgv
|
|
30
|
-
resolveModuleShorthandSub
|
|
26
|
+
parseGlobalArgv
|
|
31
27
|
};
|
|
32
28
|
//# sourceMappingURL=argv-parse.js.map
|
package/dist/argv-parse.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/argv-parse.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * argv-parse.ts \u2014 \u5916\u90E8 CLI \u5168\u5C40\u65D7\u6807\u4E0E\u77ED\u547D\u4EE4\u9884\u89E3\u6790\uFF08DRY\uFF09\n *\n * - `-p` / `--packs`\uFF1A\u8D44\u6E90\u5305\u4E0A\u4E0B\u6587\uFF08\u517C\u5BB9\uFF1B\u5E2E\u52A9\u4F18\u5148\u63A8\u8350 `sfmc packs <sub>`\uFF09\n * - \u9876\u5C42\u6A21\u5757\u77ED\u547D\u4EE4\uFF1A\u89C1 command-surface#MODULE_TOP_SHORTHAND / resolveModuleTopShorthand\n * - packs \u4E0A\u4E0B\u6587\u4E0B `i` \u2192 `install`\n */\nimport { resolveModuleTopShorthand } from \"./command-surface.js\";\n\nexport type ParsedArgv = {\n packsMode: boolean;\n /** \u89C4\u8303\u5316\u540E\u7684\u4F4D\u7F6E\u53C2\u6570\uFF08\u5DF2\u53BB\u6389 -p/--packs\uFF09 */\n args: string[];\n};\n\nconst PACKS_FLAGS = new Set([\"-p\", \"--packs\"]);\n\nexport function parseGlobalArgv(raw: string[]): ParsedArgv {\n const args: string[] = [];\n let packsMode = false;\n for (const a of raw) {\n if (PACKS_FLAGS.has(a)) {\n packsMode = true;\n continue;\n }\n args.push(a);\n }\n return { packsMode, args };\n}\n\n/** packs \u5B50\u547D\u4EE4\u77ED\u522B\u540D */\nexport function mapPacksSubAlias(sub: string | undefined): string | undefined {\n if (!sub) return sub;\n if (sub === \"i\") return \"install\";\n return sub;\n}\n\n/** \u662F\u5426\u4E3A\u9876\u5C42\u6A21\u5757\u77ED\u547D\u4EE4\uFF08install / uninstall / search \u2026\uFF09 */\nexport function isModuleInstallShorthand(cmd: string | undefined): boolean {\n return resolveModuleTopShorthand(cmd) !== undefined;\n}\n
|
|
5
|
-
"mappings": "AAOA,SAAS,iCAAiC;AAQ1C,MAAM,cAAc,oBAAI,IAAI,CAAC,MAAM,SAAS,CAAC;AAEtC,SAAS,gBAAgB,KAA2B;AACzD,QAAM,OAAiB,CAAC;AACxB,MAAI,YAAY;AAChB,aAAW,KAAK,KAAK;AACnB,QAAI,YAAY,IAAI,CAAC,GAAG;AACtB,kBAAY;AACZ;AAAA,IACF;AACA,SAAK,KAAK,CAAC;AAAA,EACb;AACA,SAAO,EAAE,WAAW,KAAK;AAC3B;AAGO,SAAS,iBAAiB,KAA6C;AAC5E,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,QAAQ,IAAK,QAAO;AACxB,SAAO;AACT;AAGO,SAAS,yBAAyB,KAAkC;AACzE,SAAO,0BAA0B,GAAG,MAAM;AAC5C;
|
|
4
|
+
"sourcesContent": ["/**\n * argv-parse.ts \u2014 \u5916\u90E8 CLI \u5168\u5C40\u65D7\u6807\u4E0E\u77ED\u547D\u4EE4\u9884\u89E3\u6790\uFF08DRY\uFF09\n *\n * - `-p` / `--packs`\uFF1A\u8D44\u6E90\u5305\u4E0A\u4E0B\u6587\uFF08\u517C\u5BB9\uFF1B\u5E2E\u52A9\u4F18\u5148\u63A8\u8350 `sfmc packs <sub>`\uFF09\n * - \u9876\u5C42\u6A21\u5757\u77ED\u547D\u4EE4\uFF1A\u89C1 command-surface#MODULE_TOP_SHORTHAND / resolveModuleTopShorthand\n * - packs \u4E0A\u4E0B\u6587\u4E0B `i` \u2192 `install`\n */\nimport { resolveModuleTopShorthand } from \"./command-surface.js\";\n\nexport type ParsedArgv = {\n packsMode: boolean;\n /** \u89C4\u8303\u5316\u540E\u7684\u4F4D\u7F6E\u53C2\u6570\uFF08\u5DF2\u53BB\u6389 -p/--packs\uFF09 */\n args: string[];\n};\n\nconst PACKS_FLAGS = new Set([\"-p\", \"--packs\"]);\n\nexport function parseGlobalArgv(raw: string[]): ParsedArgv {\n const args: string[] = [];\n let packsMode = false;\n for (const a of raw) {\n if (PACKS_FLAGS.has(a)) {\n packsMode = true;\n continue;\n }\n args.push(a);\n }\n return { packsMode, args };\n}\n\n/** packs \u5B50\u547D\u4EE4\u77ED\u522B\u540D */\nexport function mapPacksSubAlias(sub: string | undefined): string | undefined {\n if (!sub) return sub;\n if (sub === \"i\") return \"install\";\n return sub;\n}\n\n/** \u662F\u5426\u4E3A\u9876\u5C42\u6A21\u5757\u77ED\u547D\u4EE4\uFF08install / uninstall / search \u2026\uFF09 */\nexport function isModuleInstallShorthand(cmd: string | undefined): boolean {\n return resolveModuleTopShorthand(cmd) !== undefined;\n}\n"],
|
|
5
|
+
"mappings": "AAOA,SAAS,iCAAiC;AAQ1C,MAAM,cAAc,oBAAI,IAAI,CAAC,MAAM,SAAS,CAAC;AAEtC,SAAS,gBAAgB,KAA2B;AACzD,QAAM,OAAiB,CAAC;AACxB,MAAI,YAAY;AAChB,aAAW,KAAK,KAAK;AACnB,QAAI,YAAY,IAAI,CAAC,GAAG;AACtB,kBAAY;AACZ;AAAA,IACF;AACA,SAAK,KAAK,CAAC;AAAA,EACb;AACA,SAAO,EAAE,WAAW,KAAK;AAC3B;AAGO,SAAS,iBAAiB,KAA6C;AAC5E,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,QAAQ,IAAK,QAAO;AACxB,SAAO;AACT;AAGO,SAAS,yBAAyB,KAAkC;AACzE,SAAO,0BAA0B,GAAG,MAAM;AAC5C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cli-gate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-gate.d.ts","sourceRoot":"","sources":["../src/cli-gate.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"cli-gate.d.ts","sourceRoot":"","sources":["../src/cli-gate.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAOpF;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAKf;AAED,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAItF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAIvF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAItF"}
|
package/dist/cli-gate.js
CHANGED
|
@@ -9,8 +9,6 @@ import { t } from "./i18n/index.js";
|
|
|
9
9
|
import { c } from "./theme.js";
|
|
10
10
|
function formatGateFailure(reason, hintCmd) {
|
|
11
11
|
switch (reason) {
|
|
12
|
-
case "externalOnly":
|
|
13
|
-
return c.yellow(t("cli.externalOnly", { cmd: hintCmd ?? "" })) + "\n" + c.dim(t("cli.externalOnly.hint", { cmd: hintCmd || "\u2026" }));
|
|
14
12
|
case "replOnly":
|
|
15
13
|
return c.yellow(t("cli.replOnly", { cmd: hintCmd ?? "" })) + "\n" + c.dim(t("cli.replOnly.hint"));
|
|
16
14
|
case "needTty":
|
package/dist/cli-gate.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli-gate.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * cli-gate.ts \u2014 \u5C06 command-surface \u62D2\u7EDD\u539F\u56E0\u683C\u5F0F\u5316\u4E3A\u7528\u6237\u6587\u6848\uFF08DRY\uFF09\n */\nimport {\n canRunCommand,\n findModuleSubSpec,\n findPacksSubSpec,\n findTopLevelSpec,\n isCliTty,\n type CanRunFailReason,\n type CommandMode,\n type CommandSpec,\n} from \"./command-surface.js\";\nimport { t } from \"./i18n/index.js\";\nimport { c } from \"./theme.js\";\n\nexport function formatGateFailure(reason: CanRunFailReason, hintCmd?: string): string {\n switch (reason) {\n case \"
|
|
5
|
-
"mappings": "AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,SAAS;AAClB,SAAS,SAAS;AAEX,SAAS,kBAAkB,QAA0B,SAA0B;AACpF,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,
|
|
4
|
+
"sourcesContent": ["/**\n * cli-gate.ts \u2014 \u5C06 command-surface \u62D2\u7EDD\u539F\u56E0\u683C\u5F0F\u5316\u4E3A\u7528\u6237\u6587\u6848\uFF08DRY\uFF09\n */\nimport {\n canRunCommand,\n findModuleSubSpec,\n findPacksSubSpec,\n findTopLevelSpec,\n isCliTty,\n type CanRunFailReason,\n type CommandMode,\n type CommandSpec,\n} from \"./command-surface.js\";\nimport { t } from \"./i18n/index.js\";\nimport { c } from \"./theme.js\";\n\nexport function formatGateFailure(reason: CanRunFailReason, hintCmd?: string): string {\n switch (reason) {\n case \"replOnly\":\n return c.yellow(t(\"cli.replOnly\", { cmd: hintCmd ?? \"\" })) + \"\\n\" + c.dim(t(\"cli.replOnly.hint\"));\n case \"needTty\":\n return c.yellow(t(\"cli.needTty\", { cmd: hintCmd ?? \"\" }));\n }\n}\n\nexport function gateSpec(\n spec: CommandSpec | undefined,\n mode: CommandMode,\n hintCmd?: string\n): string | null {\n if (!spec) return null;\n const result = canRunCommand(spec, { mode, isTty: isCliTty() });\n if (result.ok) return null;\n return formatGateFailure(result.reason, hintCmd ?? spec.id);\n}\n\n/** \u9876\u5C42\u547D\u4EE4\u95E8\u7981\uFF1B\u672A\u77E5\u547D\u4EE4\u8FD4\u56DE null\uFF08\u7531\u8C03\u7528\u65B9\u62A5 unknown\uFF09\u3002 */\nexport function gateTopLevel(cmd: string | undefined, mode: CommandMode): string | null {\n const spec = findTopLevelSpec(cmd);\n if (!spec) return null;\n return gateSpec(spec, mode, cmd);\n}\n\nexport function gateModuleSub(sub: string | undefined, mode: CommandMode): string | null {\n const spec = findModuleSubSpec(sub);\n if (!spec) return null;\n return gateSpec(spec, mode, `module ${sub}`);\n}\n\nexport function gatePacksSub(sub: string | undefined, mode: CommandMode): string | null {\n const spec = findPacksSubSpec(sub);\n if (!spec) return null;\n return gateSpec(spec, mode, `packs ${sub}`);\n}\n"],
|
|
5
|
+
"mappings": "AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,SAAS;AAClB,SAAS,SAAS;AAEX,SAAS,kBAAkB,QAA0B,SAA0B;AACpF,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,WAAW,GAAG,CAAC,CAAC,IAAI,OAAO,EAAE,IAAI,EAAE,mBAAmB,CAAC;AAAA,IAClG,KAAK;AACH,aAAO,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,GAAG,CAAC,CAAC;AAAA,EAC5D;AACF;AAEO,SAAS,SACd,MACA,MACA,SACe;AACf,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,SAAS,cAAc,MAAM,EAAE,MAAM,OAAO,SAAS,EAAE,CAAC;AAC9D,MAAI,OAAO,GAAI,QAAO;AACtB,SAAO,kBAAkB,OAAO,QAAQ,WAAW,KAAK,EAAE;AAC5D;AAGO,SAAS,aAAa,KAAyB,MAAkC;AACtF,QAAM,OAAO,iBAAiB,GAAG;AACjC,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,SAAS,MAAM,MAAM,GAAG;AACjC;AAEO,SAAS,cAAc,KAAyB,MAAkC;AACvF,QAAM,OAAO,kBAAkB,GAAG;AAClC,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,SAAS,MAAM,MAAM,UAAU,GAAG,EAAE;AAC7C;AAEO,SAAS,aAAa,KAAyB,MAAkC;AACtF,QAAM,OAAO,iBAAiB,GAAG;AACjC,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,SAAS,MAAM,MAAM,SAAS,GAAG,EAAE;AAC5C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type CommandChannel = "
|
|
1
|
+
export type CommandChannel = "repl" | "both";
|
|
2
2
|
export type CommandMode = "argv" | "repl";
|
|
3
3
|
export type CommandAccent = "dev";
|
|
4
4
|
export type CommandSpec = {
|
|
@@ -19,7 +19,7 @@ export type CanRunContext = {
|
|
|
19
19
|
mode: CommandMode;
|
|
20
20
|
isTty: boolean;
|
|
21
21
|
};
|
|
22
|
-
export type CanRunFailReason = "
|
|
22
|
+
export type CanRunFailReason = "replOnly" | "needTty";
|
|
23
23
|
export type CanRunResult = {
|
|
24
24
|
ok: true;
|
|
25
25
|
} | {
|
|
@@ -31,6 +31,9 @@ export declare const TOP_LEVEL_ALIASES: Readonly<Record<string, string>>;
|
|
|
31
31
|
/**
|
|
32
32
|
* 顶层扁平短命令 → module 子命令(argv / REPL 共用,避免在 switch 里散落映射)
|
|
33
33
|
* 不含 enable/disable(与 packs 冲突,仍走 /module 或 /packs)
|
|
34
|
+
*
|
|
35
|
+
* 与 packs 子命令对齐:`packs i` → `packs install`(mapPacksSubAlias);
|
|
36
|
+
* module 顶层同样支持 `i` → `install`(见 TOP_LEVEL_ALIASES 与本表)。
|
|
34
37
|
*/
|
|
35
38
|
export declare const MODULE_TOP_SHORTHAND: Readonly<Record<string, string>>;
|
|
36
39
|
export declare function resolveModuleTopShorthand(cmd: string | undefined): string | undefined;
|
|
@@ -65,18 +68,8 @@ export type PaletteNode = {
|
|
|
65
68
|
/** 无 children 时仍需自由输入(回车后填入空格继续打字) */
|
|
66
69
|
freeArgs?: boolean;
|
|
67
70
|
};
|
|
68
|
-
/** @deprecated 兼容旧扁平条目;新逻辑用 PaletteNode */
|
|
69
|
-
export type PaletteEntry = {
|
|
70
|
-
slash: string;
|
|
71
|
-
needsArgs: boolean;
|
|
72
|
-
accent?: CommandAccent;
|
|
73
|
-
label: string;
|
|
74
|
-
descKey: string;
|
|
75
|
-
};
|
|
76
71
|
/** 层级命令树(REPL 面板主列) */
|
|
77
72
|
export declare function listPaletteRoots(mode?: CommandMode): PaletteNode[];
|
|
78
|
-
/** 扁平列表(测试 / 旧调用);层级 UI 请用 listPaletteRoots */
|
|
79
|
-
export declare function listPaletteEntries(mode?: CommandMode): PaletteEntry[];
|
|
80
73
|
export declare function isDevAccent(spec: CommandSpec | undefined): boolean;
|
|
81
74
|
/** sub 是否为开发者样式命令(蓝标)。 */
|
|
82
75
|
export declare function isDevAccentModuleSub(sub: string | undefined): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-surface.d.ts","sourceRoot":"","sources":["../src/command-surface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-surface.d.ts","sourceRoot":"","sources":["../src/command-surface.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAC1C,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,GAAG,CAA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12
|
remove: "uninstall"
|
|
13
13
|
};
|
|
14
14
|
const MODULE_TOP_SHORTHAND = {
|
|
15
|
+
i: "install",
|
|
15
16
|
install: "install",
|
|
16
17
|
uninstall: "uninstall",
|
|
17
18
|
search: "search",
|
|
18
|
-
verify: "verify"
|
|
19
|
-
link: "link",
|
|
20
|
-
create: "create"
|
|
19
|
+
verify: "verify"
|
|
21
20
|
};
|
|
22
21
|
function resolveModuleTopShorthand(cmd) {
|
|
23
22
|
if (!cmd) return void 0;
|
|
@@ -31,12 +30,11 @@ function resolveTopLevelName(cmd) {
|
|
|
31
30
|
}
|
|
32
31
|
function channelAllows(channel, mode) {
|
|
33
32
|
if (channel === "both") return true;
|
|
34
|
-
if (channel === "external") return mode === "argv";
|
|
35
33
|
return mode === "repl";
|
|
36
34
|
}
|
|
37
35
|
function canRunCommand(spec, ctx) {
|
|
38
36
|
if (!channelAllows(spec.channel, ctx.mode)) {
|
|
39
|
-
return { ok: false, reason:
|
|
37
|
+
return { ok: false, reason: "replOnly" };
|
|
40
38
|
}
|
|
41
39
|
if (spec.needsTty && !ctx.isTty) {
|
|
42
40
|
return { ok: false, reason: "needTty" };
|
|
@@ -101,13 +99,7 @@ const TOP_DESC = {
|
|
|
101
99
|
install: "help.module.install",
|
|
102
100
|
uninstall: "help.module.uninstall",
|
|
103
101
|
search: "help.module.search",
|
|
104
|
-
verify: "help.module.verify"
|
|
105
|
-
link: "help.module.link",
|
|
106
|
-
create: "help.module.create",
|
|
107
|
-
dev: "help.module.dev",
|
|
108
|
-
watch: "help.module.watch",
|
|
109
|
-
test: "help.module.test",
|
|
110
|
-
publish: "help.module.publish"
|
|
102
|
+
verify: "help.module.verify"
|
|
111
103
|
};
|
|
112
104
|
const MODULE_DESC = {
|
|
113
105
|
list: "help.module.list",
|
|
@@ -119,10 +111,7 @@ const MODULE_DESC = {
|
|
|
119
111
|
uninstall: "help.module.uninstall",
|
|
120
112
|
verify: "help.module.verify",
|
|
121
113
|
enable: "help.module.toggle",
|
|
122
|
-
disable: "help.module.toggle"
|
|
123
|
-
create: "help.module.create",
|
|
124
|
-
link: "help.module.link",
|
|
125
|
-
dev: "help.module.dev"
|
|
114
|
+
disable: "help.module.toggle"
|
|
126
115
|
};
|
|
127
116
|
const PACKS_DESC = {
|
|
128
117
|
list: "help.packs.list",
|
|
@@ -148,7 +137,7 @@ function serviceArgNodes() {
|
|
|
148
137
|
];
|
|
149
138
|
}
|
|
150
139
|
function moduleChildNodes(mode) {
|
|
151
|
-
const noArg = /* @__PURE__ */ new Set(["list", "build"
|
|
140
|
+
const noArg = /* @__PURE__ */ new Set(["list", "build"]);
|
|
152
141
|
return listVisibleModuleSubs(mode).map((sub) => {
|
|
153
142
|
const spec = findModuleSubSpec(sub);
|
|
154
143
|
const node = {
|
|
@@ -220,28 +209,6 @@ function listPaletteRoots(mode = "repl") {
|
|
|
220
209
|
}
|
|
221
210
|
return out;
|
|
222
211
|
}
|
|
223
|
-
function listPaletteEntries(mode = "repl") {
|
|
224
|
-
const out = [];
|
|
225
|
-
const walk = (nodes, prefix) => {
|
|
226
|
-
for (const n of nodes) {
|
|
227
|
-
const path = [...prefix, n.token];
|
|
228
|
-
const slash = "/" + path.join(" ");
|
|
229
|
-
if (n.children?.length) {
|
|
230
|
-
walk(n.children, path);
|
|
231
|
-
} else {
|
|
232
|
-
out.push({
|
|
233
|
-
slash,
|
|
234
|
-
needsArgs: Boolean(n.freeArgs),
|
|
235
|
-
label: slash,
|
|
236
|
-
descKey: n.descKey ?? "help.help",
|
|
237
|
-
...n.accent ? { accent: n.accent } : {}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
walk(listPaletteRoots(mode), []);
|
|
243
|
-
return out;
|
|
244
|
-
}
|
|
245
212
|
function isDevAccent(spec) {
|
|
246
213
|
return spec?.accent === "dev";
|
|
247
214
|
}
|
|
@@ -270,8 +237,6 @@ const COMMAND_SPECS = [
|
|
|
270
237
|
{ id: "uninstall", name: "uninstall", channel: "both", aliases: ["remove"] },
|
|
271
238
|
{ id: "search", name: "search", channel: "both" },
|
|
272
239
|
{ id: "verify", name: "verify", channel: "both" },
|
|
273
|
-
{ id: "link", name: "link", channel: "both" },
|
|
274
|
-
{ id: "create", name: "create", channel: "both", needsTty: true, accent: "dev" },
|
|
275
240
|
{ id: "module.list", name: "module", sub: "list", channel: "both" },
|
|
276
241
|
{ id: "module.info", name: "module", sub: "info", channel: "both" },
|
|
277
242
|
{ id: "module.build", name: "module", sub: "build", channel: "both", accent: "dev" },
|
|
@@ -288,26 +253,6 @@ const COMMAND_SPECS = [
|
|
|
288
253
|
{ id: "module.verify", name: "module", sub: "verify", channel: "both" },
|
|
289
254
|
{ id: "module.enable", name: "module", sub: "enable", channel: "both" },
|
|
290
255
|
{ id: "module.disable", name: "module", sub: "disable", channel: "both" },
|
|
291
|
-
{ id: "module.link", name: "module", sub: "link", channel: "both" },
|
|
292
|
-
{
|
|
293
|
-
id: "module.create",
|
|
294
|
-
name: "module",
|
|
295
|
-
sub: "create",
|
|
296
|
-
channel: "both",
|
|
297
|
-
needsTty: true,
|
|
298
|
-
accent: "dev"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
id: "module.dev",
|
|
302
|
-
name: "module",
|
|
303
|
-
sub: "dev",
|
|
304
|
-
channel: "both",
|
|
305
|
-
needsTty: true,
|
|
306
|
-
accent: "dev"
|
|
307
|
-
},
|
|
308
|
-
{ id: "module.watch", name: "module", sub: "watch", channel: "both", accent: "dev" },
|
|
309
|
-
{ id: "module.test", name: "module", sub: "test", channel: "both", accent: "dev" },
|
|
310
|
-
{ id: "module.publish", name: "module", sub: "publish", channel: "both", accent: "dev" },
|
|
311
256
|
{ id: "packs.list", name: "packs", sub: "list", channel: "both" },
|
|
312
257
|
{ id: "packs.search", name: "packs", sub: "search", channel: "both" },
|
|
313
258
|
{ id: "packs.enable", name: "packs", sub: "enable", channel: "both" },
|
|
@@ -338,7 +283,6 @@ export {
|
|
|
338
283
|
isCliTty,
|
|
339
284
|
isDevAccent,
|
|
340
285
|
isDevAccentModuleSub,
|
|
341
|
-
listPaletteEntries,
|
|
342
286
|
listPaletteRoots,
|
|
343
287
|
listVisibleCommands,
|
|
344
288
|
listVisibleModuleSubs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/command-surface.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * command-surface.ts \u2014 sfmc CLI \u547D\u4EE4\u901A\u9053\u6CE8\u518C\u8868\uFF08\u5355\u4E00\u6743\u5A01\uFF09\n *\n * channel:\n * - both: argv\uFF08`sfmc <cmd>`\uFF09\u4E0E REPL \u5747\u53EF\u7528\uFF08\u9ED8\u8BA4\uFF09\n * - repl: \u4EC5 REPL\uFF1Bargv \u62D2\u7EDD\uFF08\u5982 send / quit\uFF09\n * - external: \u5DF2\u5F03\u7528\uFF1B\u52FF\u65B0\u589E\uFF08\u5386\u53F2\u517C\u5BB9\u4FDD\u7559\u7C7B\u578B\uFF09\n *\n * accent: \"dev\" \u4EC5\u5F71\u54CD\u5E2E\u52A9/\u8865\u5168\u84DD\u8272\u6837\u5F0F\uFF0C\u4E0D\u53C2\u4E0E canRun\uFF08OCP/DRY\uFF09\u3002\n * \u4E1A\u52A1\u5B9E\u73B0\u4E0D\u5728\u672C\u6587\u4EF6 / \u9762\u677F\u5185\uFF1A\u5206\u53D1\u5230 commands\u3001module-commands\u3001world-packs \u7B49\u3002\n */\nimport { stdin } from \"node:process\";\n\nexport type CommandChannel = \"external\" | \"repl\" | \"both\";\nexport type CommandMode = \"argv\" | \"repl\";\nexport type CommandAccent = \"dev\";\n\nexport type CommandSpec = {\n /** \u7A33\u5B9A id\uFF0C\u5982 \"module.install\" / \"send\" / \"debug\" */\n id: string;\n /** \u9876\u5C42\u547D\u4EE4\u540D\uFF08module \u5B50\u547D\u4EE4\u7528 \"module\"\uFF1B\u9876\u5C42\u522B\u540D\u89C1 TOP_LEVEL_ALIASES\uFF09 */\n name: string;\n /** \u5B50\u547D\u4EE4\uFF08\u4EC5 module/packs \u7B49\uFF09 */\n sub?: string;\n channel: CommandChannel;\n needsTty?: boolean;\n /** \u5E2E\u52A9\u67D3\u8272\uFF1B\u4E0D\u53C2\u4E0E canRun */\n accent?: CommandAccent;\n /** \u5B50\u547D\u4EE4\u540C\u4E49\u522B\u540D\uFF08\u5982 uninstall \u2192 remove\uFF09\uFF0C\u4E0D\u662F\u9876\u5C42\u522B\u540D */\n aliases?: string[];\n};\n\nexport type CanRunContext = {\n mode: CommandMode;\n isTty: boolean;\n};\n\nexport type CanRunFailReason = \"externalOnly\" | \"replOnly\" | \"needTty\";\n\nexport type CanRunResult = { ok: true } | { ok: false; reason: CanRunFailReason };\n\n/** \u9876\u5C42\u547D\u4EE4\u522B\u540D \u2192 \u89C4\u8303 name\uFF08DRY\uFF1A\u52FF\u5728\u5404 sub spec \u91CD\u590D\u5199 mod/addon\uFF09 */\nexport const TOP_LEVEL_ALIASES: Readonly<Record<string, string>> = {\n mod: \"module\",\n addon: \"packs\",\n log: \"logs\",\n lang: \"locale\",\n h: \"help\",\n \"?\": \"help\",\n exit: \"quit\",\n q: \"quit\",\n i: \"install\",\n remove: \"uninstall\",\n};\n\n/**\n * \u9876\u5C42\u6241\u5E73\u77ED\u547D\u4EE4 \u2192 module \u5B50\u547D\u4EE4\uFF08argv / REPL \u5171\u7528\uFF0C\u907F\u514D\u5728 switch \u91CC\u6563\u843D\u6620\u5C04\uFF09\n * \u4E0D\u542B enable/disable\uFF08\u4E0E packs \u51B2\u7A81\uFF0C\u4ECD\u8D70 /module \u6216 /packs\uFF09\n */\nexport const MODULE_TOP_SHORTHAND: Readonly<Record<string, string>> = {\n install: \"install\",\n uninstall: \"uninstall\",\n search: \"search\",\n verify: \"verify\",\n link: \"link\",\n create: \"create\",\n};\n\nexport function resolveModuleTopShorthand(cmd: string | undefined): string | undefined {\n if (!cmd) return undefined;\n const name = resolveTopLevelName(cmd);\n if (!name) return undefined;\n return MODULE_TOP_SHORTHAND[name];\n}\n\nexport function resolveTopLevelName(cmd: string | undefined): string | undefined {\n if (!cmd) return undefined;\n return TOP_LEVEL_ALIASES[cmd] ?? cmd;\n}\n\nfunction channelAllows(channel: CommandChannel, mode: CommandMode): boolean {\n if (channel === \"both\") return true;\n if (channel === \"external\") return mode === \"argv\";\n return mode === \"repl\";\n}\n\n/** \u5224\u5B9A\u5F53\u524D\u6A21\u5F0F\u4E0B\u80FD\u5426\u6267\u884C\u8BE5\u547D\u4EE4\uFF08accent \u4E0D\u53C2\u4E0E\uFF09\u3002 */\nexport function canRunCommand(spec: CommandSpec, ctx: CanRunContext): CanRunResult {\n if (!channelAllows(spec.channel, ctx.mode)) {\n return { ok: false, reason: spec.channel === \"external\" ? \"externalOnly\" : \"replOnly\" };\n }\n if (spec.needsTty && !ctx.isTty) {\n return { ok: false, reason: \"needTty\" };\n }\n return { ok: true };\n}\n\n/** \u5F53\u524D\u6A21\u5F0F\u53EF\u89C1\u547D\u4EE4\uFF08help / Tab\uFF09\u3002 */\nexport function listVisibleCommands(mode: CommandMode): CommandSpec[] {\n return COMMAND_SPECS.filter((s) => channelAllows(s.channel, mode));\n}\n\n/** \u9876\u5C42\u547D\u4EE4\u540D\uFF08\u542B\u522B\u540D\uFF09\uFF0C\u4F9B REPL COMMANDS / \u8865\u5168\u3002 */\nexport function listVisibleTopLevelNames(mode: CommandMode): string[] {\n const canonical = new Set<string>();\n for (const s of listVisibleCommands(mode)) {\n canonical.add(s.name);\n }\n const out = new Set<string>(canonical);\n for (const [alias, name] of Object.entries(TOP_LEVEL_ALIASES)) {\n if (canonical.has(name)) out.add(alias);\n }\n return [...out];\n}\n\n/** \u67E5\u627E\u9876\u5C42\u547D\u4EE4\uFF08\u65E0 sub\uFF09\u7684\u4EFB\u610F\u4E00\u6761\u540C\u540D spec\uFF08\u7528\u4E8E channel \u95E8\u7981\uFF09\u3002 */\nexport function findTopLevelSpec(cmd: string | undefined): CommandSpec | undefined {\n const name = resolveTopLevelName(cmd);\n if (!name) return undefined;\n /* \u4F18\u5148\u65E0 sub \u7684\u9876\u5C42\u6761\u76EE\uFF1B\u5426\u5219\u53D6\u8BE5 name \u4E0B\u4EFB\u610F\u53EF\u89C1 spec \u4EE3\u8868\u901A\u9053\uFF08module/packs\uFF09 */\n const top = COMMAND_SPECS.find((s) => !s.sub && s.name === name);\n if (top) return top;\n return COMMAND_SPECS.find((s) => s.name === name);\n}\n\n/** \u67E5\u627E module \u5B50\u547D\u4EE4 spec\u3002 */\nexport function findModuleSubSpec(sub: string | undefined): CommandSpec | undefined {\n if (!sub) return undefined;\n return COMMAND_SPECS.find(\n (s) => s.name === \"module\" && (s.sub === sub || (s.aliases ?? []).includes(sub))\n );\n}\n\n/** \u67E5\u627E packs \u5B50\u547D\u4EE4 spec\u3002 */\nexport function findPacksSubSpec(sub: string | undefined): CommandSpec | undefined {\n if (!sub) return undefined;\n return COMMAND_SPECS.find(\n (s) => s.name === \"packs\" && (s.sub === sub || (s.aliases ?? []).includes(sub))\n );\n}\n\n/** \u5F53\u524D mode \u4E0B\u53EF\u89C1\u7684 module \u5B50\u547D\u4EE4\u540D\uFF08\u89C4\u8303\u540D\uFF0C\u4E0D\u542B remove \u522B\u540D\uFF09\u3002 */\nexport function listVisibleModuleSubs(mode: CommandMode): string[] {\n return listVisibleCommands(mode)\n .filter((s) => s.name === \"module\" && s.sub)\n .map((s) => s.sub!);\n}\n\n/** \u5F53\u524D mode \u4E0B\u53EF\u89C1\u7684 packs \u5B50\u547D\u4EE4\u540D\u3002 */\nexport function listVisiblePacksSubs(mode: CommandMode): string[] {\n return listVisibleCommands(mode)\n .filter((s) => s.name === \"packs\" && s.sub)\n .map((s) => s.sub!);\n}\n\n/** REPL \u5FEB\u901F\u8865\u5168\uFF1A\u5C42\u7EA7\u8282\u70B9\uFF08\u4E3B\u9762\u677F \u2192 \u53F3\u4FA7\u5B50\u9762\u677F\uFF09 */\nexport type PaletteNode = {\n /** \u9762\u677F\u5185\u663E\u793A\u7684\u6807\u7B7E */\n label: string;\n /** \u8FFD\u52A0\u5230\u547D\u4EE4\u884C\u7684 token\uFF08\u6839\u8282\u70B9\u542B\u6216\u4E0D\u542B\u524D\u5BFC\u903B\u8F91\u7531\u7EC4\u88C5\u8D1F\u8D23\uFF09 */\n token: string;\n /** i18n \u63CF\u8FF0\u952E */\n descKey?: string;\n accent?: CommandAccent;\n /** \u56FA\u5B9A\u4E0B\u4E00\u53C2\u9009\u9879\uFF1B\u56DE\u8F66\u540E\u5728\u53F3\u4FA7\u5C55\u5F00 */\n children?: PaletteNode[];\n /** \u65E0 children \u65F6\u4ECD\u9700\u81EA\u7531\u8F93\u5165\uFF08\u56DE\u8F66\u540E\u586B\u5165\u7A7A\u683C\u7EE7\u7EED\u6253\u5B57\uFF09 */\n freeArgs?: boolean;\n};\n\n/** @deprecated \u517C\u5BB9\u65E7\u6241\u5E73\u6761\u76EE\uFF1B\u65B0\u903B\u8F91\u7528 PaletteNode */\nexport type PaletteEntry = {\n slash: string;\n needsArgs: boolean;\n accent?: CommandAccent;\n label: string;\n descKey: string;\n};\n\nconst NO_ARG_TOP = new Set([\"status\", \"help\", \"version\", \"quit\", \"init\", \"logs\"]);\n\nconst TOP_DESC: Record<string, string> = {\n status: \"help.status\",\n logs: \"help.logs\",\n start: \"help.start\",\n stop: \"help.stop\",\n restart: \"help.restart\",\n send: \"help.send\",\n help: \"help.help\",\n version: \"help.version\",\n quit: \"help.quit\",\n init: \"help.init\",\n update: \"help.update\",\n locale: \"help.locale\",\n remote: \"help.remote.status\",\n debug: \"help.debug.status\",\n install: \"help.module.install\",\n uninstall: \"help.module.uninstall\",\n search: \"help.module.search\",\n verify: \"help.module.verify\",\n link: \"help.module.link\",\n create: \"help.module.create\",\n dev: \"help.module.dev\",\n watch: \"help.module.watch\",\n test: \"help.module.test\",\n publish: \"help.module.publish\",\n};\n\nconst MODULE_DESC: Record<string, string> = {\n list: \"help.module.list\",\n info: \"help.module.info\",\n build: \"help.module.build\",\n reload: \"help.module.reload\",\n search: \"help.module.search\",\n install: \"help.module.install\",\n uninstall: \"help.module.uninstall\",\n verify: \"help.module.verify\",\n enable: \"help.module.toggle\",\n disable: \"help.module.toggle\",\n create: \"help.module.create\",\n link: \"help.module.link\",\n dev: \"help.module.dev\",\n};\n\nconst PACKS_DESC: Record<string, string> = {\n list: \"help.packs.list\",\n search: \"help.packs.search\",\n enable: \"help.packs.enable\",\n disable: \"help.packs.disable\",\n doctor: \"help.packs.doctor\",\n path: \"help.packs.path\",\n install: \"help.addon\",\n scan: \"help.addon\",\n uninstall: \"help.addon\",\n bind: \"help.addon\",\n unbind: \"help.addon\",\n sources: \"help.addon\",\n check: \"help.addon\",\n update: \"help.addon\",\n bump: \"help.addon\",\n};\n\nfunction serviceArgNodes(): PaletteNode[] {\n return [\n { label: \"-all\", token: \"-all\" },\n ...([\"bds\", \"db\", \"qq\", \"llbot\"] as const).map((n) => ({ label: n, token: n })),\n ];\n}\n\nfunction moduleChildNodes(mode: CommandMode): PaletteNode[] {\n const noArg = new Set([\"list\", \"build\", \"create\", \"dev\"]);\n return listVisibleModuleSubs(mode).map((sub) => {\n const spec = findModuleSubSpec(sub);\n const node: PaletteNode = {\n label: sub,\n token: sub,\n descKey: MODULE_DESC[sub] ?? \"help.module.list\",\n freeArgs: !noArg.has(sub),\n };\n if (spec?.accent) node.accent = spec.accent;\n return node;\n });\n}\n\nfunction packsChildNodes(mode: CommandMode): PaletteNode[] {\n const noArg = new Set([\"list\", \"doctor\", \"path\", \"sources\"]);\n return listVisiblePacksSubs(mode).map((sub) => ({\n label: sub,\n token: sub,\n descKey: PACKS_DESC[sub] ?? \"help.addon\",\n freeArgs: !noArg.has(sub),\n }));\n}\n\n/** \u5C42\u7EA7\u547D\u4EE4\u6811\uFF08REPL \u9762\u677F\u4E3B\u5217\uFF09 */\nexport function listPaletteRoots(mode: CommandMode = \"repl\"): PaletteNode[] {\n const specs = listVisibleCommands(mode);\n const out: PaletteNode[] = [];\n const seen = new Set<string>();\n /** \u9762\u677F\u4E0D\u5C55\u793A\u9876\u5C42\u77ED\u547D\u4EE4\uFF0C\u7EDF\u4E00\u8D70 /module <sub>\uFF08argv \u77ED\u547D\u4EE4\u4ECD\u53EF\u7528\uFF09 */\n const skipTopShorthand = new Set(Object.keys(MODULE_TOP_SHORTHAND));\n\n for (const s of specs) {\n if (s.sub) continue;\n if (s.name === \"module\" || s.name === \"packs\") continue;\n if (skipTopShorthand.has(s.name)) continue;\n if (seen.has(s.name)) continue;\n seen.add(s.name);\n\n const node: PaletteNode = {\n label: `/${s.name}`,\n token: s.name,\n descKey: TOP_DESC[s.name] ?? \"help.help\",\n };\n if (s.accent) node.accent = s.accent;\n\n if (s.name === \"start\" || s.name === \"stop\" || s.name === \"restart\") {\n node.children = serviceArgNodes();\n } else if (s.name === \"send\") {\n node.children = ([\"bds\", \"db\", \"qq\", \"llbot\"] as const).map((n) => ({\n label: n,\n token: n,\n freeArgs: true,\n }));\n } else if (!NO_ARG_TOP.has(s.name)) {\n node.freeArgs = true;\n }\n\n out.push(node);\n }\n\n const moduleSubs = moduleChildNodes(mode);\n if (moduleSubs.length > 0) {\n out.push({\n label: \"/module\",\n token: \"module\",\n descKey: \"help.module.list\",\n children: moduleSubs,\n });\n }\n\n const packsSubs = packsChildNodes(mode);\n if (packsSubs.length > 0) {\n out.push({\n label: \"/packs\",\n token: \"packs\",\n descKey: \"help.addon\",\n children: packsSubs,\n });\n }\n\n return out;\n}\n\n/** \u6241\u5E73\u5217\u8868\uFF08\u6D4B\u8BD5 / \u65E7\u8C03\u7528\uFF09\uFF1B\u5C42\u7EA7 UI \u8BF7\u7528 listPaletteRoots */\nexport function listPaletteEntries(mode: CommandMode = \"repl\"): PaletteEntry[] {\n const out: PaletteEntry[] = [];\n const walk = (nodes: PaletteNode[], prefix: string[]): void => {\n for (const n of nodes) {\n const path = [...prefix, n.token];\n const slash = \"/\" + path.join(\" \");\n if (n.children?.length) {\n walk(n.children, path);\n } else {\n out.push({\n slash,\n needsArgs: Boolean(n.freeArgs),\n label: slash,\n descKey: n.descKey ?? \"help.help\",\n ...(n.accent ? { accent: n.accent } : {}),\n });\n }\n }\n };\n walk(listPaletteRoots(mode), []);\n return out;\n}\n\nexport function isDevAccent(spec: CommandSpec | undefined): boolean {\n return spec?.accent === \"dev\";\n}\n\n/** sub \u662F\u5426\u4E3A\u5F00\u53D1\u8005\u6837\u5F0F\u547D\u4EE4\uFF08\u84DD\u6807\uFF09\u3002 */\nexport function isDevAccentModuleSub(sub: string | undefined): boolean {\n return isDevAccent(findModuleSubSpec(sub));\n}\n\n/** stdin TTY \u63A2\u6D4B\uFF08\u4F9B main/repl \u5171\u7528\uFF09\u3002 */\nexport function isCliTty(): boolean {\n return Boolean(stdin.isTTY);\n}\n\n/**\n * \u547D\u4EE4\u6CE8\u518C\u8868 \u2014\u2014 \u65B0\u589E\u547D\u4EE4\u53EA\u52A0\u6B64\u5904\uFF08OCP\uFF09\u3002\n * channel:\n * - both: argv + REPL\uFF08\u9ED8\u8BA4\uFF1B\u9762\u677F\u53EA\u8C03\u5EA6\u65E2\u6709 dispatcher\uFF09\n * - repl: \u4EC5 REPL\uFF08\u5982 send / quit\uFF09\n */\nexport const COMMAND_SPECS: readonly CommandSpec[] = [\n /* \u2500\u2500\u2500 both\uFF1A\u670D\u52A1 / \u6A21\u5757 / \u8D44\u6E90\u5305 / \u914D\u7F6E \u2500\u2500\u2500 */\n { id: \"status\", name: \"status\", channel: \"both\" },\n { id: \"start\", name: \"start\", channel: \"both\" },\n { id: \"stop\", name: \"stop\", channel: \"both\" },\n { id: \"restart\", name: \"restart\", channel: \"both\" },\n { id: \"logs\", name: \"logs\", channel: \"repl\" },\n { id: \"help\", name: \"help\", channel: \"both\" },\n { id: \"version\", name: \"version\", channel: \"both\" },\n { id: \"init\", name: \"init\", channel: \"both\", needsTty: true },\n { id: \"update\", name: \"update\", channel: \"both\" },\n { id: \"locale\", name: \"locale\", channel: \"both\" },\n { id: \"remote\", name: \"remote\", channel: \"both\" },\n { id: \"debug\", name: \"debug\", channel: \"both\", accent: \"dev\" },\n\n /** \u9876\u5C42\u6241\u5E73\u77ED\u547D\u4EE4 \u2192 module.*\uFF08\u5C11\u5199\u4E00\u5C42 module\uFF09 */\n { id: \"install\", name: \"install\", channel: \"both\" },\n { id: \"uninstall\", name: \"uninstall\", channel: \"both\", aliases: [\"remove\"] },\n { id: \"search\", name: \"search\", channel: \"both\" },\n { id: \"verify\", name: \"verify\", channel: \"both\" },\n { id: \"link\", name: \"link\", channel: \"both\" },\n { id: \"create\", name: \"create\", channel: \"both\", needsTty: true, accent: \"dev\" },\n\n { id: \"module.list\", name: \"module\", sub: \"list\", channel: \"both\" },\n { id: \"module.info\", name: \"module\", sub: \"info\", channel: \"both\" },\n { id: \"module.build\", name: \"module\", sub: \"build\", channel: \"both\", accent: \"dev\" },\n { id: \"module.reload\", name: \"module\", sub: \"reload\", channel: \"both\", accent: \"dev\" },\n { id: \"module.install\", name: \"module\", sub: \"install\", channel: \"both\" },\n {\n id: \"module.uninstall\",\n name: \"module\",\n sub: \"uninstall\",\n channel: \"both\",\n aliases: [\"remove\"],\n },\n { id: \"module.search\", name: \"module\", sub: \"search\", channel: \"both\" },\n { id: \"module.verify\", name: \"module\", sub: \"verify\", channel: \"both\" },\n { id: \"module.enable\", name: \"module\", sub: \"enable\", channel: \"both\" },\n { id: \"module.disable\", name: \"module\", sub: \"disable\", channel: \"both\" },\n { id: \"module.link\", name: \"module\", sub: \"link\", channel: \"both\" },\n {\n id: \"module.create\",\n name: \"module\",\n sub: \"create\",\n channel: \"both\",\n needsTty: true,\n accent: \"dev\",\n },\n {\n id: \"module.dev\",\n name: \"module\",\n sub: \"dev\",\n channel: \"both\",\n needsTty: true,\n accent: \"dev\",\n },\n { id: \"module.watch\", name: \"module\", sub: \"watch\", channel: \"both\", accent: \"dev\" },\n { id: \"module.test\", name: \"module\", sub: \"test\", channel: \"both\", accent: \"dev\" },\n { id: \"module.publish\", name: \"module\", sub: \"publish\", channel: \"both\", accent: \"dev\" },\n\n { id: \"packs.list\", name: \"packs\", sub: \"list\", channel: \"both\" },\n { id: \"packs.search\", name: \"packs\", sub: \"search\", channel: \"both\" },\n { id: \"packs.enable\", name: \"packs\", sub: \"enable\", channel: \"both\" },\n { id: \"packs.disable\", name: \"packs\", sub: \"disable\", channel: \"both\" },\n { id: \"packs.doctor\", name: \"packs\", sub: \"doctor\", channel: \"both\" },\n { id: \"packs.path\", name: \"packs\", sub: \"path\", channel: \"both\" },\n { id: \"packs.install\", name: \"packs\", sub: \"install\", channel: \"both\" },\n { id: \"packs.scan\", name: \"packs\", sub: \"scan\", channel: \"both\" },\n { id: \"packs.uninstall\", name: \"packs\", sub: \"uninstall\", channel: \"both\" },\n { id: \"packs.bind\", name: \"packs\", sub: \"bind\", channel: \"both\" },\n { id: \"packs.unbind\", name: \"packs\", sub: \"unbind\", channel: \"both\" },\n { id: \"packs.sources\", name: \"packs\", sub: \"sources\", channel: \"both\" },\n { id: \"packs.check\", name: \"packs\", sub: \"check\", channel: \"both\" },\n { id: \"packs.update\", name: \"packs\", sub: \"update\", channel: \"both\" },\n { id: \"packs.bump\", name: \"packs\", sub: \"bump\", channel: \"both\" },\n\n /* \u2500\u2500\u2500 repl-only \u2500\u2500\u2500 */\n { id: \"send\", name: \"send\", channel: \"repl\" },\n { id: \"quit\", name: \"quit\", channel: \"repl\" },\n];\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * command-surface.ts \u2014 sfmc CLI \u547D\u4EE4\u901A\u9053\u6CE8\u518C\u8868\uFF08\u5355\u4E00\u6743\u5A01\uFF09\n *\n * channel:\n * - both: argv\uFF08`sfmc <cmd>`\uFF09\u4E0E REPL \u5747\u53EF\u7528\uFF08\u9ED8\u8BA4\uFF09\n * - repl: \u4EC5 REPL\uFF1Bargv \u62D2\u7EDD\uFF08\u5982 send / quit\uFF09\n *\n * accent: \"dev\" \u4EC5\u5F71\u54CD\u5E2E\u52A9/\u8865\u5168\u84DD\u8272\u6837\u5F0F\uFF0C\u4E0D\u53C2\u4E0E canRun\uFF08OCP/DRY\uFF09\u3002\n * \u4E1A\u52A1\u5B9E\u73B0\u4E0D\u5728\u672C\u6587\u4EF6 / \u9762\u677F\u5185\uFF1A\u5206\u53D1\u5230 commands\u3001module-commands\u3001world-packs \u7B49\u3002\n */\nimport { stdin } from \"node:process\";\n\nexport type CommandChannel = \"repl\" | \"both\";\nexport type CommandMode = \"argv\" | \"repl\";\nexport type CommandAccent = \"dev\";\n\nexport type CommandSpec = {\n /** \u7A33\u5B9A id\uFF0C\u5982 \"module.install\" / \"send\" / \"debug\" */\n id: string;\n /** \u9876\u5C42\u547D\u4EE4\u540D\uFF08module \u5B50\u547D\u4EE4\u7528 \"module\"\uFF1B\u9876\u5C42\u522B\u540D\u89C1 TOP_LEVEL_ALIASES\uFF09 */\n name: string;\n /** \u5B50\u547D\u4EE4\uFF08\u4EC5 module/packs \u7B49\uFF09 */\n sub?: string;\n channel: CommandChannel;\n needsTty?: boolean;\n /** \u5E2E\u52A9\u67D3\u8272\uFF1B\u4E0D\u53C2\u4E0E canRun */\n accent?: CommandAccent;\n /** \u5B50\u547D\u4EE4\u540C\u4E49\u522B\u540D\uFF08\u5982 uninstall \u2192 remove\uFF09\uFF0C\u4E0D\u662F\u9876\u5C42\u522B\u540D */\n aliases?: string[];\n};\n\nexport type CanRunContext = {\n mode: CommandMode;\n isTty: boolean;\n};\n\nexport type CanRunFailReason = \"replOnly\" | \"needTty\";\n\nexport type CanRunResult = { ok: true } | { ok: false; reason: CanRunFailReason };\n\n/** \u9876\u5C42\u547D\u4EE4\u522B\u540D \u2192 \u89C4\u8303 name\uFF08DRY\uFF1A\u52FF\u5728\u5404 sub spec \u91CD\u590D\u5199 mod/addon\uFF09 */\nexport const TOP_LEVEL_ALIASES: Readonly<Record<string, string>> = {\n mod: \"module\",\n addon: \"packs\",\n log: \"logs\",\n lang: \"locale\",\n h: \"help\",\n \"?\": \"help\",\n exit: \"quit\",\n q: \"quit\",\n i: \"install\",\n remove: \"uninstall\",\n};\n\n/**\n * \u9876\u5C42\u6241\u5E73\u77ED\u547D\u4EE4 \u2192 module \u5B50\u547D\u4EE4\uFF08argv / REPL \u5171\u7528\uFF0C\u907F\u514D\u5728 switch \u91CC\u6563\u843D\u6620\u5C04\uFF09\n * \u4E0D\u542B enable/disable\uFF08\u4E0E packs \u51B2\u7A81\uFF0C\u4ECD\u8D70 /module \u6216 /packs\uFF09\n *\n * \u4E0E packs \u5B50\u547D\u4EE4\u5BF9\u9F50\uFF1A`packs i` \u2192 `packs install`\uFF08mapPacksSubAlias\uFF09\uFF1B\n * module \u9876\u5C42\u540C\u6837\u652F\u6301 `i` \u2192 `install`\uFF08\u89C1 TOP_LEVEL_ALIASES \u4E0E\u672C\u8868\uFF09\u3002\n */\nexport const MODULE_TOP_SHORTHAND: Readonly<Record<string, string>> = {\n i: \"install\",\n install: \"install\",\n uninstall: \"uninstall\",\n search: \"search\",\n verify: \"verify\",\n};\n\nexport function resolveModuleTopShorthand(cmd: string | undefined): string | undefined {\n if (!cmd) return undefined;\n const name = resolveTopLevelName(cmd);\n if (!name) return undefined;\n return MODULE_TOP_SHORTHAND[name];\n}\n\nexport function resolveTopLevelName(cmd: string | undefined): string | undefined {\n if (!cmd) return undefined;\n return TOP_LEVEL_ALIASES[cmd] ?? cmd;\n}\n\nfunction channelAllows(channel: CommandChannel, mode: CommandMode): boolean {\n if (channel === \"both\") return true;\n return mode === \"repl\";\n}\n\n/** \u5224\u5B9A\u5F53\u524D\u6A21\u5F0F\u4E0B\u80FD\u5426\u6267\u884C\u8BE5\u547D\u4EE4\uFF08accent \u4E0D\u53C2\u4E0E\uFF09\u3002 */\nexport function canRunCommand(spec: CommandSpec, ctx: CanRunContext): CanRunResult {\n if (!channelAllows(spec.channel, ctx.mode)) {\n return { ok: false, reason: \"replOnly\" };\n }\n if (spec.needsTty && !ctx.isTty) {\n return { ok: false, reason: \"needTty\" };\n }\n return { ok: true };\n}\n\n/** \u5F53\u524D\u6A21\u5F0F\u53EF\u89C1\u547D\u4EE4\uFF08help / Tab\uFF09\u3002 */\nexport function listVisibleCommands(mode: CommandMode): CommandSpec[] {\n return COMMAND_SPECS.filter((s) => channelAllows(s.channel, mode));\n}\n\n/** \u9876\u5C42\u547D\u4EE4\u540D\uFF08\u542B\u522B\u540D\uFF09\uFF0C\u4F9B REPL COMMANDS / \u8865\u5168\u3002 */\nexport function listVisibleTopLevelNames(mode: CommandMode): string[] {\n const canonical = new Set<string>();\n for (const s of listVisibleCommands(mode)) {\n canonical.add(s.name);\n }\n const out = new Set<string>(canonical);\n for (const [alias, name] of Object.entries(TOP_LEVEL_ALIASES)) {\n if (canonical.has(name)) out.add(alias);\n }\n return [...out];\n}\n\n/** \u67E5\u627E\u9876\u5C42\u547D\u4EE4\uFF08\u65E0 sub\uFF09\u7684\u4EFB\u610F\u4E00\u6761\u540C\u540D spec\uFF08\u7528\u4E8E channel \u95E8\u7981\uFF09\u3002 */\nexport function findTopLevelSpec(cmd: string | undefined): CommandSpec | undefined {\n const name = resolveTopLevelName(cmd);\n if (!name) return undefined;\n /* \u4F18\u5148\u65E0 sub \u7684\u9876\u5C42\u6761\u76EE\uFF1B\u5426\u5219\u53D6\u8BE5 name \u4E0B\u4EFB\u610F\u53EF\u89C1 spec \u4EE3\u8868\u901A\u9053\uFF08module/packs\uFF09 */\n const top = COMMAND_SPECS.find((s) => !s.sub && s.name === name);\n if (top) return top;\n return COMMAND_SPECS.find((s) => s.name === name);\n}\n\n/** \u67E5\u627E module \u5B50\u547D\u4EE4 spec\u3002 */\nexport function findModuleSubSpec(sub: string | undefined): CommandSpec | undefined {\n if (!sub) return undefined;\n return COMMAND_SPECS.find(\n (s) => s.name === \"module\" && (s.sub === sub || (s.aliases ?? []).includes(sub))\n );\n}\n\n/** \u67E5\u627E packs \u5B50\u547D\u4EE4 spec\u3002 */\nexport function findPacksSubSpec(sub: string | undefined): CommandSpec | undefined {\n if (!sub) return undefined;\n return COMMAND_SPECS.find(\n (s) => s.name === \"packs\" && (s.sub === sub || (s.aliases ?? []).includes(sub))\n );\n}\n\n/** \u5F53\u524D mode \u4E0B\u53EF\u89C1\u7684 module \u5B50\u547D\u4EE4\u540D\uFF08\u89C4\u8303\u540D\uFF0C\u4E0D\u542B remove \u522B\u540D\uFF09\u3002 */\nexport function listVisibleModuleSubs(mode: CommandMode): string[] {\n return listVisibleCommands(mode)\n .filter((s) => s.name === \"module\" && s.sub)\n .map((s) => s.sub!);\n}\n\n/** \u5F53\u524D mode \u4E0B\u53EF\u89C1\u7684 packs \u5B50\u547D\u4EE4\u540D\u3002 */\nexport function listVisiblePacksSubs(mode: CommandMode): string[] {\n return listVisibleCommands(mode)\n .filter((s) => s.name === \"packs\" && s.sub)\n .map((s) => s.sub!);\n}\n\n/** REPL \u5FEB\u901F\u8865\u5168\uFF1A\u5C42\u7EA7\u8282\u70B9\uFF08\u4E3B\u9762\u677F \u2192 \u53F3\u4FA7\u5B50\u9762\u677F\uFF09 */\nexport type PaletteNode = {\n /** \u9762\u677F\u5185\u663E\u793A\u7684\u6807\u7B7E */\n label: string;\n /** \u8FFD\u52A0\u5230\u547D\u4EE4\u884C\u7684 token\uFF08\u6839\u8282\u70B9\u542B\u6216\u4E0D\u542B\u524D\u5BFC\u903B\u8F91\u7531\u7EC4\u88C5\u8D1F\u8D23\uFF09 */\n token: string;\n /** i18n \u63CF\u8FF0\u952E */\n descKey?: string;\n accent?: CommandAccent;\n /** \u56FA\u5B9A\u4E0B\u4E00\u53C2\u9009\u9879\uFF1B\u56DE\u8F66\u540E\u5728\u53F3\u4FA7\u5C55\u5F00 */\n children?: PaletteNode[];\n /** \u65E0 children \u65F6\u4ECD\u9700\u81EA\u7531\u8F93\u5165\uFF08\u56DE\u8F66\u540E\u586B\u5165\u7A7A\u683C\u7EE7\u7EED\u6253\u5B57\uFF09 */\n freeArgs?: boolean;\n};\n\nconst NO_ARG_TOP = new Set([\"status\", \"help\", \"version\", \"quit\", \"init\", \"logs\"]);\n\nconst TOP_DESC: Record<string, string> = {\n status: \"help.status\",\n logs: \"help.logs\",\n start: \"help.start\",\n stop: \"help.stop\",\n restart: \"help.restart\",\n send: \"help.send\",\n help: \"help.help\",\n version: \"help.version\",\n quit: \"help.quit\",\n init: \"help.init\",\n update: \"help.update\",\n locale: \"help.locale\",\n remote: \"help.remote.status\",\n debug: \"help.debug.status\",\n install: \"help.module.install\",\n uninstall: \"help.module.uninstall\",\n search: \"help.module.search\",\n verify: \"help.module.verify\",\n};\n\nconst MODULE_DESC: Record<string, string> = {\n list: \"help.module.list\",\n info: \"help.module.info\",\n build: \"help.module.build\",\n reload: \"help.module.reload\",\n search: \"help.module.search\",\n install: \"help.module.install\",\n uninstall: \"help.module.uninstall\",\n verify: \"help.module.verify\",\n enable: \"help.module.toggle\",\n disable: \"help.module.toggle\",\n};\n\nconst PACKS_DESC: Record<string, string> = {\n list: \"help.packs.list\",\n search: \"help.packs.search\",\n enable: \"help.packs.enable\",\n disable: \"help.packs.disable\",\n doctor: \"help.packs.doctor\",\n path: \"help.packs.path\",\n install: \"help.addon\",\n scan: \"help.addon\",\n uninstall: \"help.addon\",\n bind: \"help.addon\",\n unbind: \"help.addon\",\n sources: \"help.addon\",\n check: \"help.addon\",\n update: \"help.addon\",\n bump: \"help.addon\",\n};\n\nfunction serviceArgNodes(): PaletteNode[] {\n return [\n { label: \"-all\", token: \"-all\" },\n ...([\"bds\", \"db\", \"qq\", \"llbot\"] as const).map((n) => ({ label: n, token: n })),\n ];\n}\n\nfunction moduleChildNodes(mode: CommandMode): PaletteNode[] {\n const noArg = new Set([\"list\", \"build\"]);\n return listVisibleModuleSubs(mode).map((sub) => {\n const spec = findModuleSubSpec(sub);\n const node: PaletteNode = {\n label: sub,\n token: sub,\n descKey: MODULE_DESC[sub] ?? \"help.module.list\",\n freeArgs: !noArg.has(sub),\n };\n if (spec?.accent) node.accent = spec.accent;\n return node;\n });\n}\n\nfunction packsChildNodes(mode: CommandMode): PaletteNode[] {\n const noArg = new Set([\"list\", \"doctor\", \"path\", \"sources\"]);\n return listVisiblePacksSubs(mode).map((sub) => ({\n label: sub,\n token: sub,\n descKey: PACKS_DESC[sub] ?? \"help.addon\",\n freeArgs: !noArg.has(sub),\n }));\n}\n\n/** \u5C42\u7EA7\u547D\u4EE4\u6811\uFF08REPL \u9762\u677F\u4E3B\u5217\uFF09 */\nexport function listPaletteRoots(mode: CommandMode = \"repl\"): PaletteNode[] {\n const specs = listVisibleCommands(mode);\n const out: PaletteNode[] = [];\n const seen = new Set<string>();\n /** \u9762\u677F\u4E0D\u5C55\u793A\u9876\u5C42\u77ED\u547D\u4EE4\uFF0C\u7EDF\u4E00\u8D70 /module <sub>\uFF08argv \u77ED\u547D\u4EE4\u4ECD\u53EF\u7528\uFF09 */\n const skipTopShorthand = new Set(Object.keys(MODULE_TOP_SHORTHAND));\n\n for (const s of specs) {\n if (s.sub) continue;\n if (s.name === \"module\" || s.name === \"packs\") continue;\n if (skipTopShorthand.has(s.name)) continue;\n if (seen.has(s.name)) continue;\n seen.add(s.name);\n\n const node: PaletteNode = {\n label: `/${s.name}`,\n token: s.name,\n descKey: TOP_DESC[s.name] ?? \"help.help\",\n };\n if (s.accent) node.accent = s.accent;\n\n if (s.name === \"start\" || s.name === \"stop\" || s.name === \"restart\") {\n node.children = serviceArgNodes();\n } else if (s.name === \"send\") {\n node.children = ([\"bds\", \"db\", \"qq\", \"llbot\"] as const).map((n) => ({\n label: n,\n token: n,\n freeArgs: true,\n }));\n } else if (!NO_ARG_TOP.has(s.name)) {\n node.freeArgs = true;\n }\n\n out.push(node);\n }\n\n const moduleSubs = moduleChildNodes(mode);\n if (moduleSubs.length > 0) {\n out.push({\n label: \"/module\",\n token: \"module\",\n descKey: \"help.module.list\",\n children: moduleSubs,\n });\n }\n\n const packsSubs = packsChildNodes(mode);\n if (packsSubs.length > 0) {\n out.push({\n label: \"/packs\",\n token: \"packs\",\n descKey: \"help.addon\",\n children: packsSubs,\n });\n }\n\n return out;\n}\n\nexport function isDevAccent(spec: CommandSpec | undefined): boolean {\n return spec?.accent === \"dev\";\n}\n\n/** sub \u662F\u5426\u4E3A\u5F00\u53D1\u8005\u6837\u5F0F\u547D\u4EE4\uFF08\u84DD\u6807\uFF09\u3002 */\nexport function isDevAccentModuleSub(sub: string | undefined): boolean {\n return isDevAccent(findModuleSubSpec(sub));\n}\n\n/** stdin TTY \u63A2\u6D4B\uFF08\u4F9B main/repl \u5171\u7528\uFF09\u3002 */\nexport function isCliTty(): boolean {\n return Boolean(stdin.isTTY);\n}\n\n/**\n * \u547D\u4EE4\u6CE8\u518C\u8868 \u2014\u2014 \u65B0\u589E\u547D\u4EE4\u53EA\u52A0\u6B64\u5904\uFF08OCP\uFF09\u3002\n * channel:\n * - both: argv + REPL\uFF08\u9ED8\u8BA4\uFF1B\u9762\u677F\u53EA\u8C03\u5EA6\u65E2\u6709 dispatcher\uFF09\n * - repl: \u4EC5 REPL\uFF08\u5982 send / quit\uFF09\n */\nexport const COMMAND_SPECS: readonly CommandSpec[] = [\n /* \u2500\u2500\u2500 both\uFF1A\u670D\u52A1 / \u6A21\u5757 / \u8D44\u6E90\u5305 / \u914D\u7F6E \u2500\u2500\u2500 */\n { id: \"status\", name: \"status\", channel: \"both\" },\n { id: \"start\", name: \"start\", channel: \"both\" },\n { id: \"stop\", name: \"stop\", channel: \"both\" },\n { id: \"restart\", name: \"restart\", channel: \"both\" },\n { id: \"logs\", name: \"logs\", channel: \"repl\" },\n { id: \"help\", name: \"help\", channel: \"both\" },\n { id: \"version\", name: \"version\", channel: \"both\" },\n { id: \"init\", name: \"init\", channel: \"both\", needsTty: true },\n { id: \"update\", name: \"update\", channel: \"both\" },\n { id: \"locale\", name: \"locale\", channel: \"both\" },\n { id: \"remote\", name: \"remote\", channel: \"both\" },\n { id: \"debug\", name: \"debug\", channel: \"both\", accent: \"dev\" },\n\n /** \u9876\u5C42\u6241\u5E73\u77ED\u547D\u4EE4 \u2192 module.*\uFF08\u5C11\u5199\u4E00\u5C42 module\uFF09 */\n { id: \"install\", name: \"install\", channel: \"both\" },\n { id: \"uninstall\", name: \"uninstall\", channel: \"both\", aliases: [\"remove\"] },\n { id: \"search\", name: \"search\", channel: \"both\" },\n { id: \"verify\", name: \"verify\", channel: \"both\" },\n\n { id: \"module.list\", name: \"module\", sub: \"list\", channel: \"both\" },\n { id: \"module.info\", name: \"module\", sub: \"info\", channel: \"both\" },\n { id: \"module.build\", name: \"module\", sub: \"build\", channel: \"both\", accent: \"dev\" },\n { id: \"module.reload\", name: \"module\", sub: \"reload\", channel: \"both\", accent: \"dev\" },\n { id: \"module.install\", name: \"module\", sub: \"install\", channel: \"both\" },\n {\n id: \"module.uninstall\",\n name: \"module\",\n sub: \"uninstall\",\n channel: \"both\",\n aliases: [\"remove\"],\n },\n { id: \"module.search\", name: \"module\", sub: \"search\", channel: \"both\" },\n { id: \"module.verify\", name: \"module\", sub: \"verify\", channel: \"both\" },\n { id: \"module.enable\", name: \"module\", sub: \"enable\", channel: \"both\" },\n { id: \"module.disable\", name: \"module\", sub: \"disable\", channel: \"both\" },\n\n { id: \"packs.list\", name: \"packs\", sub: \"list\", channel: \"both\" },\n { id: \"packs.search\", name: \"packs\", sub: \"search\", channel: \"both\" },\n { id: \"packs.enable\", name: \"packs\", sub: \"enable\", channel: \"both\" },\n { id: \"packs.disable\", name: \"packs\", sub: \"disable\", channel: \"both\" },\n { id: \"packs.doctor\", name: \"packs\", sub: \"doctor\", channel: \"both\" },\n { id: \"packs.path\", name: \"packs\", sub: \"path\", channel: \"both\" },\n { id: \"packs.install\", name: \"packs\", sub: \"install\", channel: \"both\" },\n { id: \"packs.scan\", name: \"packs\", sub: \"scan\", channel: \"both\" },\n { id: \"packs.uninstall\", name: \"packs\", sub: \"uninstall\", channel: \"both\" },\n { id: \"packs.bind\", name: \"packs\", sub: \"bind\", channel: \"both\" },\n { id: \"packs.unbind\", name: \"packs\", sub: \"unbind\", channel: \"both\" },\n { id: \"packs.sources\", name: \"packs\", sub: \"sources\", channel: \"both\" },\n { id: \"packs.check\", name: \"packs\", sub: \"check\", channel: \"both\" },\n { id: \"packs.update\", name: \"packs\", sub: \"update\", channel: \"both\" },\n { id: \"packs.bump\", name: \"packs\", sub: \"bump\", channel: \"both\" },\n\n /* \u2500\u2500\u2500 repl-only \u2500\u2500\u2500 */\n { id: \"send\", name: \"send\", channel: \"repl\" },\n { id: \"quit\", name: \"quit\", channel: \"repl\" },\n];\n"],
|
|
5
|
+
"mappings": "AAUA,SAAS,aAAa;AA+Bf,MAAM,oBAAsD;AAAA,EACjE,KAAK;AAAA,EACL,OAAO;AAAA,EACP,KAAK;AAAA,EACL,MAAM;AAAA,EACN,GAAG;AAAA,EACH,KAAK;AAAA,EACL,MAAM;AAAA,EACN,GAAG;AAAA,EACH,GAAG;AAAA,EACH,QAAQ;AACV;AASO,MAAM,uBAAyD;AAAA,EACpE,GAAG;AAAA,EACH,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AACV;AAEO,SAAS,0BAA0B,KAA6C;AACrF,MAAI,CAAC,IAAK,QAAO;AACjB,QAAM,OAAO,oBAAoB,GAAG;AACpC,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,qBAAqB,IAAI;AAClC;AAEO,SAAS,oBAAoB,KAA6C;AAC/E,MAAI,CAAC,IAAK,QAAO;AACjB,SAAO,kBAAkB,GAAG,KAAK;AACnC;AAEA,SAAS,cAAc,SAAyB,MAA4B;AAC1E,MAAI,YAAY,OAAQ,QAAO;AAC/B,SAAO,SAAS;AAClB;AAGO,SAAS,cAAc,MAAmB,KAAkC;AACjF,MAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,GAAG;AAC1C,WAAO,EAAE,IAAI,OAAO,QAAQ,WAAW;AAAA,EACzC;AACA,MAAI,KAAK,YAAY,CAAC,IAAI,OAAO;AAC/B,WAAO,EAAE,IAA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AAAA,EAClE,EAAE,IAAI,gBAAgB,MAAM,SAAS,KAAK,UAAU,SAAS,OAAO;AAAA,EACpE,EAAE,IAAI,cAAc,MAAM,SAAS,KAAK,QAAQ,SAAS,OAAO;AAAA;AAAA,EAGhE,EAAE,IAAI,QAAQ,MAAM,QAAQ,SAAS,OAAO;AAAA,EAC5C,EAAE,IAAI,QAAQ,MAAM,QAAQ,SAAS,OAAO;AAC9C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/help-text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-text.d.ts","sourceRoot":"","sources":["../src/help-text.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkD,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"help-text.d.ts","sourceRoot":"","sources":["../src/help-text.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkD,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAqDxG,wBAAgB,OAAO,CAAC,IAAI,GAAE,WAAoB,GAAG,MAAM,CAiJ1D"}
|
package/dist/help-text.js
CHANGED
|
@@ -8,14 +8,11 @@ import { c, padRight } from "./theme.js";
|
|
|
8
8
|
const MODULE_HELP_ENTRIES = [
|
|
9
9
|
{ sub: "list", suffix: "", key: "help.module.list" },
|
|
10
10
|
{ sub: "search", suffix: " [id]", key: "help.module.search" },
|
|
11
|
-
{ sub: "install", suffix: " <id> [--from <
|
|
11
|
+
{ sub: "install", suffix: " <id> [--from <path> --link]", key: "help.module.install" },
|
|
12
12
|
{ sub: "uninstall", suffix: " <id>", key: "help.module.uninstall" },
|
|
13
13
|
{ sub: "verify", suffix: " [id]", key: "help.module.verify" },
|
|
14
14
|
{ sub: "info", suffix: " <id>", key: "help.module.info" },
|
|
15
15
|
{ sub: "enable", suffix: "|disable <id>", key: "help.module.toggle" },
|
|
16
|
-
{ sub: "create", suffix: "", key: "help.module.create" },
|
|
17
|
-
{ sub: "link", suffix: " [id]", key: "help.module.link" },
|
|
18
|
-
{ sub: "dev", suffix: "", key: "help.module.dev" },
|
|
19
16
|
{ sub: "build", suffix: "", key: "help.module.build" },
|
|
20
17
|
{ sub: "reload", suffix: " [--build-only]", key: "help.module.reload" }
|
|
21
18
|
];
|
|
@@ -69,12 +66,11 @@ ${helpLine(`${c.green("-v")}, ${c.green("--version")}`, t("help.version"))}
|
|
|
69
66
|
].filter(Boolean).join("\n");
|
|
70
67
|
const install = `
|
|
71
68
|
${c.bold(t("help.section.module"))}
|
|
72
|
-
${helpLine(`${c.green("sfmc install
|
|
73
|
-
${helpLine(`${c.green("sfmc
|
|
74
|
-
${helpLine(`${c.green("sfmc
|
|
75
|
-
${helpLine(`${c.green("sfmc
|
|
76
|
-
${helpLine(`${c.green("sfmc
|
|
77
|
-
${helpLine(`${c.green("sfmc create")}`, t("help.module.create"))}
|
|
69
|
+
${helpLine(`${c.green("sfmc mod install")} <id>`, t("help.module.install"))}
|
|
70
|
+
${helpLine(`${c.green("sfmc mod install")} <id> --from <path> --link`, t("help.module.install"))}
|
|
71
|
+
${helpLine(`${c.green("sfmc mod uninstall")} <id>`, t("help.module.uninstall"))}
|
|
72
|
+
${helpLine(`${c.green("sfmc mod search")} [id]`, t("help.module.search"))}
|
|
73
|
+
${helpLine(`${c.green("sfmc mod verify")} [id]`, t("help.module.verify"))}
|
|
78
74
|
${moduleHelpBlock("argv")}
|
|
79
75
|
`;
|
|
80
76
|
const packsLines2 = packsSubs.map((sub) => {
|
package/dist/help-text.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/help-text.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * help-text.ts \u2014 argv / REPL \u5E2E\u52A9\u6587\u6848\uFF08\u6309 command-surface \u901A\u9053\u8FC7\u6EE4\uFF09\n */\nimport {\n getVisibleModuleSubcommands,\n isDeveloperSubcommand,\n} from \"./module-commands.js\";\nimport { listVisiblePacksSubs, listVisibleTopLevelNames, type CommandMode } from \"./command-surface.js\";\nimport { t } from \"./i18n/index.js\";\nimport { c, padRight } from \"./theme.js\";\n\nconst MODULE_HELP_ENTRIES: ReadonlyArray<{ sub: string; suffix: string; key: string }> = [\n { sub: \"list\", suffix: \"\", key: \"help.module.list\" },\n { sub: \"search\", suffix: \" [id]\", key: \"help.module.search\" },\n { sub: \"install\", suffix: \" <id> [--from <source>] [--link]\", key: \"help.module.install\" },\n { sub: \"uninstall\", suffix: \" <id>\", key: \"help.module.uninstall\" },\n { sub: \"verify\", suffix: \" [id]\", key: \"help.module.verify\" },\n { sub: \"info\", suffix: \" <id>\", key: \"help.module.info\" },\n { sub: \"enable\", suffix: \"|disable <id>\", key: \"help.module.toggle\" },\n { sub: \"create\", suffix: \"\", key: \"help.module.create\" },\n { sub: \"link\", suffix: \" [id]\", key: \"help.module.link\" },\n { sub: \"dev\", suffix: \"\", key: \"help.module.dev\" },\n { sub: \"build\", suffix: \"\", key: \"help.module.build\" },\n { sub: \"reload\", suffix: \" [--build-only]\", key: \"help.module.reload\" },\n];\n\n/** \u547D\u4EE4\u5217\u76EE\u6807\u5BBD\u5EA6\uFF08\u8D85\u51FA\u5219\u8BF4\u660E\u6362\u884C\uFF09 */\nconst HELP_CMD_COL = 36;\n\nfunction hasTop(mode: CommandMode, name: string): boolean {\n return listVisibleTopLevelNames(mode).includes(name);\n}\n\n/** \u5355\u884C\u300C\u547D\u4EE4 + \u8BF4\u660E\u300D\uFF1B\u547D\u4EE4\u8FC7\u957F\u5219\u8BF4\u660E\u53E6\u8D77\u4E00\u884C */\nfunction helpLine(cmdPainted: string, desc: string, col: number = HELP_CMD_COL): string {\n const plainLen = cmdPainted.replace(/\\x1b\\[[0-9;]*m/g, \"\").length;\n if (plainLen >= col) {\n return ` ${cmdPainted}\\n ${c.dim(desc)}`;\n }\n return ` ${padRight(cmdPainted, col)}${desc}`;\n}\n\nfunction moduleHelpBlock(mode: CommandMode): string {\n const visible = new Set(getVisibleModuleSubcommands(mode));\n const entries = MODULE_HELP_ENTRIES.filter(({ sub }) => visible.has(sub));\n return entries\n .map(({ sub, suffix, key }) => {\n const paint = isDeveloperSubcommand(sub) ? c.blue : c.green;\n const plain = mode === \"argv\" ? `sfmc module ${sub}${suffix}` : `/module ${sub}${suffix}`;\n return helpLine(paint(plain), t(key as never));\n })\n .join(\"\\n\");\n}\n\nfunction p(mode: CommandMode, cmd: string, paint: (s: string) => string = c.green): string {\n return mode === \"argv\" ? paint(`sfmc ${cmd}`) : paint(`/${cmd}`);\n}\n\n/** \u5E26\u53C2\u6570\u540E\u7F00\u7684\u547D\u4EE4\u884C */\nfunction pArgs(mode: CommandMode, cmd: string, args: string, paint: (s: string) => string = c.green): string {\n return mode === \"argv\" ? paint(`sfmc ${cmd}`) + args : paint(`/${cmd}`) + args;\n}\n\nexport function getHelp(mode: CommandMode = \"argv\"): string {\n const show = (name: string) => hasTop(mode, name);\n const packsSubs = listVisiblePacksSubs(mode);\n\n if (mode === \"argv\") {\n const usage = `${c.bold(t(\"help.usage\"))}\\n ${c.green(\"sfmc\")} [options] <command> [args]\\n`;\n const options = `\n${c.bold(t(\"help.section.options\"))}\n${helpLine(`${c.green(\"-p\")}, ${c.green(\"--packs\")}`, t(\"help.opt.packs\"))}\n${helpLine(`${c.green(\"--lang\")}, ${c.green(\"--locale\")}`, t(\"help.opt.lang\"))}\n${helpLine(`${c.green(\"-h\")}, ${c.green(\"--help\")}`, t(\"help.help\"))}\n${helpLine(`${c.green(\"-v\")}, ${c.green(\"--version\")}`, t(\"help.version\"))}\n`;\n const service = [\n show(\"status\") ? helpLine(p(mode, \"status\"), t(\"help.status\")) : \"\",\n show(\"logs\") ? helpLine(p(mode, \"logs\"), t(\"help.logs\")) : \"\",\n show(\"start\") ? helpLine(pArgs(mode, \"start\", \" <svc>|-all\"), t(\"help.start\")) : \"\",\n show(\"stop\") ? helpLine(pArgs(mode, \"stop\", \" <svc>|-all\"), t(\"help.stop\")) : \"\",\n show(\"restart\") ? helpLine(pArgs(mode, \"restart\", \" <svc>|-all\"), t(\"help.restart\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n const install = `\n${c.bold(t(\"help.section.module\"))}\n${helpLine(`${c.green(\"sfmc install|i\")} <id> [\u2026]`, t(\"help.module.install\"))}\n${helpLine(`${c.green(\"sfmc uninstall|remove\")} <id>`, t(\"help.module.uninstall\"))}\n${helpLine(`${c.green(\"sfmc search\")} [id]`, t(\"help.module.search\"))}\n${helpLine(`${c.green(\"sfmc verify\")} [id]`, t(\"help.module.verify\"))}\n${helpLine(`${c.green(\"sfmc link\")} [id]`, t(\"help.module.link\"))}\n${helpLine(`${c.green(\"sfmc create\")}`, t(\"help.module.create\"))}\n${moduleHelpBlock(\"argv\")}\n`;\n\n const packsLines = packsSubs\n .map((sub) => {\n const short = sub === \"install\" ? \"i|install\" : sub;\n return helpLine(c.green(`sfmc packs ${short}`), \"\");\n })\n .join(\"\\n\");\n const addon =\n packsSubs.length > 0\n ? `\n${c.bold(t(\"help.section.addon\"))}\n${packsLines}\n${helpLine(c.dim(\"sfmc -p <sub> \u2026\"), t(\"help.addon.compat\"))}\n`\n : \"\";\n\n const update = show(\"update\")\n ? `\n${c.bold(t(\"help.section.update\"))}\n${helpLine(`${p(mode, \"update\")} [--check-only] [--channel=\u2026]`, t(\"help.update\"))}\n`\n : \"\";\n const remote = show(\"remote\")\n ? `\n${c.bold(t(\"help.section.remote\"))} ${c.dim(\"[beta]\")}\n${helpLine(`${p(mode, \"remote\")} status|enroll|disable`, \"\")}\n`\n : \"\";\n const debug = show(\"debug\")\n ? `\n${c.bold(t(\"help.section.debug\"))}\n${helpLine(`${c.blue(\"sfmc debug\")} status|enable|disable|sentry \u2026`, \"\")}\n`\n : \"\";\n const general = [\n show(\"init\") ? helpLine(p(mode, \"init\"), t(\"help.init\")) : \"\",\n show(\"locale\") ? helpLine(pArgs(mode, \"locale\", \" [zh|en]\"), t(\"help.locale\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n return `\n${c.bold(\"\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\")}\n${c.bold(\"\u2502\")} ${c.green(t(\"help.title\"))}${\" \".repeat(Math.max(1, 56 - t(\"help.title\").length))}${c.bold(\"\u2502\")}\n${c.bold(\"\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\")}\n\n${usage}${options}\n${c.bold(t(\"help.section.service\"))}\n${service}\n${update}${remote}${debug}${install}${addon}\n${c.bold(t(\"help.section.general\"))}\n${general}\n`;\n }\n\n const service = [\n show(\"status\") ? helpLine(p(mode, \"status\"), t(\"help.status\")) : \"\",\n show(\"logs\") ? helpLine(p(mode, \"logs\"), t(\"help.logs\")) : \"\",\n show(\"start\") ? helpLine(pArgs(mode, \"start\", \" <svc>|-all\"), t(\"help.start\")) : \"\",\n show(\"stop\") ? helpLine(pArgs(mode, \"stop\", \" <svc>|-all\"), t(\"help.stop\")) : \"\",\n show(\"restart\") ? helpLine(pArgs(mode, \"restart\", \" <svc>|-all\"), t(\"help.restart\")) : \"\",\n show(\"send\") ? helpLine(pArgs(mode, \"send\", \" <svc> <msg>\"), t(\"help.send\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n const moduleSec = `\n${c.bold(t(\"help.section.module\"))}\n${moduleHelpBlock(\"repl\")}\n`;\n\n const packsLines = packsSubs.map((sub) => helpLine(c.green(`/packs ${sub}`), \"\")).join(\"\\n\");\n const addon =\n packsSubs.length > 0\n ? `\n${c.bold(t(\"help.section.addon\"))}\n${packsLines}\n`\n : \"\";\n\n const general = [\n show(\"version\") ? helpLine(p(mode, \"version\"), t(\"help.version\")) : \"\",\n show(\"help\") ? helpLine(p(mode, \"help\"), t(\"help.help\")) : \"\",\n show(\"quit\") ? helpLine(p(mode, \"quit\"), t(\"help.quit\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n const shortcuts = `\n${c.dim(\"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\")}\n${c.dim(t(\"help.shortcuts\"))}\n${helpLine(c.dim(\"/\"), t(\"help.shortcut.slash\"), 12)}\n${helpLine(c.dim(\"Ctrl+P\"), t(\"help.shortcut.ctrlp\"), 12)}\n${helpLine(c.dim(\"Tab\"), t(\"help.shortcut.tab\"), 12)}\n${helpLine(c.dim(\"\u2190\u2192\"), t(\"help.shortcut.cursor\"), 12)}\n${helpLine(c.dim(\"\u2192\"), t(\"help.shortcut.right\"), 12)}\n${helpLine(c.dim(\"Ctrl+L\"), t(\"help.shortcut.ctrll\"), 12)}\n${helpLine(c.dim(\"\u2191\u2193\"), t(\"help.shortcut.history\"), 12)}\n`;\n\n return `\n${c.bold(\"\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\")}\n${c.bold(\"\u2502\")} ${c.green(t(\"help.title.repl\"))}${\" \".repeat(Math.max(1, 56 - t(\"help.title.repl\").length))}${c.bold(\"\u2502\")}\n${c.bold(\"\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\")}\n\n${c.dim(t(\"help.slash.hint\"))}\n\n${c.bold(t(\"help.section.service\"))}\n${service}\n${moduleSec}${addon}\n${c.bold(t(\"help.section.general\"))}\n${general}\n${shortcuts}`;\n}\n"],
|
|
5
|
-
"mappings": "AAGA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB,gCAAkD;AACjF,SAAS,SAAS;AAClB,SAAS,GAAG,gBAAgB;AAE5B,MAAM,sBAAmF;AAAA,EACvF,EAAE,KAAK,QAAQ,QAAQ,IAAI,KAAK,mBAAmB;AAAA,EACnD,EAAE,KAAK,UAAU,QAAQ,SAAS,KAAK,qBAAqB;AAAA,EAC5D,EAAE,KAAK,WAAW,QAAQ,
|
|
4
|
+
"sourcesContent": ["/**\n * help-text.ts \u2014 argv / REPL \u5E2E\u52A9\u6587\u6848\uFF08\u6309 command-surface \u901A\u9053\u8FC7\u6EE4\uFF09\n */\nimport {\n getVisibleModuleSubcommands,\n isDeveloperSubcommand,\n} from \"./module-commands.js\";\nimport { listVisiblePacksSubs, listVisibleTopLevelNames, type CommandMode } from \"./command-surface.js\";\nimport { t } from \"./i18n/index.js\";\nimport { c, padRight } from \"./theme.js\";\n\nconst MODULE_HELP_ENTRIES: ReadonlyArray<{ sub: string; suffix: string; key: string }> = [\n { sub: \"list\", suffix: \"\", key: \"help.module.list\" },\n { sub: \"search\", suffix: \" [id]\", key: \"help.module.search\" },\n { sub: \"install\", suffix: \" <id> [--from <path> --link]\", key: \"help.module.install\" },\n { sub: \"uninstall\", suffix: \" <id>\", key: \"help.module.uninstall\" },\n { sub: \"verify\", suffix: \" [id]\", key: \"help.module.verify\" },\n { sub: \"info\", suffix: \" <id>\", key: \"help.module.info\" },\n { sub: \"enable\", suffix: \"|disable <id>\", key: \"help.module.toggle\" },\n { sub: \"build\", suffix: \"\", key: \"help.module.build\" },\n { sub: \"reload\", suffix: \" [--build-only]\", key: \"help.module.reload\" },\n];\n\n/** \u547D\u4EE4\u5217\u76EE\u6807\u5BBD\u5EA6\uFF08\u8D85\u51FA\u5219\u8BF4\u660E\u6362\u884C\uFF09 */\nconst HELP_CMD_COL = 36;\n\nfunction hasTop(mode: CommandMode, name: string): boolean {\n return listVisibleTopLevelNames(mode).includes(name);\n}\n\n/** \u5355\u884C\u300C\u547D\u4EE4 + \u8BF4\u660E\u300D\uFF1B\u547D\u4EE4\u8FC7\u957F\u5219\u8BF4\u660E\u53E6\u8D77\u4E00\u884C */\nfunction helpLine(cmdPainted: string, desc: string, col: number = HELP_CMD_COL): string {\n const plainLen = cmdPainted.replace(/\\x1b\\[[0-9;]*m/g, \"\").length;\n if (plainLen >= col) {\n return ` ${cmdPainted}\\n ${c.dim(desc)}`;\n }\n return ` ${padRight(cmdPainted, col)}${desc}`;\n}\n\nfunction moduleHelpBlock(mode: CommandMode): string {\n const visible = new Set(getVisibleModuleSubcommands(mode));\n const entries = MODULE_HELP_ENTRIES.filter(({ sub }) => visible.has(sub));\n return entries\n .map(({ sub, suffix, key }) => {\n const paint = isDeveloperSubcommand(sub) ? c.blue : c.green;\n const plain = mode === \"argv\" ? `sfmc module ${sub}${suffix}` : `/module ${sub}${suffix}`;\n return helpLine(paint(plain), t(key as never));\n })\n .join(\"\\n\");\n}\n\nfunction p(mode: CommandMode, cmd: string, paint: (s: string) => string = c.green): string {\n return mode === \"argv\" ? paint(`sfmc ${cmd}`) : paint(`/${cmd}`);\n}\n\n/** \u5E26\u53C2\u6570\u540E\u7F00\u7684\u547D\u4EE4\u884C */\nfunction pArgs(mode: CommandMode, cmd: string, args: string, paint: (s: string) => string = c.green): string {\n return mode === \"argv\" ? paint(`sfmc ${cmd}`) + args : paint(`/${cmd}`) + args;\n}\n\nexport function getHelp(mode: CommandMode = \"argv\"): string {\n const show = (name: string) => hasTop(mode, name);\n const packsSubs = listVisiblePacksSubs(mode);\n\n if (mode === \"argv\") {\n const usage = `${c.bold(t(\"help.usage\"))}\\n ${c.green(\"sfmc\")} [options] <command> [args]\\n`;\n const options = `\n${c.bold(t(\"help.section.options\"))}\n${helpLine(`${c.green(\"-p\")}, ${c.green(\"--packs\")}`, t(\"help.opt.packs\"))}\n${helpLine(`${c.green(\"--lang\")}, ${c.green(\"--locale\")}`, t(\"help.opt.lang\"))}\n${helpLine(`${c.green(\"-h\")}, ${c.green(\"--help\")}`, t(\"help.help\"))}\n${helpLine(`${c.green(\"-v\")}, ${c.green(\"--version\")}`, t(\"help.version\"))}\n`;\n const service = [\n show(\"status\") ? helpLine(p(mode, \"status\"), t(\"help.status\")) : \"\",\n show(\"logs\") ? helpLine(p(mode, \"logs\"), t(\"help.logs\")) : \"\",\n show(\"start\") ? helpLine(pArgs(mode, \"start\", \" <svc>|-all\"), t(\"help.start\")) : \"\",\n show(\"stop\") ? helpLine(pArgs(mode, \"stop\", \" <svc>|-all\"), t(\"help.stop\")) : \"\",\n show(\"restart\") ? helpLine(pArgs(mode, \"restart\", \" <svc>|-all\"), t(\"help.restart\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n const install = `\n${c.bold(t(\"help.section.module\"))}\n${helpLine(`${c.green(\"sfmc mod install\")} <id>`, t(\"help.module.install\"))}\n${helpLine(`${c.green(\"sfmc mod install\")} <id> --from <path> --link`, t(\"help.module.install\"))}\n${helpLine(`${c.green(\"sfmc mod uninstall\")} <id>`, t(\"help.module.uninstall\"))}\n${helpLine(`${c.green(\"sfmc mod search\")} [id]`, t(\"help.module.search\"))}\n${helpLine(`${c.green(\"sfmc mod verify\")} [id]`, t(\"help.module.verify\"))}\n${moduleHelpBlock(\"argv\")}\n`;\n\n const packsLines = packsSubs\n .map((sub) => {\n const short = sub === \"install\" ? \"i|install\" : sub;\n return helpLine(c.green(`sfmc packs ${short}`), \"\");\n })\n .join(\"\\n\");\n const addon =\n packsSubs.length > 0\n ? `\n${c.bold(t(\"help.section.addon\"))}\n${packsLines}\n${helpLine(c.dim(\"sfmc -p <sub> \u2026\"), t(\"help.addon.compat\"))}\n`\n : \"\";\n\n const update = show(\"update\")\n ? `\n${c.bold(t(\"help.section.update\"))}\n${helpLine(`${p(mode, \"update\")} [--check-only] [--channel=\u2026]`, t(\"help.update\"))}\n`\n : \"\";\n const remote = show(\"remote\")\n ? `\n${c.bold(t(\"help.section.remote\"))} ${c.dim(\"[beta]\")}\n${helpLine(`${p(mode, \"remote\")} status|enroll|disable`, \"\")}\n`\n : \"\";\n const debug = show(\"debug\")\n ? `\n${c.bold(t(\"help.section.debug\"))}\n${helpLine(`${c.blue(\"sfmc debug\")} status|enable|disable|sentry \u2026`, \"\")}\n`\n : \"\";\n const general = [\n show(\"init\") ? helpLine(p(mode, \"init\"), t(\"help.init\")) : \"\",\n show(\"locale\") ? helpLine(pArgs(mode, \"locale\", \" [zh|en]\"), t(\"help.locale\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n return `\n${c.bold(\"\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\")}\n${c.bold(\"\u2502\")} ${c.green(t(\"help.title\"))}${\" \".repeat(Math.max(1, 56 - t(\"help.title\").length))}${c.bold(\"\u2502\")}\n${c.bold(\"\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\")}\n\n${usage}${options}\n${c.bold(t(\"help.section.service\"))}\n${service}\n${update}${remote}${debug}${install}${addon}\n${c.bold(t(\"help.section.general\"))}\n${general}\n`;\n }\n\n const service = [\n show(\"status\") ? helpLine(p(mode, \"status\"), t(\"help.status\")) : \"\",\n show(\"logs\") ? helpLine(p(mode, \"logs\"), t(\"help.logs\")) : \"\",\n show(\"start\") ? helpLine(pArgs(mode, \"start\", \" <svc>|-all\"), t(\"help.start\")) : \"\",\n show(\"stop\") ? helpLine(pArgs(mode, \"stop\", \" <svc>|-all\"), t(\"help.stop\")) : \"\",\n show(\"restart\") ? helpLine(pArgs(mode, \"restart\", \" <svc>|-all\"), t(\"help.restart\")) : \"\",\n show(\"send\") ? helpLine(pArgs(mode, \"send\", \" <svc> <msg>\"), t(\"help.send\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n const moduleSec = `\n${c.bold(t(\"help.section.module\"))}\n${moduleHelpBlock(\"repl\")}\n`;\n\n const packsLines = packsSubs.map((sub) => helpLine(c.green(`/packs ${sub}`), \"\")).join(\"\\n\");\n const addon =\n packsSubs.length > 0\n ? `\n${c.bold(t(\"help.section.addon\"))}\n${packsLines}\n`\n : \"\";\n\n const general = [\n show(\"version\") ? helpLine(p(mode, \"version\"), t(\"help.version\")) : \"\",\n show(\"help\") ? helpLine(p(mode, \"help\"), t(\"help.help\")) : \"\",\n show(\"quit\") ? helpLine(p(mode, \"quit\"), t(\"help.quit\")) : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n const shortcuts = `\n${c.dim(\"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\")}\n${c.dim(t(\"help.shortcuts\"))}\n${helpLine(c.dim(\"/\"), t(\"help.shortcut.slash\"), 12)}\n${helpLine(c.dim(\"Ctrl+P\"), t(\"help.shortcut.ctrlp\"), 12)}\n${helpLine(c.dim(\"Tab\"), t(\"help.shortcut.tab\"), 12)}\n${helpLine(c.dim(\"\u2190\u2192\"), t(\"help.shortcut.cursor\"), 12)}\n${helpLine(c.dim(\"\u2192\"), t(\"help.shortcut.right\"), 12)}\n${helpLine(c.dim(\"Ctrl+L\"), t(\"help.shortcut.ctrll\"), 12)}\n${helpLine(c.dim(\"\u2191\u2193\"), t(\"help.shortcut.history\"), 12)}\n`;\n\n return `\n${c.bold(\"\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\")}\n${c.bold(\"\u2502\")} ${c.green(t(\"help.title.repl\"))}${\" \".repeat(Math.max(1, 56 - t(\"help.title.repl\").length))}${c.bold(\"\u2502\")}\n${c.bold(\"\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\")}\n\n${c.dim(t(\"help.slash.hint\"))}\n\n${c.bold(t(\"help.section.service\"))}\n${service}\n${moduleSec}${addon}\n${c.bold(t(\"help.section.general\"))}\n${general}\n${shortcuts}`;\n}\n"],
|
|
5
|
+
"mappings": "AAGA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB,gCAAkD;AACjF,SAAS,SAAS;AAClB,SAAS,GAAG,gBAAgB;AAE5B,MAAM,sBAAmF;AAAA,EACvF,EAAE,KAAK,QAAQ,QAAQ,IAAI,KAAK,mBAAmB;AAAA,EACnD,EAAE,KAAK,UAAU,QAAQ,SAAS,KAAK,qBAAqB;AAAA,EAC5D,EAAE,KAAK,WAAW,QAAQ,gCAAgC,KAAK,sBAAsB;AAAA,EACrF,EAAE,KAAK,aAAa,QAAQ,SAAS,KAAK,wBAAwB;AAAA,EAClE,EAAE,KAAK,UAAU,QAAQ,SAAS,KAAK,qBAAqB;AAAA,EAC5D,EAAE,KAAK,QAAQ,QAAQ,SAAS,KAAK,mBAAmB;AAAA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