Refine skill routing and silent CLI compatibility
This commit is contained in:
1 parent
9094f4907a
commit
61fa63bbe1
11 files changed
+460
-774
No files matched your search
@@ -826,7 +826,7 @@ describe("Hose OpenAPI key extraction from assistance link", () => {
|
||||
expect(readDirectory(enterprises)).toEqual([]);
|
||||
});
|
||||
|
||||
test("corps add-link keeps --as-hose as a deprecated compatibility alias", async () => {
|
||||
test("corps add-link keeps the legacy Hose elevation flag silent", async () => {
|
||||
const enterprises = setupConfigEnv();
|
||||
mockHoseKeysRequests();
|
||||
|
||||
@@ -834,7 +834,7 @@ describe("Hose OpenAPI key extraction from assistance link", () => {
|
||||
|
||||
expect(result.isError).toBe(false);
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(result.stderr).toContain("'--as-hose' is deprecated");
|
||||
expect(result.stderr).not.toContain("deprecated");
|
||||
expect(existsSync(join(enterprises, "acme-01.json"))).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -80,9 +80,6 @@ export async function handleCorpOnboarding(
|
||||
}
|
||||
|
||||
if (action === "add-hose-persistent" || action === "add-hose") {
|
||||
if (action === "add-hose") {
|
||||
console.error("⚠️ Notice: 'add-hose' is a compatibility alias; use 'add-hose-persistent' for durable Hose credentials.");
|
||||
}
|
||||
const jsonPayload = jsonObject(args.json);
|
||||
const merged = {
|
||||
...jsonPayload,
|
||||
@@ -167,9 +164,6 @@ export async function handleCorpOnboarding(
|
||||
}
|
||||
|
||||
if (action === "add-seal-bearer" || action === "add-seal") {
|
||||
if (action === "add-seal") {
|
||||
console.error("⚠️ Notice: 'add-seal' is a compatibility alias; use 'add-seal-bearer' for Seal Bearer credentials.");
|
||||
}
|
||||
const jsonPayload = jsonObject(args.json);
|
||||
const merged = {
|
||||
...jsonPayload,
|
||||
@@ -192,9 +186,6 @@ export async function handleCorpOnboarding(
|
||||
const dryRun = booleanOption(args.options["dry-run"]) === true || booleanOption(args.options.dryRun) === true;
|
||||
const legacyAsHose = booleanOption(args.options["as-hose"]) === true || booleanOption(args.options.hose) === true;
|
||||
const elevateHose = booleanOption(args.options["elevate-hose"]) === true || legacyAsHose;
|
||||
if (legacyAsHose && !booleanOption(args.options["elevate-hose"])) {
|
||||
console.error("⚠️ Notice: '--as-hose' is deprecated; use '--elevate-hose' to request Hose credential elevation.");
|
||||
}
|
||||
if (elevateHose) {
|
||||
const winner = scoreAssistLink(link)[0];
|
||||
if (winner?.kind === "seal-delegate") {
|
||||
|
||||
@@ -106,16 +106,16 @@ describe("renderHelp", () => {
|
||||
expect(help).not.toContain("seal-use webhook");
|
||||
});
|
||||
|
||||
test("documents the add-hose compatibility alias", () => {
|
||||
test("documents the canonical Hose onboarding command", () => {
|
||||
const help = renderHelp(["corps", "add-hose-persistent"]);
|
||||
expect(help).toContain("seal-use corps add-hose-persistent");
|
||||
expect(help).toContain("旧命令 add-hose 仍可用");
|
||||
expect(help).not.toContain("add-hose 仍可用");
|
||||
});
|
||||
|
||||
test("documents the add-seal compatibility alias", () => {
|
||||
test("documents the canonical Seal onboarding command", () => {
|
||||
const help = renderHelp(["corps", "add-seal-bearer"]);
|
||||
expect(help).toContain("seal-use corps add-seal-bearer");
|
||||
expect(help).toContain("旧命令 add-seal 仍可用");
|
||||
expect(help).not.toContain("add-seal 仍可用");
|
||||
});
|
||||
|
||||
test("throws usage error for unknown area or subcommand", () => {
|
||||
|
||||
+3
-5
@@ -158,19 +158,17 @@ export const HELP_REGISTRY: AreaHelp[] = [
|
||||
},
|
||||
{
|
||||
name: "add-hose-persistent",
|
||||
aliases: ["add-hose"],
|
||||
group: "企业接入",
|
||||
summary: "Add a durable Hose/Ekuaibao enterprise configuration",
|
||||
usage: ["seal-use corps add-hose-persistent --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'"],
|
||||
description: "使用长期 Hose OpenAPI 凭据接入企业并持久化配置;旧命令 add-hose 仍可用,但仅作为兼容别名。"
|
||||
description: "使用长期 Hose OpenAPI 凭据接入企业并持久化配置。"
|
||||
},
|
||||
{
|
||||
name: "add-seal-bearer",
|
||||
aliases: ["add-seal"],
|
||||
group: "企业接入",
|
||||
summary: "Add a native Seal enterprise from a Bearer session",
|
||||
usage: ["seal-use corps add-seal-bearer --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'"],
|
||||
description: "使用 Seal Bearer Token 接入原生 Seal 企业;旧命令 add-seal 仍可用,但仅作为兼容别名。"
|
||||
description: "使用 Seal Bearer Token 接入原生 Seal 企业。"
|
||||
},
|
||||
{
|
||||
name: "add-hose-web-session",
|
||||
@@ -198,7 +196,7 @@ export const HELP_REGISTRY: AreaHelp[] = [
|
||||
options: [
|
||||
{ flag: "--name <name>", description: "Optional custom name for the enterprise" },
|
||||
{ flag: "--dry-run", description: "Preview link resolution and tenant metadata without saving" },
|
||||
{ flag: "--elevate-hose", description: "【明确提权】从合思协助链接提取 OpenAPI 密钥并将临时会话升级为长期标准配置(旧别名:--as-hose)" },
|
||||
{ flag: "--elevate-hose", description: "【明确提权】从合思协助链接提取 OpenAPI 密钥并将临时会话升级为长期标准配置" },
|
||||
{ flag: "--app-key <key>", description: "企业存在多套密钥时,指定使用的 appKey" },
|
||||
{ flag: "--key-id <id>", description: "企业存在多套密钥时,指定使用的 keyId" },
|
||||
{ flag: "--overwrite", description: "Overwrite existing enterprise config" }
|
||||
|
||||
Reference in new issue
Block a user