feat: rebrand seal-home to seal-use with self-healing upgrade and backward compatibility (v0.10.0) (#15)

This commit is contained in:
gitea committed 2026-09-02 15:42:25 +08:00
1 parent 69d2bc0147
commit 068637c667
74 files changed
+1568 -1359

No files matched your search

+7 -7
View File
@@ -34,7 +34,7 @@ export async function handleApprovalRunsCommand(
);
if ((result as any)?.matched === 0 && (result as any)?.total > 0) {
console.error(
`提示:在 ${(result as any).date} 未匹配到记录(该企业共有 ${(result as any).total} 条历史记录)。可使用 --date YYYY-MM-DD 指定日期,或运行 seal-home approval-runs list --limit 10 查看最近记录。`
`提示:在 ${(result as any).date} 未匹配到记录(该企业共有 ${(result as any).total} 条历史记录)。可使用 --date YYYY-MM-DD 指定日期,或运行 seal-use approval-runs list --limit 10 查看最近记录。`
);
}
printJson(result, outputOptions(args.options));
@@ -117,7 +117,7 @@ export async function handleApprovalRunsCommand(
if (action === "pick") {
const query = maybeName ?? stringOption(args.options.query) ?? stringOption(args.options.sn);
if (!query) throw new Error("Usage: seal-home approval-runs pick --sn <documentSN>");
if (!query) throw new Error("Usage: seal-use approval-runs pick --sn <documentSN>");
await runTool(
"seal_approval_run_pick",
client,
@@ -155,21 +155,21 @@ export async function handleApprovalRunsCommand(
if (action === "cited-rules") {
const recordId = args.command[2];
if (!recordId) throw new Error("Usage: seal-home approval-runs cited-rules <recordId>");
if (!recordId) throw new Error("Usage: seal-use approval-runs cited-rules <recordId>");
await runTool("seal_approval_run_cited_rules_get", client, corp, { recordId }, outputOptions(args.options));
return;
}
if (action === "document-summary") {
const recordId = args.command[2];
if (!recordId) throw new Error("Usage: seal-home approval-runs document-summary <recordId>");
if (!recordId) throw new Error("Usage: seal-use approval-runs document-summary <recordId>");
await runTool("seal_approval_run_document_summary_get", client, corp, { recordId }, outputOptions(args.options));
return;
}
if (action === "attachments") {
const recordId = args.command[2];
if (!recordId) throw new Error("Usage: seal-home approval-runs attachments <recordId>");
if (!recordId) throw new Error("Usage: seal-use approval-runs attachments <recordId>");
await runTool(
"seal_approval_run_attachments_get",
client,
@@ -185,7 +185,7 @@ export async function handleApprovalRunsCommand(
if (action === "result") {
const recordId = args.command[2];
if (!recordId) throw new Error("Usage: seal-home approval-runs result <recordId> [--summary]");
if (!recordId) throw new Error("Usage: seal-use approval-runs result <recordId> [--summary]");
await runTool(
"seal_approval_run_result_get",
client,
@@ -214,5 +214,5 @@ export async function handleApprovalRunsCommand(
return;
}
throw new Error(`Unknown approval-runs command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown approval-runs command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+1 -1
View File
@@ -19,7 +19,7 @@ export async function handleAuthCommand(action: string | undefined, corp: CorpCo
return;
}
throw new Error(`Unknown auth command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown auth command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
export async function diagnoseAuth(corp: CorpConfig) {
+1 -1
View File
@@ -25,5 +25,5 @@ export async function handleBillingCommand(
return;
}
throw new Error(`Unknown billing command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown billing command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+1 -1
View File
@@ -52,5 +52,5 @@ export function handleConfigCommand(action: string | undefined, maybeName: strin
return;
}
throw new Error(`Unknown config command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown config command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+10 -10
View File
@@ -5,17 +5,17 @@ import { join } from "node:path";
import { runCli } from "../runner.js";
const ORIGINAL_ENV = {
enterprises: process.env.SEAL_HOME_ENTERPRISES_DIR,
config: process.env.SEAL_HOME_CONFIG_FILE,
tokenStore: process.env.SEAL_HOME_TOKEN_STORE
enterprises: process.env.SEAL_USE_ENTERPRISES_DIR,
config: process.env.SEAL_USE_CONFIG_FILE,
tokenStore: process.env.SEAL_USE_TOKEN_STORE
};
const ORIGINAL_FETCH = globalThis.fetch;
const tempDirs: string[] = [];
afterEach(() => {
restoreEnv("SEAL_HOME_ENTERPRISES_DIR", ORIGINAL_ENV.enterprises);
restoreEnv("SEAL_HOME_CONFIG_FILE", ORIGINAL_ENV.config);
restoreEnv("SEAL_HOME_TOKEN_STORE", ORIGINAL_ENV.tokenStore);
restoreEnv("SEAL_USE_ENTERPRISES_DIR", ORIGINAL_ENV.enterprises);
restoreEnv("SEAL_USE_CONFIG_FILE", ORIGINAL_ENV.config);
restoreEnv("SEAL_USE_TOKEN_STORE", ORIGINAL_ENV.tokenStore);
globalThis.fetch = ORIGINAL_FETCH;
for (const dir of tempDirs.splice(0)) {
@@ -109,12 +109,12 @@ describe("corps link onboarding", () => {
});
function setupConfigEnv() {
const root = mkdtempSync(join(tmpdir(), "seal-home-link-cli-"));
const root = mkdtempSync(join(tmpdir(), "seal-use-link-cli-"));
const enterprises = join(root, "enterprises");
tempDirs.push(root);
process.env.SEAL_HOME_ENTERPRISES_DIR = enterprises;
process.env.SEAL_HOME_CONFIG_FILE = join(root, "config.json");
process.env.SEAL_HOME_TOKEN_STORE = join(root, "tokens.json");
process.env.SEAL_USE_ENTERPRISES_DIR = enterprises;
process.env.SEAL_USE_CONFIG_FILE = join(root, "config.json");
process.env.SEAL_USE_TOKEN_STORE = join(root, "tokens.json");
return enterprises;
}
+8 -8
View File
@@ -45,7 +45,7 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
: undefined
);
if (corps.length === 0) {
console.error("提示:当前未检测到企业配置。你可以使用 seal-home corps add-hose 或 seal-home corps add-seal 添加企业,或运行 seal-home help 查看说明。");
console.error("提示:当前未检测到企业配置。你可以使用 seal-use corps add-hose 或 seal-use corps add-seal 添加企业,或运行 seal-use help 查看说明。");
}
printJson(corps.map((item) => ({
id: item.id,
@@ -70,12 +70,12 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
if (action === "switch") {
const corpId = maybeName;
if (!corpId) throw new Error("Usage: seal-home corps switch <corpId>");
if (!corpId) throw new Error("Usage: seal-use corps switch <corpId>");
const globalConfig = loadGlobalConfig();
if (!globalConfig.stateful) {
throw new Error(
"Cannot switch the default enterprise while stateless mode is enabled. " +
"Use `seal-home config mode stateful` first."
"Use `seal-use config mode stateful` first."
);
}
const corp = selectCorp(corpId);
@@ -112,14 +112,14 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
const link = maybeName ?? stringOption(args.options.link) ?? stringOption(args.options.url);
if (!link) {
throw new Error(
"Usage: seal-home corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]"
"Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]"
);
}
await addLinkCorp(link, stringOption(args.options.name), booleanOption(args.options.overwrite) === true);
return;
}
throw new Error(`Unknown corps command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown corps command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
async function probeHoseCorp(input: Record<string, unknown>) {
@@ -203,7 +203,7 @@ async function queryHoseStaffs(input: Record<string, unknown>) {
if (!targetRoleDefId) {
throw new Error(
`Role not found matching query: '${roleQuery}'. Run 'seal-home corps probe-hose' to view all available roles.`
`Role not found matching query: '${roleQuery}'. Run 'seal-use corps probe-hose' to view all available roles.`
);
}
@@ -292,7 +292,7 @@ async function addHoseCorp(input: Record<string, unknown>) {
);
} else {
throw new Error(
`No staff member found matching '${staffName ?? staffPhone}' under role ${targetRoleId}. Run 'seal-home corps hose-staffs' to view candidates.`
`No staff member found matching '${staffName ?? staffPhone}' under role ${targetRoleId}. Run 'seal-use corps hose-staffs' to view candidates.`
);
}
} else if (!force) {
@@ -312,7 +312,7 @@ async function addHoseCorp(input: Record<string, unknown>) {
finalStaffId = explicitStaffId;
} else {
throw new Error(
"Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-home corps hose-staffs' to discover available administrators."
"Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators."
);
}
}
+2 -2
View File
@@ -53,10 +53,10 @@ export async function handleDelegationCommand(
if (action === "revoke") {
const tokenId = maybeName ?? stringOption(args.options.tokenId);
if (!tokenId) throw new Error("Usage: seal-home delegation revoke <tokenId>");
if (!tokenId) throw new Error("Usage: seal-use delegation revoke <tokenId>");
await runTool("seal_delegation_revoke", client, corp, { tokenId }, outputOptions(args.options));
return;
}
throw new Error(`Unknown delegation command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown delegation command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+3 -3
View File
@@ -34,7 +34,7 @@ export async function handleDeployCommand(
if (action === "get") {
const signKey = target ?? stringOption(args.options.signKey) ?? stringOption(args.options["sign-key"]);
if (!signKey) throw new Error("Usage: seal-home deploy hosecloud get <sign-key>");
if (!signKey) throw new Error("Usage: seal-use deploy hosecloud get <sign-key>");
await runTool("seal_deploy_hosecloud_get", client, corp, { signKey }, outputOptions(args.options));
return;
}
@@ -50,7 +50,7 @@ export async function handleDeployCommand(
? JSON.parse(readFileSync(rawInput, "utf8"))
: jsonObject(args.json);
if (!payload || Object.keys(payload).length === 0) {
throw new Error("Usage: seal-home deploy hosecloud configure --json '{...}' or --input <file>");
throw new Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");
}
await runTool("seal_deploy_hosecloud_configure", client, corp, payload, outputOptions(args.options));
return;
@@ -58,7 +58,7 @@ export async function handleDeployCommand(
if (action === "sync") {
const signKey = target ?? stringOption(args.options.signKey) ?? stringOption(args.options["sign-key"]);
if (!signKey) throw new Error("Usage: seal-home deploy hosecloud sync <sign-key>");
if (!signKey) throw new Error("Usage: seal-use deploy hosecloud sync <sign-key>");
await runTool("seal_deploy_hosecloud_sync", client, corp, { signKey }, outputOptions(args.options));
return;
}
+1 -1
View File
@@ -20,5 +20,5 @@ export async function handleLlmCommand(
return;
}
throw new Error(`Unknown llm command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown llm command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+3 -3
View File
@@ -14,12 +14,12 @@ export async function handleMcpCommand(action: string | undefined, args: ParsedA
export function printMcpConfig() {
printJson({
mcpServers: {
"seal-home": {
"seal-use": {
type: "stdio",
command: "seal-home",
command: "seal-use",
args: ["mcp"],
env: {
SEAL_HOME_MCP_ENABLED: "true"
SEAL_USE_MCP_ENABLED: "true"
}
}
}
+1 -1
View File
@@ -20,5 +20,5 @@ export async function handlePermissionsCommand(
return;
}
throw new Error(`Unknown permissions command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown permissions command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+4 -4
View File
@@ -27,7 +27,7 @@ export async function handlePreferenceCommand(
? JSON.parse(readFileSync(rawInput, "utf8"))
: jsonObject(args.json);
if (!payload || Object.keys(payload).length === 0) {
throw new Error("Usage: seal-home preference decision update --json '{\"explicitApprove\":\"...\"}'");
throw new Error("Usage: seal-use preference decision update --json '{\"explicitApprove\":\"...\"}'");
}
await runTool("seal_preference_decision_update", client, corp, payload, outputOptions(args.options));
return;
@@ -41,7 +41,7 @@ export async function handlePreferenceCommand(
stringOption(args.options.level) ??
maybeTarget;
if (defaultLevel !== "medium" && defaultLevel !== "high") {
throw new Error("Usage: seal-home preference thinking-depth set --default <medium|high>");
throw new Error("Usage: seal-use preference thinking-depth set --default <medium|high>");
}
await runTool("seal_preference_thinking_depth_set", client, corp, { defaultLevel }, outputOptions(args.options));
return;
@@ -59,7 +59,7 @@ export async function handlePreferenceCommand(
? JSON.parse(readFileSync(rawInput, "utf8"))
: jsonObject(args.json);
if (!payload || !payload.id || !payload.name) {
throw new Error("Usage: seal-home preference thinking-depth policies upsert --json '{\"id\":\"...\",\"name\":\"...\",\"level\":\"high\"}'");
throw new Error("Usage: seal-use preference thinking-depth policies upsert --json '{\"id\":\"...\",\"name\":\"...\",\"level\":\"high\"}'");
}
await runTool("seal_preference_thinking_depth_policies_upsert", client, corp, payload, outputOptions(args.options));
return;
@@ -68,7 +68,7 @@ export async function handlePreferenceCommand(
if (thirdAction === "remove" || thirdAction === "delete") {
const policyId = maybeTarget ?? stringOption(args.options.id) ?? stringOption(args.options.policyId);
if (!policyId) {
throw new Error("Usage: seal-home preference thinking-depth policies remove <policyId>");
throw new Error("Usage: seal-use preference thinking-depth policies remove <policyId>");
}
await runTool("seal_preference_thinking_depth_policies_remove", client, corp, { policyId }, outputOptions(args.options));
return;
+4 -4
View File
@@ -73,7 +73,7 @@ export async function handleRulesCommand(
printJson(
{
...result,
nextCommand: `seal-home rules clear --corp ${corp.id} --yes`
nextCommand: `seal-use rules clear --corp ${corp.id} --yes`
},
outputOptions(args.options)
);
@@ -90,7 +90,7 @@ export async function handleRulesCommand(
if (action === "version") {
const version = maybeName ?? stringOption(args.options.version);
if (!version) throw new Error("Usage: seal-home rules version <versionId|versionNumber|latest>");
if (!version) throw new Error("Usage: seal-use rules version <versionId|versionNumber|latest>");
await runTool(
"seal_approval_rule_version_get",
client,
@@ -119,7 +119,7 @@ export async function handleRulesCommand(
if (action === "search") {
const keyword = maybeName ?? stringOption(args.options.query);
if (!keyword) throw new Error("Usage: seal-home rules search <keyword> [--version <versionId|versionNumber|latest>]");
if (!keyword) throw new Error("Usage: seal-use rules search <keyword> [--version <versionId|versionNumber|latest>]");
await runTool(
"seal_approval_search",
client,
@@ -140,5 +140,5 @@ export async function handleRulesCommand(
return;
}
throw new Error(`Unknown rules command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown rules command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+1 -1
View File
@@ -5,7 +5,7 @@ import { runServiceCommand } from "../service.js";
import { printJson } from "../printer.js";
import type { CliRuntime } from "../types.js";
export const STATE_DIR = join(homedir(), ".config", "seal-home");
export const STATE_DIR = join(homedir(), ".config", "seal-use");
export async function handleServiceCommand(action: string | undefined, runtime: CliRuntime) {
const result = await runServiceCommand(action, {
+6 -6
View File
@@ -21,7 +21,7 @@ export async function handleSimulationCommand(
) {
if (action === "batch-records" || action === "records") {
const batchId = maybeName ?? stringOption(args.options.batchId) ?? stringOption(args.options["batch-id"]);
if (!batchId) throw new Error("Usage: seal-home simulation batch-records <batchId>");
if (!batchId) throw new Error("Usage: seal-use simulation batch-records <batchId>");
await runTool(
"seal_simulation_batch_records_get",
client,
@@ -100,7 +100,7 @@ export async function handleSimulationCommand(
if (action === "wait") {
const batchId = maybeName ?? stringOption(args.options.batchId) ?? stringOption(args.options["batch-id"]);
if (!batchId) throw new Error("Usage: seal-home simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");
if (!batchId) throw new Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");
await runTool(
"seal_simulation_batch_wait",
client,
@@ -117,7 +117,7 @@ export async function handleSimulationCommand(
if (action === "clean" || action === "delete") {
const batchId = maybeName ?? stringOption(args.options.batchId) ?? stringOption(args.options["batch-id"]);
if (!batchId) throw new Error("Usage: seal-home simulation clean <batchId>");
if (!batchId) throw new Error("Usage: seal-use simulation clean <batchId>");
await runTool("seal_simulation_batch_clean", client, corp, { batchId }, outputOptions(args.options));
return;
}
@@ -147,7 +147,7 @@ export async function handleSimulationCommand(
if (action === "get") {
const batchId = maybeName ?? stringOption(args.options.batchId) ?? stringOption(args.options["batch-id"]);
if (!batchId) throw new Error("Usage: seal-home simulation get <batchId>");
if (!batchId) throw new Error("Usage: seal-use simulation get <batchId>");
await runTool("seal_simulation_batch_get", client, corp, { batchId }, outputOptions(args.options));
return;
}
@@ -164,11 +164,11 @@ export async function handleSimulationCommand(
if (action === "package-upload") {
const filePath = maybeName ?? stringOption(args.options.file);
if (!filePath) throw new Error("Usage: seal-home simulation package-upload <材料包.zip>");
if (!filePath) throw new Error("Usage: seal-use simulation package-upload <材料包.zip>");
if (!existsSync(filePath)) throw new Error(`File not found: ${filePath}`);
await runTool("seal_simulation_material_package_upload", client, corp, { filePath }, outputOptions(args.options));
return;
}
throw new Error(`Unknown simulation command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown simulation command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+3 -3
View File
@@ -21,7 +21,7 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
const targetDir = customDir
? customDir
: isLocal
? join(process.cwd(), ".agents", "skills", "seal-home")
? join(process.cwd(), ".agents", "skills", "seal-use")
: getDefaultGlobalSkillDir();
const result = installSkillFiles(targetDir);
@@ -36,7 +36,7 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
if (action === "status" || action === "get" || !action) {
const globalDir = getDefaultGlobalSkillDir();
const localDir = join(process.cwd(), ".agents", "skills", "seal-home");
const localDir = join(process.cwd(), ".agents", "skills", "seal-use");
printJson({
global: {
dir: globalDir,
@@ -50,5 +50,5 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
return;
}
throw new Error(`Unknown skill command: ${action}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown skill command: ${action}. Run 'seal-use help' for available commands.`);
}
+1 -1
View File
@@ -8,5 +8,5 @@ export async function handleSourceCommand(action: string | undefined, corp: Corp
return;
}
throw new Error(`Unknown source command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown source command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+1 -1
View File
@@ -11,6 +11,6 @@ export async function handleToolCommand(
corp: CorpConfig,
args: ParsedArgs
) {
if (!action) throw new Error("Usage: seal-home tool <toolName> [--json '{...}']");
if (!action) throw new Error("Usage: seal-use tool <toolName> [--json '{...}']");
await runTool(action, client, corp, jsonObject(args.json), outputOptions(args.options));
}
+33 -19
View File
@@ -9,9 +9,12 @@ import { printJson } from "../printer.js";
import { STATE_DIR } from "./service.js";
import type { CliRuntime } from "../types.js";
const DEFAULT_GITHUB_REPO = "yunyingk/seal-home";
const UPDATE_URL_ENV = "SEAL_HOME_UPDATE_URL";
const GITHUB_REPO_ENV = "SEAL_HOME_GITHUB_REPO";
const DEFAULT_GITHUB_REPO = "yunyingk/seal-use";
const LEGACY_GITHUB_REPO = "yunyingk/seal-use";
const UPDATE_URL_ENV = "SEAL_USE_UPDATE_URL";
const LEGACY_UPDATE_URL_ENV = "SEAL_USE_UPDATE_URL";
const GITHUB_REPO_ENV = "SEAL_USE_GITHUB_REPO";
const LEGACY_GITHUB_REPO_ENV = "SEAL_USE_GITHUB_REPO";
export type UpdateOptions = {
checkOnly?: boolean;
@@ -31,7 +34,10 @@ export async function handleUpdateCommand(runtime: CliRuntime, options: UpdateOp
launcher: runtime.launcher
};
const repo = options.repo || process.env[GITHUB_REPO_ENV]?.trim() || DEFAULT_GITHUB_REPO;
const repo = options.repo
|| process.env[GITHUB_REPO_ENV]?.trim()
|| process.env[LEGACY_GITHUB_REPO_ENV]?.trim()
|| DEFAULT_GITHUB_REPO;
const rawTarget = options.targetVersion?.trim();
const targetVersion = rawTarget && rawTarget.toLowerCase() !== "latest" ? rawTarget : undefined;
@@ -45,7 +51,7 @@ export async function handleUpdateCommand(runtime: CliRuntime, options: UpdateOp
currentVersion: VERSION,
targetVersion: cleanTarget,
mode: isCompiledBinary() ? "binary" : "source",
message: `Cannot downgrade seal-home from v${VERSION} to older version v${cleanTarget}. Updates must be forward-only.`
message: `Cannot downgrade seal-use from v${VERSION} to older version v${cleanTarget}. Updates must be forward-only.`
});
return;
}
@@ -55,7 +61,7 @@ export async function handleUpdateCommand(runtime: CliRuntime, options: UpdateOp
currentVersion: VERSION,
targetVersion: cleanTarget,
mode: isCompiledBinary() ? "binary" : "source",
message: `seal-home is already at version v${VERSION}. Use --force to reinstall.`
message: `seal-use is already at version v${VERSION}. Use --force to reinstall.`
});
return;
}
@@ -110,7 +116,7 @@ export async function handleUpdateCommand(runtime: CliRuntime, options: UpdateOp
releaseNotes: latestRelease?.notes ?? "",
releaseUrl: latestRelease?.htmlUrl ?? "",
mode: "source",
message: "Running in source development mode. Run 'seal-home update' to git pull & bun install."
message: "Running in source development mode. Run 'seal-use update' to git pull & bun install."
});
return;
}
@@ -151,7 +157,7 @@ export async function handleUpdateCommand(runtime: CliRuntime, options: UpdateOp
updated: false,
currentVersion: VERSION,
mode: "binary",
message: `Failed to query releases from GitHub repository '${repo}'`
message: `Failed to query releases from repository '${repo}'`
});
return;
}
@@ -194,7 +200,7 @@ export async function handleUpdateCommand(runtime: CliRuntime, options: UpdateOp
latestVersion,
latestVersionPublishedAt: release.publishedAt,
mode: "binary",
message: `seal-home is already up to date (v${VERSION})`
message: `seal-use is already up to date (v${VERSION})`
});
return;
}
@@ -304,15 +310,19 @@ type GitHubRelease = {
async function fetchGitHubReleases(repo: string, limit = 20): Promise<GitHubRelease[]> {
const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
const headers: Record<string, string> = {
"User-Agent": `seal-home/${VERSION}`,
"User-Agent": `seal-use/${VERSION}`,
Accept: "application/vnd.github.v3+json",
...(token ? { Authorization: `Bearer ${token}` } : {})
};
const urls = [
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-home/releases?per_page=${limit}`,
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-use/releases?per_page=${limit}`,
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-use/releases?per_page=${limit}`,
`https://api.github.com/repos/${repo}/releases?per_page=${limit}`
];
if (repo !== LEGACY_GITHUB_REPO) {
urls.push(`https://api.github.com/repos/${LEGACY_GITHUB_REPO}/releases?per_page=${limit}`);
}
for (const url of urls) {
try {
@@ -364,19 +374,23 @@ async function fetchGitHubRelease(repo: string, targetVersion?: string): Promise
const tag = targetVersion ? (targetVersion.startsWith("v") ? targetVersion : `v${targetVersion}`) : undefined;
const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
const headers: Record<string, string> = {
"User-Agent": `seal-home/${VERSION}`,
"User-Agent": `seal-use/${VERSION}`,
Accept: "application/vnd.github.v3+json",
...(token ? { Authorization: `Bearer ${token}` } : {})
};
const urls = tag
? [
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-home/releases/tags/${tag}`,
`https://api.github.com/repos/${repo}/releases/tags/${tag}`
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-use/releases/tags/${tag}`,
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-use/releases/tags/${tag}`,
`https://api.github.com/repos/${repo}/releases/tags/${tag}`,
...(repo !== LEGACY_GITHUB_REPO ? [`https://api.github.com/repos/${LEGACY_GITHUB_REPO}/releases/tags/${tag}`] : [])
]
: [
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-home/releases/latest`,
`https://api.github.com/repos/${repo}/releases/latest`
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-use/releases/latest`,
`https://git.ying-qing.cn/api/v1/repos/gitea/seal-use/releases/latest`,
`https://api.github.com/repos/${repo}/releases/latest`,
...(repo !== LEGACY_GITHUB_REPO ? [`https://api.github.com/repos/${LEGACY_GITHUB_REPO}/releases/latest`] : [])
];
let fallbackRelease: GitHubRelease | undefined;
@@ -486,7 +500,7 @@ async function downloadFile(url: string, destPath: string, tagName?: string, ass
// 1. High-speed Gitea direct mirror first
if (tag && fileName) {
candidates.push(`https://git.ying-qing.cn/gitea/seal-home/releases/download/${tag}/${fileName}`);
candidates.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${tag}/${fileName}`);
}
if (url.startsWith("https://git.ying-qing.cn")) {
candidates.push(url);
@@ -659,7 +673,7 @@ function extractTarGz(archivePath: string, targetDir: string, platform: string):
unlinkSync(archivePath);
// Look for executable in targetDir
const expectedName = platform === "windows" ? "seal-home.exe" : "seal-home";
const expectedName = platform === "windows" ? "seal-use.exe" : "seal-use";
const files = spawnSync("find", [targetDir, "-type", "f"], { encoding: "utf8" })
.stdout.trim()
.split("\n")
@@ -677,7 +691,7 @@ function extractZip(archivePath: string, targetDir: string, platform: string): s
}
unlinkSync(archivePath);
const expectedName = platform === "windows" ? "seal-home.exe" : "seal-home";
const expectedName = platform === "windows" ? "seal-use.exe" : "seal-use";
const files = spawnSync("find", [targetDir, "-type", "f"], { encoding: "utf8" })
.stdout.trim()
.split("\n")
+7 -7
View File
@@ -15,7 +15,7 @@ export async function handleUsersCommand(
if (action === "create") {
const name = stringOption(args.options.name) ?? maybeName;
const phone = stringOption(args.options.phone);
if (!name || !phone) throw new Error("Usage: seal-home users create --name <name> --phone <phone> [--dept <deptId>]");
if (!name || !phone) throw new Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");
const deptId = stringOption(args.options.dept) ?? stringOption(args.options.departmentId);
const departmentIds = deptId ? [deptId] : undefined;
await runTool("seal_user_create", client, corp, { name, phone, departmentIds }, outputOptions(args.options));
@@ -24,7 +24,7 @@ export async function handleUsersCommand(
if (action === "reset-password") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw new Error("Usage: seal-home users reset-password <userId>");
if (!userId) throw new Error("Usage: seal-use users reset-password <userId>");
await runTool("seal_user_reset_password", client, corp, { userId }, outputOptions(args.options));
return;
}
@@ -37,32 +37,32 @@ export async function handleUsersCommand(
if (action === "get") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw new Error("Usage: seal-home users get <userId>");
if (!userId) throw new Error("Usage: seal-use users get <userId>");
await runTool("seal_user_get", client, corp, { userId }, outputOptions(args.options));
return;
}
if (action === "delete") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw new Error("Usage: seal-home users delete <userId>");
if (!userId) throw new Error("Usage: seal-use users delete <userId>");
await runTool("seal_user_delete", client, corp, { userId }, outputOptions(args.options));
return;
}
if (action === "activate") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw new Error("Usage: seal-home users activate <userId>");
if (!userId) throw new Error("Usage: seal-use users activate <userId>");
await runTool("seal_user_activate", client, corp, { userId }, outputOptions(args.options));
return;
}
if (action === "delegation" || action === "impersonate") {
const userIdOrPhone = maybeName ?? stringOption(args.options.userId) ?? stringOption(args.options.phone);
if (!userIdOrPhone) throw new Error("Usage: seal-home users delegation <userIdOrPhone> [--note <note>]");
if (!userIdOrPhone) throw new Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");
const note = stringOption(args.options.note);
await runTool("seal_user_delegation_create", client, corp, { userIdOrPhone, note }, outputOptions(args.options));
return;
}
throw new Error(`Unknown users command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown users command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+5 -5
View File
@@ -34,7 +34,7 @@ export async function handleWebhookCommand(
if (action === "get" || action === "find") {
const selector = maybeName ?? stringOption(args.options.selector) ?? stringOption(args.options.id);
if (!selector) throw new Error("Usage: seal-home webhook get <idOrName> [--show-secret]");
if (!selector) throw new Error("Usage: seal-use webhook get <idOrName> [--show-secret]");
await runTool(
"seal_webhook_get",
client,
@@ -56,7 +56,7 @@ export async function handleWebhookCommand(
stringOption(args.options.outgoingResultWebhook) ??
stringOption(args.options["outgoing-result-webhook"]);
if (!name || !outgoingResultWebhook) {
throw new Error("Usage: seal-home webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");
throw new Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");
}
const autoApprovalRate = webhookRateOption(args.options);
await runTool(
@@ -77,7 +77,7 @@ export async function handleWebhookCommand(
if (action === "update") {
const selector = maybeName ?? stringOption(args.options.selector) ?? stringOption(args.options.id);
if (!selector) throw new Error("Usage: seal-home webhook update <idOrName> [options]");
if (!selector) throw new Error("Usage: seal-use webhook update <idOrName> [options]");
const secret = stringOption(args.options.secret);
const rotateSecret = booleanOption(args.options.rotateSecret) ?? booleanOption(args.options["rotate-secret"]);
if (secret !== undefined && rotateSecret) {
@@ -121,7 +121,7 @@ export async function handleWebhookCommand(
if (action === "delete") {
const selector = maybeName ?? stringOption(args.options.selector) ?? stringOption(args.options.id);
if (!selector) throw new Error("Usage: seal-home webhook delete <idOrName> --yes");
if (!selector) throw new Error("Usage: seal-use webhook delete <idOrName> --yes");
if (booleanOption(args.options.yes) !== true) {
throw new Error("Refusing to delete Webhook integration without --yes");
}
@@ -138,5 +138,5 @@ export async function handleWebhookCommand(
return;
}
throw new Error(`Unknown webhook command: ${action ?? ""}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown webhook command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
+99 -99
View File
@@ -57,7 +57,7 @@ export function protectLargeRuleListOutput(result: unknown, allowFull: boolean)
if (effectiveCount > RULE_LIST_FULL_COUNT_LIMIT || bodyBytes > RULE_LIST_FULL_BYTES_LIMIT) {
throw new Error(
`Rule list is large (${effectiveCount} rules, ${bodyBytes} bytes). Use "seal-home rules list --summary" or "seal-home rules count"; pass --full only when you really need full descriptions.`
`Rule list is large (${effectiveCount} rules, ${bodyBytes} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`
);
}
}
@@ -70,105 +70,105 @@ export function outputOptions(options: Record<string, string | boolean>): Output
}
export function printHelp() {
console.log(`seal-home CLI
console.log(`seal-use CLI
Usage:
seal-home version
seal-home mcp
seal-home mcp config
seal-home mcp-config
seal-home skill dump
seal-home skill install [--dir <path>|--local]
seal-home skill status
seal-home http [--port 8787] [--host 127.0.0.1]
seal-home serve [--port 8787]
seal-home openapi
seal-home probe [<corpId>]
seal-home config paths
seal-home config get
seal-home config mode <stateful|stateless> [--corp <corpId>]
seal-home update [--check] [--force] [--version <v>]
seal-home update check
seal-home update changelog [--limit <n>]
seal-home changelog [--limit <n>]
seal-home tools list
seal-home corps list [--corp <corpId>]
seal-home corps current [--corp <corpId>]
seal-home corps switch <corpId>
seal-home corps add-hose --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId"}'
seal-home corps add-seal --json '{"sealUrl":"https://tenant.sealai.cc","token":"seal-bearer-token"}'
seal-home corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]
seal-home auth diagnose [--corp <corpId>]
seal-home auth hose-link [--corp <corpId>] [--expire 7200]
seal-home delegation list [--corp <corpId>]
seal-home delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]
seal-home delegation revoke <tokenId> [--corp <corpId>]
seal-home users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]
seal-home users search <keyword> [--corp <corpId>]
seal-home users delegation <userIdOrPhone|name> [--note <note>] [--corp <corpId>]
seal-home users reset-password <userId> [--corp <corpId>]
seal-home users get <userId> [--corp <corpId>]
seal-home users delete <userId> [--corp <corpId>]
seal-home llm config [--corp <corpId>]
seal-home llm providers [--corp <corpId>]
seal-home permissions available [--corp <corpId>]
seal-home permissions configs [--corp <corpId>]
seal-home billing status [--corp <corpId>]
seal-home billing plans [--corp <corpId>]
seal-home billing features [--corp <corpId>]
seal-home webhook list [--query <text>] [--show-secret] [--corp <corpId>]
seal-home webhook get|find <idOrName> [--show-secret] [--corp <corpId>]
seal-home webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]
seal-home webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]
seal-home webhook delete <idOrName> --yes [--corp <corpId>]
seal-home deploy hosecloud requirements [--corp <corpId>]
seal-home deploy hosecloud list [--corp <corpId>]
seal-home deploy hosecloud get <sign-key> [--corp <corpId>]
seal-home deploy hosecloud status [--corp <corpId>]
seal-home deploy hosecloud configure --json '{...}' [--corp <corpId>]
seal-home deploy hosecloud sync <sign-key> [--corp <corpId>]
seal-home preference get [--corp <corpId>]
seal-home preference decision update --json '{"explicitApprove":"..."}' [--corp <corpId>]
seal-home preference thinking-depth set --default <medium|high> [--corp <corpId>]
seal-home preference thinking-depth policies list [--corp <corpId>]
seal-home preference thinking-depth policies upsert --json '{...}' [--corp <corpId>]
seal-home preference thinking-depth policies remove <policyId> [--corp <corpId>]
seal-home source config [--corp <corpId>]
seal-home tool <toolName> [--corp <corpId>] [--json '{"key":"value"}']
seal-home rules count [--corp <corpId>]
seal-home rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]
seal-home rules clear [--corp <corpId>] [--dry-run|--yes]
seal-home rules versions [--corp <corpId>]
seal-home rules version <versionId|versionNumber|latest> [--corp <corpId>]
seal-home rules get --corp <corpId> --version <number|latest> --code '#0038'
seal-home rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205
seal-home rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]
seal-home context [--ruleVersion <versionId|versionNumber|latest>] [--documentLimit 50] [--corp <corpId>]
seal-home approval-runs summary [--date YYYY-MM-DD] [--timezone Asia/Shanghai] [--corp <corpId>]
seal-home approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] [--corp <corpId>]
seal-home approval-runs count [--status APPROVED] [--corp <corpId>]
seal-home approval-runs list|search [--query text] [--humanResult 驳回] [--manualApprovalStatus TERMINATED] [--startDate ms] [--endDate ms] [--limit 20] [--includeBridge true] [--corp <corpId>]
seal-home approval-runs pick --sn <documentSN> [--batch <batchId>] [--latest] [--fields recordId,status,aiDecision] [--corp <corpId>]
seal-home approval-runs get <recordId> [--summary] [--fields metadata|document.fields,result.summary] [--full] [--output-file file.json] [--corp <corpId>]
seal-home approval-runs cited-rules <recordId> [--corp <corpId>]
seal-home approval-runs document-summary <recordId> [--corp <corpId>]
seal-home approval-runs attachments <recordId> [--summary] [--corp <corpId>]
seal-home approval-runs result <recordId> [--summary] [--corp <corpId>]
seal-home approval-runs url [--corp <corpId>]
seal-home approval-runs url <recordId> [--corp <corpId>]
seal-home approval-runs url --sourceDocumentSN B26022501 [--corp <corpId>]
seal-home approval-runs bridge [--sourceDocumentSN B26001887] [--corp <corpId>]
seal-home simulation batch-records <batchId> [--corp <corpId>]
seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high] [--skip-invoice-generation|--skip-invoice-generation false] [--corp <corpId>]
seal-home simulation create --mode material_pack --package-ids <materialPackageId> [--template-id conference_reimbursement_v1] [--schema-config file.json] [--corp <corpId>]
seal-home simulation create --source-system weaver --request-ids "req-01,req-02" [--corp <corpId>]
seal-home simulation wait <batchId> [--timeout 10m] [--poll-interval 2s] [--corp <corpId>]
seal-home simulation clean <batchId> [--corp <corpId>]
seal-home simulation specifications [--integration <sign-key>] [--corp <corpId>]
seal-home simulation list [--limit 50] [--corp <corpId>]
seal-home simulation get <batchId> [--corp <corpId>]
seal-home simulation templates [--corp <corpId>]
seal-home simulation integrations [--corp <corpId>]
seal-home simulation package-upload <材料包.zip> [--corp <corpId>]
seal-use version
seal-use mcp
seal-use mcp config
seal-use mcp-config
seal-use skill dump
seal-use skill install [--dir <path>|--local]
seal-use skill status
seal-use http [--port 8787] [--host 127.0.0.1]
seal-use serve [--port 8787]
seal-use openapi
seal-use probe [<corpId>]
seal-use config paths
seal-use config get
seal-use config mode <stateful|stateless> [--corp <corpId>]
seal-use update [--check] [--force] [--version <v>]
seal-use update check
seal-use update changelog [--limit <n>]
seal-use changelog [--limit <n>]
seal-use tools list
seal-use corps list [--corp <corpId>]
seal-use corps current [--corp <corpId>]
seal-use corps switch <corpId>
seal-use corps add-hose --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId"}'
seal-use corps add-seal --json '{"sealUrl":"https://tenant.sealai.cc","token":"seal-bearer-token"}'
seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]
seal-use auth diagnose [--corp <corpId>]
seal-use auth hose-link [--corp <corpId>] [--expire 7200]
seal-use delegation list [--corp <corpId>]
seal-use delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]
seal-use delegation revoke <tokenId> [--corp <corpId>]
seal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]
seal-use users search <keyword> [--corp <corpId>]
seal-use users delegation <userIdOrPhone|name> [--note <note>] [--corp <corpId>]
seal-use users reset-password <userId> [--corp <corpId>]
seal-use users get <userId> [--corp <corpId>]
seal-use users delete <userId> [--corp <corpId>]
seal-use llm config [--corp <corpId>]
seal-use llm providers [--corp <corpId>]
seal-use permissions available [--corp <corpId>]
seal-use permissions configs [--corp <corpId>]
seal-use billing status [--corp <corpId>]
seal-use billing plans [--corp <corpId>]
seal-use billing features [--corp <corpId>]
seal-use webhook list [--query <text>] [--show-secret] [--corp <corpId>]
seal-use webhook get|find <idOrName> [--show-secret] [--corp <corpId>]
seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]
seal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]
seal-use webhook delete <idOrName> --yes [--corp <corpId>]
seal-use deploy hosecloud requirements [--corp <corpId>]
seal-use deploy hosecloud list [--corp <corpId>]
seal-use deploy hosecloud get <sign-key> [--corp <corpId>]
seal-use deploy hosecloud status [--corp <corpId>]
seal-use deploy hosecloud configure --json '{...}' [--corp <corpId>]
seal-use deploy hosecloud sync <sign-key> [--corp <corpId>]
seal-use preference get [--corp <corpId>]
seal-use preference decision update --json '{"explicitApprove":"..."}' [--corp <corpId>]
seal-use preference thinking-depth set --default <medium|high> [--corp <corpId>]
seal-use preference thinking-depth policies list [--corp <corpId>]
seal-use preference thinking-depth policies upsert --json '{...}' [--corp <corpId>]
seal-use preference thinking-depth policies remove <policyId> [--corp <corpId>]
seal-use source config [--corp <corpId>]
seal-use tool <toolName> [--corp <corpId>] [--json '{"key":"value"}']
seal-use rules count [--corp <corpId>]
seal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]
seal-use rules clear [--corp <corpId>] [--dry-run|--yes]
seal-use rules versions [--corp <corpId>]
seal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]
seal-use rules get --corp <corpId> --version <number|latest> --code '#0038'
seal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205
seal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]
seal-use context [--ruleVersion <versionId|versionNumber|latest>] [--documentLimit 50] [--corp <corpId>]
seal-use approval-runs summary [--date YYYY-MM-DD] [--timezone Asia/Shanghai] [--corp <corpId>]
seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] [--corp <corpId>]
seal-use approval-runs count [--status APPROVED] [--corp <corpId>]
seal-use approval-runs list|search [--query text] [--humanResult 驳回] [--manualApprovalStatus TERMINATED] [--startDate ms] [--endDate ms] [--limit 20] [--includeBridge true] [--corp <corpId>]
seal-use approval-runs pick --sn <documentSN> [--batch <batchId>] [--latest] [--fields recordId,status,aiDecision] [--corp <corpId>]
seal-use approval-runs get <recordId> [--summary] [--fields metadata|document.fields,result.summary] [--full] [--output-file file.json] [--corp <corpId>]
seal-use approval-runs cited-rules <recordId> [--corp <corpId>]
seal-use approval-runs document-summary <recordId> [--corp <corpId>]
seal-use approval-runs attachments <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs result <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs url [--corp <corpId>]
seal-use approval-runs url <recordId> [--corp <corpId>]
seal-use approval-runs url --sourceDocumentSN B26022501 [--corp <corpId>]
seal-use approval-runs bridge [--sourceDocumentSN B26001887] [--corp <corpId>]
seal-use simulation batch-records <batchId> [--corp <corpId>]
seal-use simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high] [--skip-invoice-generation|--skip-invoice-generation false] [--corp <corpId>]
seal-use simulation create --mode material_pack --package-ids <materialPackageId> [--template-id conference_reimbursement_v1] [--schema-config file.json] [--corp <corpId>]
seal-use simulation create --source-system weaver --request-ids "req-01,req-02" [--corp <corpId>]
seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s] [--corp <corpId>]
seal-use simulation clean <batchId> [--corp <corpId>]
seal-use simulation specifications [--integration <sign-key>] [--corp <corpId>]
seal-use simulation list [--limit 50] [--corp <corpId>]
seal-use simulation get <batchId> [--corp <corpId>]
seal-use simulation templates [--corp <corpId>]
seal-use simulation integrations [--corp <corpId>]
seal-use simulation package-upload <材料包.zip> [--corp <corpId>]
`);
}
+1 -1
View File
@@ -10,7 +10,7 @@ describe("CLI runner", () => {
isError: false,
exitCode: 0
});
expect(JSON.parse(result.stdout)).toMatchObject({ name: "seal-home" });
expect(JSON.parse(result.stdout)).toMatchObject({ name: "seal-use" });
});
test("returns diagnostics and a non-zero exit code for invalid commands", async () => {
+4 -4
View File
@@ -140,7 +140,7 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
Boolean(args.options.V)
) {
printJson({
name: "seal-home",
name: "seal-use",
version: VERSION
});
return;
@@ -152,7 +152,7 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
}
if (!KNOWN_AREAS.has(area)) {
throw new Error(`Unknown command: ${args.command.join(" ")}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown command: ${args.command.join(" ")}. Run 'seal-use help' for available commands.`);
}
if (area === "openapi") {
@@ -236,7 +236,7 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
if (area === "delegation" && action === "create" && ("from-link" in args.options || "link" in args.options)) {
const link = stringOption(args.options["from-link"]) ?? stringOption(args.options.link);
if (!link) throw new Error("Usage: seal-home delegation create --from-link <url> [--note <note>]");
if (!link) throw new Error("Usage: seal-use delegation create --from-link <url> [--note <note>]");
await handleDelegationFromHoseLink(link, stringOption(args.options.note));
return;
}
@@ -320,5 +320,5 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
return;
}
throw new Error(`Unknown command: ${args.command.join(" ")}. Run 'seal-home help' for available commands.`);
throw new Error(`Unknown command: ${args.command.join(" ")}. Run 'seal-use help' for available commands.`);
}
+3 -3
View File
@@ -14,13 +14,13 @@ afterEach(() => {
describe("service lifecycle state", () => {
test("clears a stale pid file instead of reporting another process as running", () => {
const stateDir = mkdtempSync(join(tmpdir(), "seal-home-service-"));
const stateDir = mkdtempSync(join(tmpdir(), "seal-use-service-"));
tempDirs.push(stateDir);
writeFileSync(join(stateDir, "service.pid"), "999999\n");
const status = serviceStatus({
appRoot: "/tmp/seal-home",
entryFile: "/tmp/seal-home/src/cli.ts",
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir,
version: "0.4.2"
});
+2 -2
View File
@@ -33,7 +33,7 @@ export async function runServiceCommand(
case undefined:
return serviceStatus(config);
default:
throw new Error("Usage: seal-home service <start|stop|restart|status>");
throw new Error("Usage: seal-use service <start|stop|restart|status>");
}
}
@@ -135,7 +135,7 @@ function isSealHomeProcess(pid: number, appRoot: string) {
const command = execFileSync("ps", ["-p", String(pid), "-o", "command="], { encoding: "utf8" });
const matchesTarget =
command.includes(appRoot) ||
command.includes("seal-home") ||
command.includes("seal-use") ||
command.includes("src/cli.ts");
return matchesTarget && command.includes("service") && command.includes("run");
} catch {