Add runtime detection and unified mcp and probe CLI commands
This commit is contained in:
1 parent
551fb9177f
commit
b109f3f49f
8 files changed
+118
-19
No files matched your search
+10
-8
@@ -4,9 +4,7 @@ import { createSealClient } from "./core/http/factory.js";
|
||||
import { resolveLiveSealEnterpriseConfig } from "./domains/seal/source.js";
|
||||
import { getApprovalContext } from "./domains/seal/api.js";
|
||||
|
||||
async function main() {
|
||||
const args = Bun.argv.slice(2);
|
||||
const corpId = args[0] === "--corp" ? args[1] : args[0];
|
||||
export async function runProbe(options: { corpId?: string } = {}) {
|
||||
const corps = loadCorpConfigs();
|
||||
const globalConfig = loadGlobalConfig();
|
||||
const corp = resolveCorpConfig(
|
||||
@@ -14,7 +12,7 @@ async function main() {
|
||||
{
|
||||
stateful: globalConfig.stateful,
|
||||
defaultCorpId: globalConfig.defaultCorpId,
|
||||
corpId
|
||||
corpId: options.corpId
|
||||
},
|
||||
getEnterprisesDirCandidates()
|
||||
);
|
||||
@@ -43,7 +41,11 @@ async function main() {
|
||||
}, null, 2));
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
console.error(error instanceof Error ? error.message : error);
|
||||
process.exit(1);
|
||||
});
|
||||
if (import.meta.main) {
|
||||
const args = process.argv.slice(2);
|
||||
const corpId = args[0] === "--corp" ? args[1] : args[0];
|
||||
runProbe({ corpId }).catch((error) => {
|
||||
console.error(error instanceof Error ? error.message : error);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user