Camel-case capability IDs and rename the MCP gateway pair
This commit is contained in:
1 parent
7f36cd1d39
commit
4f0d955e06
41 files changed
+466
-466
No files matched your search
@@ -32,7 +32,7 @@ afterEach(() => {
|
||||
|
||||
describe("sealCapabilities", () => {
|
||||
test("exposes concrete JSON schemas for parameterized tools", () => {
|
||||
const createRule = sealCapabilities.find((tool) => tool.name === "seal_approval_rule_create");
|
||||
const createRule = sealCapabilities.find((tool) => tool.name === "sealApprovalRuleCreate");
|
||||
expect(createRule).toBeDefined();
|
||||
|
||||
const schema = z.toJSONSchema(createRule!.parameters) as {
|
||||
@@ -49,19 +49,19 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("includes the approval context aggregation tool", () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_context_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalContextGet");
|
||||
expect(tool).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes the session diagnostic tool", () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_session_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealSessionGet");
|
||||
expect(tool).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes the delegation management tools", () => {
|
||||
const listTool = sealCapabilities.find((item) => item.name === "seal_delegation_list");
|
||||
const createCapability = sealCapabilities.find((item) => item.name === "seal_delegation_create");
|
||||
const revokeTool = sealCapabilities.find((item) => item.name === "seal_delegation_revoke");
|
||||
const listTool = sealCapabilities.find((item) => item.name === "sealDelegationList");
|
||||
const createCapability = sealCapabilities.find((item) => item.name === "sealDelegationCreate");
|
||||
const revokeTool = sealCapabilities.find((item) => item.name === "sealDelegationRevoke");
|
||||
|
||||
expect(listTool).toBeDefined();
|
||||
expect(createCapability).toBeDefined();
|
||||
@@ -69,13 +69,13 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("includes user management tools", () => {
|
||||
const createCapability = sealCapabilities.find((item) => item.name === "seal_user_create");
|
||||
const resetTool = sealCapabilities.find((item) => item.name === "seal_user_reset_password");
|
||||
const getTool = sealCapabilities.find((item) => item.name === "seal_user_get");
|
||||
const searchTool = sealCapabilities.find((item) => item.name === "seal_user_search");
|
||||
const deleteTool = sealCapabilities.find((item) => item.name === "seal_user_delete");
|
||||
const activateTool = sealCapabilities.find((item) => item.name === "seal_user_activate");
|
||||
const userDelegationTool = sealCapabilities.find((item) => item.name === "seal_user_delegation_create");
|
||||
const createCapability = sealCapabilities.find((item) => item.name === "sealUserCreate");
|
||||
const resetTool = sealCapabilities.find((item) => item.name === "sealUserResetPassword");
|
||||
const getTool = sealCapabilities.find((item) => item.name === "sealUserGet");
|
||||
const searchTool = sealCapabilities.find((item) => item.name === "sealUserSearch");
|
||||
const deleteTool = sealCapabilities.find((item) => item.name === "sealUserDelete");
|
||||
const activateTool = sealCapabilities.find((item) => item.name === "sealUserActivate");
|
||||
const userDelegationTool = sealCapabilities.find((item) => item.name === "sealUserDelegationCreate");
|
||||
|
||||
expect(createCapability).toBeDefined();
|
||||
expect(resetTool).toBeDefined();
|
||||
@@ -87,82 +87,82 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("includes read-only contacts directory tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_contacts_departments_root_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_contacts_department_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_contacts_department_children_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_contacts_department_users_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_contacts_last_sync_time_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealContactsDepartmentsRootList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealContactsDepartmentGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealContactsDepartmentChildrenList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealContactsDepartmentUsersList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealContactsLastSyncTimeGet")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes the read-only insight stats and analytics tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_insight_stats_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_insight_risks_by_tag_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_insight_performance_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_insight_record_analyze")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_insight_export")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealInsightStatsGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealInsightRisksByTagGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealInsightPerformanceGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealInsightRecordAnalyze")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealInsightExport")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes read-only financial data tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_expenses_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_invoices_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealExpensesList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealInvoicesList")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes the Feishu simulation approval definition tool", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_feishu_approval_definitions_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationFeishuApprovalDefinitionsList")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes system configuration tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_llm_config_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_llm_providers_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_permissions_available_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_permissions_configs_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_billing_status_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_billing_plans_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_billing_features_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealLlmConfigGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealLlmProvidersList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPermissionsAvailableList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPermissionsConfigsList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealBillingStatusGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealBillingPlansList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealBillingFeaturesList")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes Webhook management tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_webhook_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_webhook_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_webhook_add")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_webhook_update")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_webhook_delete")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_webhook_replay")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealWebhookList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealWebhookGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealWebhookAdd")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealWebhookUpdate")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealWebhookDelete")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealWebhookReplay")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes deploy hosecloud tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_requirements")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_status")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_configure")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_sync")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealDeployHosecloudRequirements")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealDeployHosecloudList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealDeployHosecloudGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealDeployHosecloudStatus")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealDeployHosecloudConfigure")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealDeployHosecloudSync")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes preference and thinking-depth tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_preference_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_preference_decision_update")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_preference_thinking_depth_set")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_preference_thinking_depth_policies_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_preference_thinking_depth_policies_upsert")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_preference_thinking_depth_policies_remove")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPreferenceGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPreferenceDecisionUpdate")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPreferenceThinkingDepthSet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPreferenceThinkingDepthPoliciesList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPreferenceThinkingDepthPoliciesUpsert")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealPreferenceThinkingDepthPoliciesRemove")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes simulation wait, clean, specifications tools and approval run stats/count", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_batch_wait")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_batch_clean")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_specifications_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_approval_runs_stats")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_approval_runs_count")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationBatchWait")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationBatchClean")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationSpecificationsList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealApprovalRunsStats")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealApprovalRunsCount")).toBeDefined();
|
||||
});
|
||||
|
||||
test("includes the approval search tool", () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_search");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalSearch");
|
||||
expect(tool).toBeDefined();
|
||||
});
|
||||
|
||||
test("approval rules list can return count only", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rules_list");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRulesList");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -172,7 +172,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rules list treats limit zero as count only", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rules_list");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRulesList");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -182,7 +182,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rules list can project lightweight fields", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rules_list");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRulesList");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -206,7 +206,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rules list renders timestamps in standard Beijing ISO format", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rules_list");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRulesList");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -255,7 +255,7 @@ describe("sealCapabilities", () => {
|
||||
}]
|
||||
});
|
||||
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rule_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRuleGet");
|
||||
expect(tool).toBeDefined();
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
const context = { corp: { ...fakeContext().corp, testCorpId: "t-corp-1" } };
|
||||
@@ -274,7 +274,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rule update without --if-unchanged leaves concurrency check absent", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rule_update");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRuleUpdate");
|
||||
expect(tool).toBeDefined();
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
const result = await handler(
|
||||
@@ -286,7 +286,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rule update --if-unchanged rejects when the draft moved on (exit 13)", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rule_update");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRuleUpdate");
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
try {
|
||||
await handler(
|
||||
@@ -302,7 +302,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rule update --if-unchanged proceeds when the draft is unchanged", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rule_update");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRuleUpdate");
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
const result = await handler(
|
||||
fakeRuleUpdateClient(1780898164536),
|
||||
@@ -312,8 +312,8 @@ describe("sealCapabilities", () => {
|
||||
expect(result).toMatchObject({ id: "rule-1" });
|
||||
});
|
||||
|
||||
test("seal_approval_run_diagnose aggregates document, result, cited rules, and version snapshot", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_diagnose");
|
||||
test("sealApprovalRunDiagnose aggregates document, result, cited rules, and version snapshot", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunDiagnose");
|
||||
expect(tool).toBeDefined();
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
|
||||
@@ -339,7 +339,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rules clear can dry run without deleting", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rules_clear");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRulesClear");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const client = fakeClearRulesClient();
|
||||
@@ -361,7 +361,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rules clear deletes all draft rules", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rules_clear");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRulesClear");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const client = fakeClearRulesClient();
|
||||
@@ -385,7 +385,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("preference dry run reads config without patching it", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_preference_decision_update");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealPreferenceDecisionUpdate");
|
||||
expect(tool).toBeDefined();
|
||||
let patched = false;
|
||||
const client = {
|
||||
@@ -503,19 +503,19 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("includes approval run Langfuse bridge tools", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_approval_runs_search")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_approval_runs_summary")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_batch_records_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_approval_run_langfuse_bridge_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealApprovalRunsSearch")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealApprovalRunsSummary")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationBatchRecordsGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealApprovalRunLangfuseBridgeGet")).toBeDefined();
|
||||
});
|
||||
|
||||
test("can find tools by name in sealCapabilities", () => {
|
||||
expect(findSealCapability("seal_approval_rule_create")).toBeDefined();
|
||||
expect(findSealCapability("sealApprovalRuleCreate")).toBeDefined();
|
||||
expect(findSealCapability("non_existent_tool")).toBeUndefined();
|
||||
});
|
||||
|
||||
test("approval run search omits bridge unless requested", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_runs_search");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunsSearch");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -526,7 +526,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run search can filter by extracted human result", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_runs_search");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunsSearch");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -551,7 +551,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run search maps rejected human result to manual approval status", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_runs_search");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunsSearch");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const requests: string[] = [];
|
||||
@@ -573,7 +573,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run search forwards query as API search parameter", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_runs_search");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunsSearch");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const requests: string[] = [];
|
||||
@@ -595,7 +595,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run get returns stable aliases for document concepts", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -627,7 +627,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run get can return selected fields only", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -650,7 +650,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run get can return summary preset", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -666,7 +666,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run pick supports sn latest and compact candidate fields", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_pick");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunPick");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const requests: string[] = [];
|
||||
@@ -687,7 +687,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run attachments extracts compact attachment metadata", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_attachments_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunAttachmentsGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -713,7 +713,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run cited rules extracts rule application details", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_cited_rules_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunCitedRulesGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -736,7 +736,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run document summary returns key fields without raw payload", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_document_summary_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunDocumentSummaryGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -756,7 +756,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run result can return summary only", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_result_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunResultGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -782,7 +782,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run url returns Seal result and Hose document links by recordId", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_url_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunUrlGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -822,7 +822,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run url supports type=hose-document", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_url_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunUrlGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -846,7 +846,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run url throws error without a document lookup", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_url_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunUrlGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const requests: string[] = [];
|
||||
@@ -862,7 +862,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run url can resolve by sourceDocumentSN", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_url_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunUrlGet");
|
||||
expect(tool).toBeDefined();
|
||||
primeHoseEnterpriseUrl("corp-a", "https://app.ekuaibao.com/web/home.html?accessToken=close-token");
|
||||
|
||||
@@ -883,7 +883,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run url returns auto_login link with identity, expiration, and warning when autoLogin=true", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_url_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunUrlGet");
|
||||
expect(tool).toBeDefined();
|
||||
primeHoseEnterpriseUrl("corp-a", "https://app.ekuaibao.com/web/home.html?accessToken=close-token");
|
||||
|
||||
@@ -912,7 +912,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run url supports legacy hoseSso=true with explicit hose attribute naming", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_url_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunUrlGet");
|
||||
expect(tool).toBeDefined();
|
||||
primeHoseEnterpriseUrl("corp-a", "https://app.ekuaibao.com/web/home.html?accessToken=close-token");
|
||||
|
||||
@@ -937,7 +937,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run url throws clear error when sso=true is used on non-hose enterprise", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_url_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunUrlGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -951,7 +951,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run summary filters by local date and returns compact aggregates", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_runs_summary");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunsSummary");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -977,7 +977,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rule get resolves one rule by version and code", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rule_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRuleGet");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -998,7 +998,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval rule get defaults to current draft and handles 0-based codes without +1 offset", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_rule_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRuleGet");
|
||||
expect(tool).toBeDefined();
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
const client = fakeZeroBasedRulesClient();
|
||||
@@ -1049,7 +1049,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("approval run cited-rules extracts and merges result.rulesResult and result.hitRules", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_run_cited_rules_get");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunCitedRulesGet");
|
||||
expect(tool).toBeDefined();
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
|
||||
@@ -1124,7 +1124,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("deploy hosecloud configure saves integration and rejects missing customApiUrl", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_configure");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealDeployHosecloudConfigure");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -1165,7 +1165,7 @@ describe("sealCapabilities", () => {
|
||||
});
|
||||
|
||||
test("deploy hosecloud status masks signKey alongside apiKey/apiSecret", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_deploy_hosecloud_status");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealDeployHosecloudStatus");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const handler = tool!.handler as CapabilityHandler;
|
||||
@@ -1207,8 +1207,8 @@ describe("sealCapabilities", () => {
|
||||
expect(JSON.stringify(result)).not.toContain("visible-sign-key-123");
|
||||
});
|
||||
|
||||
test("seal_approval_runs_count supports startDate and endDate and normalizes them", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_approval_runs_count");
|
||||
test("sealApprovalRunsCount supports startDate and endDate and normalizes them", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealApprovalRunsCount");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const schema = z.toJSONSchema(tool!.parameters) as {
|
||||
|
||||
@@ -47,7 +47,7 @@ const {
|
||||
|
||||
export const approvalRunsCapabilities = [
|
||||
{
|
||||
name: "seal_approval_runs_search",
|
||||
name: "sealApprovalRunsSearch",
|
||||
description: "查询 Seal 审批/审核运行记录总表,并整理合思单据到 Langfuse trace/session 的桥接字段",
|
||||
parameters: z.object({
|
||||
offset: z.number().int().nonnegative().optional(),
|
||||
@@ -103,7 +103,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_runs_summary",
|
||||
name: "sealApprovalRunsSummary",
|
||||
description: "按本地日期/时区汇总 Seal 审批运行记录,返回状态、模式统计和精简记录,避免长 JSON 输出",
|
||||
parameters: z.object({
|
||||
date: z.string().optional().describe("本地日期,格式 YYYY-MM-DD;默认使用 timezone 下的今天"),
|
||||
@@ -170,7 +170,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_runs_export",
|
||||
name: "sealApprovalRunsExport",
|
||||
description: "将企业的审批审核记录导出为高保真 Excel 报表(包含单据模板、AI决策、人工审核结论、驳回原因及企业规则列细分结果)",
|
||||
parameters: z.object({
|
||||
startDate: z.string().optional().describe("起始时间,支持 YYYY-MM-DD 或毫秒时间戳"),
|
||||
@@ -198,7 +198,7 @@ export const approvalRunsCapabilities = [
|
||||
) => exportApprovalRunsToExcel(client, context.corp, params)
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_get",
|
||||
name: "sealApprovalRunGet",
|
||||
description: "获取 Seal 单条审批/审核运行记录详情;可用 fields 只取 metadata、document.fields、result.summary 等局部字段",
|
||||
parameters: z.object({
|
||||
recordId: z.string().describe("Seal approval run record ID"),
|
||||
@@ -221,7 +221,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_flow_get",
|
||||
name: "sealApprovalRunFlowGet",
|
||||
description: "获取合思原生审批流流转时间线、待办节点、员工意见、驳回原因及版本变更指标,并对齐 AI 运行记录与人工行为",
|
||||
parameters: z.object({
|
||||
target: z.string().optional().describe("合思单号 (sourceDocumentSN) 或 Seal 运行记录 ID (recordId)"),
|
||||
@@ -370,7 +370,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_cited_rules_get",
|
||||
name: "sealApprovalRunCitedRulesGet",
|
||||
description: "从审批运行结果中抽取 AI 引用或命中的规则及应用分析",
|
||||
parameters: z.object({
|
||||
recordId: z.string().describe("Seal approval run record ID")
|
||||
@@ -384,7 +384,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_document_summary_get",
|
||||
name: "sealApprovalRunDocumentSummaryGet",
|
||||
description: "返回单据关键字段、附件摘要、AI/人工结果,避免拉取完整原始单据",
|
||||
parameters: z.object({
|
||||
recordId: z.string().describe("Seal approval run record ID")
|
||||
@@ -398,7 +398,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_attachments_get",
|
||||
name: "sealApprovalRunAttachmentsGet",
|
||||
description: "从审批运行记录中抽取附件、发票附件和字段位置,不返回完整单据正文和规则结果",
|
||||
parameters: z.object({
|
||||
recordId: z.string().describe("Seal approval run record ID"),
|
||||
@@ -413,7 +413,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_result_get",
|
||||
name: "sealApprovalRunResultGet",
|
||||
description: "返回审批运行结果摘要;summary=true 时只返回 decision、summary、风险点数量、命中规则数量、traceId 等",
|
||||
parameters: z.object({
|
||||
recordId: z.string().describe("Seal approval run record ID"),
|
||||
@@ -432,7 +432,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_url_get",
|
||||
name: "sealApprovalRunUrlGet",
|
||||
description: "获取审批单的 Web 链接(支持 seal-result 审核页与 hose-document 原单据页,支持 --auto-login 免密直达)",
|
||||
parameters: z.object({
|
||||
recordId: z.string().optional().describe("Seal approval run record ID"),
|
||||
@@ -555,7 +555,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_pick",
|
||||
name: "sealApprovalRunPick",
|
||||
description: "按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",
|
||||
parameters: z.object({
|
||||
query: z.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),
|
||||
@@ -619,7 +619,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_diagnose",
|
||||
name: "sealApprovalRunDiagnose",
|
||||
description: "一键客诉/单据诊断:按单号 SN 或 recordId 一次聚合单据摘要、AI 判定结果、引用规则、当时的规则版本快照与 Langfuse trace 指针,替代串行调用 pick/get/cited-rules/rules version",
|
||||
parameters: z.object({
|
||||
sn: z.string().optional().describe("合思/易快报单号 (sourceDocumentSN);与 recordId 二选一"),
|
||||
@@ -710,7 +710,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_run_langfuse_bridge_get",
|
||||
name: "sealApprovalRunLangfuseBridgeGet",
|
||||
description: "从 Seal approval run 中抽取 Langfuse 定位信息;优先返回 _langfuseTraceId,没有时给出 hosecloud-{sourceDocumentSN} session 回退",
|
||||
parameters: z.object({
|
||||
recordId: z.string().optional(),
|
||||
@@ -754,7 +754,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_runs_stats",
|
||||
name: "sealApprovalRunsStats",
|
||||
description: "统计审核记录状态分布、来源系统分布及按单号/ID去重统计",
|
||||
parameters: z.object({
|
||||
since: z.string().optional().describe("时间范围,如 3months, 7days, 24hours"),
|
||||
@@ -802,7 +802,7 @@ export const approvalRunsCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_runs_count",
|
||||
name: "sealApprovalRunsCount",
|
||||
description: "统计符合条件的审核记录总数",
|
||||
parameters: z.object({
|
||||
status: z.string().optional(),
|
||||
|
||||
@@ -4,43 +4,43 @@ import * as api from "../api.js";
|
||||
|
||||
export const billingCapabilities = [
|
||||
{
|
||||
name: "seal_llm_config_get",
|
||||
name: "sealLlmConfigGet",
|
||||
description: "查询当前 Seal 租户的大模型 (LLM) 配置",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.getLlmConfig(client)
|
||||
},
|
||||
{
|
||||
name: "seal_llm_providers_list",
|
||||
name: "sealLlmProvidersList",
|
||||
description: "查询支持的大模型 (LLM) 供应商与配置属性字段",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.listLlmProviders(client)
|
||||
},
|
||||
{
|
||||
name: "seal_permissions_available_list",
|
||||
name: "sealPermissionsAvailableList",
|
||||
description: "查询系统可选权限清单(如超级管理员、智能审核管理、数据管理等)",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.listAvailablePermissions(client)
|
||||
},
|
||||
{
|
||||
name: "seal_permissions_configs_list",
|
||||
name: "sealPermissionsConfigsList",
|
||||
description: "查询当前租户已绑定的权限配置",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.listPermissionConfigs(client)
|
||||
},
|
||||
{
|
||||
name: "seal_billing_status_get",
|
||||
name: "sealBillingStatusGet",
|
||||
description: "查询当前 Seal 租户的订阅状态与各功能额度(AI审批、审核规则、知识文档等)",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.getBillingStatus(client)
|
||||
},
|
||||
{
|
||||
name: "seal_billing_plans_list",
|
||||
name: "sealBillingPlansList",
|
||||
description: "查询系统支持的订阅套餐列表",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.listBillingPlans(client)
|
||||
},
|
||||
{
|
||||
name: "seal_billing_features_list",
|
||||
name: "sealBillingFeaturesList",
|
||||
description: "查询系统支持的功能特性定义列表",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.listBillingFeatures(client)
|
||||
|
||||
@@ -4,13 +4,13 @@ import * as api from "../api.js";
|
||||
|
||||
export const contactsCapabilities = [
|
||||
{
|
||||
name: "seal_contacts_departments_root_list",
|
||||
name: "sealContactsDepartmentsRootList",
|
||||
description: "列出当前 Seal 租户通讯录的顶级部门",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.listRootDepartments(client)
|
||||
},
|
||||
{
|
||||
name: "seal_contacts_department_get",
|
||||
name: "sealContactsDepartmentGet",
|
||||
description: "获取指定通讯录部门的详细信息",
|
||||
parameters: z.object({
|
||||
departmentId: z.string().describe("部门 ID")
|
||||
@@ -19,7 +19,7 @@ export const contactsCapabilities = [
|
||||
api.getDepartment(client, params.departmentId)
|
||||
},
|
||||
{
|
||||
name: "seal_contacts_department_children_list",
|
||||
name: "sealContactsDepartmentChildrenList",
|
||||
description: "列出指定通讯录部门的直接子部门",
|
||||
parameters: z.object({
|
||||
departmentId: z.string().describe("部门 ID")
|
||||
@@ -28,7 +28,7 @@ export const contactsCapabilities = [
|
||||
api.listDepartmentChildren(client, params.departmentId)
|
||||
},
|
||||
{
|
||||
name: "seal_contacts_department_users_list",
|
||||
name: "sealContactsDepartmentUsersList",
|
||||
description: "列出指定通讯录部门下的用户",
|
||||
parameters: z.object({
|
||||
departmentId: z.string().describe("部门 ID")
|
||||
@@ -37,7 +37,7 @@ export const contactsCapabilities = [
|
||||
api.listDepartmentUsers(client, params.departmentId)
|
||||
},
|
||||
{
|
||||
name: "seal_contacts_last_sync_time_get",
|
||||
name: "sealContactsLastSyncTimeGet",
|
||||
description: "查询通讯录最后同步时间",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.getContactsLastSyncTime(client)
|
||||
|
||||
@@ -18,7 +18,7 @@ const {
|
||||
|
||||
export const deployCapabilities = [
|
||||
{
|
||||
name: "seal_deploy_hosecloud_requirements",
|
||||
name: "sealDeployHosecloudRequirements",
|
||||
description: "获取 Seal AI 审批发布到合思费控所需配置字段与说明",
|
||||
parameters: z.object({}),
|
||||
handler: async () => {
|
||||
@@ -39,7 +39,7 @@ export const deployCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_deploy_hosecloud_list",
|
||||
name: "sealDeployHosecloudList",
|
||||
description: "列出当前企业【Seal AI 审批发布到合思费控】的集成配置列表",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -52,7 +52,7 @@ export const deployCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_deploy_hosecloud_get",
|
||||
name: "sealDeployHosecloudGet",
|
||||
description: "查询【Seal AI 审批发布到合思费控】的单项配置详情",
|
||||
parameters: z.object({
|
||||
signKey: z.string().describe("合思集成 sign-key")
|
||||
@@ -69,7 +69,7 @@ export const deployCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_deploy_hosecloud_status",
|
||||
name: "sealDeployHosecloudStatus",
|
||||
description: "检查【Seal AI 审批发布到合思费控】与多平台集成状态",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -83,7 +83,7 @@ export const deployCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_deploy_hosecloud_configure",
|
||||
name: "sealDeployHosecloudConfigure",
|
||||
description: "自动探测平台并保存【Seal AI 审批发布到合思费控】集成配置",
|
||||
parameters: z.object({
|
||||
// Optional in the schema because the handler accepts two spellings of the
|
||||
@@ -185,7 +185,7 @@ export const deployCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_deploy_hosecloud_sync",
|
||||
name: "sealDeployHosecloudSync",
|
||||
description: "一键将 Seal AI 审核配置同步发布到合思费控审批流",
|
||||
parameters: z.object({
|
||||
signKey: z.string().describe("合思集成 sign-key")
|
||||
|
||||
@@ -8,25 +8,25 @@ import type {
|
||||
|
||||
export const identityCapabilities = [
|
||||
{
|
||||
name: "seal_whoami",
|
||||
name: "sealWhoami",
|
||||
description: "查询当前 Seal 用户身份及租户信息",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.getMe(client)
|
||||
},
|
||||
{
|
||||
name: "seal_session_get",
|
||||
name: "sealSessionGet",
|
||||
description: "查询当前 Seal Bearer session、用户和过期时间",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.getSession(client)
|
||||
},
|
||||
{
|
||||
name: "seal_delegation_list",
|
||||
name: "sealDelegationList",
|
||||
description: "查询当前 Seal 租户下的授权链接 (Delegation) 列表",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => api.listDelegations(client)
|
||||
},
|
||||
{
|
||||
name: "seal_delegation_create",
|
||||
name: "sealDelegationCreate",
|
||||
description: "创建新的 Seal 授权链接 (Delegation)",
|
||||
parameters: z.object({
|
||||
note: z.string().optional().describe("授权链接的备注或说明信息")
|
||||
@@ -35,7 +35,7 @@ export const identityCapabilities = [
|
||||
api.createDelegation(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_delegation_revoke",
|
||||
name: "sealDelegationRevoke",
|
||||
description: "撤销/废除指定的 Seal 授权链接 (Delegation)",
|
||||
parameters: z.object({
|
||||
tokenId: z.string().describe("授权链接 ID (delegation record ID)")
|
||||
@@ -44,7 +44,7 @@ export const identityCapabilities = [
|
||||
api.revokeDelegation(client, params.tokenId)
|
||||
},
|
||||
{
|
||||
name: "seal_user_create",
|
||||
name: "sealUserCreate",
|
||||
description: "创建本地 Seal 用户,生成并返回初始随机密码",
|
||||
parameters: z.object({
|
||||
name: z.string().describe("用户姓名"),
|
||||
@@ -58,7 +58,7 @@ export const identityCapabilities = [
|
||||
) => api.createLocalUser(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_user_reset_password",
|
||||
name: "sealUserResetPassword",
|
||||
description: "重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",
|
||||
parameters: z.object({
|
||||
userId: z.string().describe("用户 ID (_id)")
|
||||
@@ -67,7 +67,7 @@ export const identityCapabilities = [
|
||||
api.resetUserPassword(client, params.userId)
|
||||
},
|
||||
{
|
||||
name: "seal_user_get",
|
||||
name: "sealUserGet",
|
||||
description: "获取指定 Seal 用户的详细信息",
|
||||
parameters: z.object({
|
||||
userId: z.string().describe("用户 ID (_id)")
|
||||
@@ -76,7 +76,7 @@ export const identityCapabilities = [
|
||||
api.getUserDetail(client, params.userId)
|
||||
},
|
||||
{
|
||||
name: "seal_user_search",
|
||||
name: "sealUserSearch",
|
||||
description: "按姓名、手机号或邮箱搜索 Seal 成员用户列表",
|
||||
parameters: z.object({
|
||||
keyword: z.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")
|
||||
@@ -85,7 +85,7 @@ export const identityCapabilities = [
|
||||
api.searchUsers(client, params.keyword ?? "")
|
||||
},
|
||||
{
|
||||
name: "seal_user_delete",
|
||||
name: "sealUserDelete",
|
||||
description: "删除指定 Seal 本地用户",
|
||||
parameters: z.object({
|
||||
userId: z.string().describe("用户 ID (_id)")
|
||||
@@ -94,7 +94,7 @@ export const identityCapabilities = [
|
||||
api.deleteLocalUser(client, params.userId)
|
||||
},
|
||||
{
|
||||
name: "seal_user_activate",
|
||||
name: "sealUserActivate",
|
||||
description: "启用/激活已离职的 Seal 用户账号",
|
||||
parameters: z.object({
|
||||
userId: z.string().describe("用户 ID (_id)")
|
||||
@@ -103,7 +103,7 @@ export const identityCapabilities = [
|
||||
api.activateLocalUser(client, params.userId)
|
||||
},
|
||||
{
|
||||
name: "seal_user_delegation_create",
|
||||
name: "sealUserDelegationCreate",
|
||||
description: "为指定 Seal 用户(按用户ID、手机号或姓名)重置密码登录并生成其专属授权链接 (Delegation)",
|
||||
parameters: z.object({
|
||||
userIdOrPhone: z.string().describe("目标用户 ID、手机号或姓名"),
|
||||
|
||||
@@ -29,127 +29,127 @@ export type SealCapability = (typeof sealCapabilities)[number];
|
||||
|
||||
/**
|
||||
* Registry naming boundary: these entries are INTERNAL domain capability handlers, NOT MCP tools.
|
||||
* The `seal_*` strings are identifiers for internal dispatch (`runCapability`), the HTTP adapter
|
||||
* (`POST /api/tool/:name`), and the MCP gateway allow-lists below — the MCP server itself only ever
|
||||
* exposes the `seal_cli` / `seal_cli_write` gateway pair and never these names. CLI verbs such as
|
||||
* `seal-use context` are the only human-facing names (see README "One registry, three doors").
|
||||
* The camelCase `sealXxx` strings are identifiers for internal dispatch (`runCapability`) and for
|
||||
* the MCP gateway allow-lists below — the MCP server itself only ever exposes the
|
||||
* `seal_use_mcp` / `seal_use_mcp_write` gateway pair and never these names. CLI verbs such as
|
||||
* `seal-use context` are the only human-facing names (see README "One registry, two doors").
|
||||
*
|
||||
* MCP read/write classification for the capability registry.
|
||||
*
|
||||
* The two sets are exhaustive by construction: `capabilities.test.ts` asserts they partition `sealCapabilities`
|
||||
* exactly, so a newly added capability fails the suite until it is classified here. The read-only MCP tool
|
||||
* (`seal_cli`) may only invoke names in {@link SEAL_READ_ONLY_CAPABILITIES}; everything else is reachable
|
||||
* solely through `seal_cli_write`.
|
||||
* (`seal_use_mcp`) may only invoke names in {@link SEAL_READ_ONLY_CAPABILITIES}; everything else is reachable
|
||||
* solely through `seal_use_mcp_write`.
|
||||
*
|
||||
* Read-only means it reads tenant state, or writes only a local file. Anything that creates, updates,
|
||||
* deletes, publishes, pushes, replays, uploads, activates or mints a credential counts as mutating —
|
||||
* including when it reads like a query. `seal_insight_record_analyze` is the instructive case: it
|
||||
* including when it reads like a query. `sealInsightRecordAnalyze` is the instructive case: it
|
||||
* sounds like a read but issues a POST that starts an analysis server-side.
|
||||
*/
|
||||
export const SEAL_READ_ONLY_CAPABILITIES: ReadonlySet<string> = new Set([
|
||||
"seal_approval_context_get",
|
||||
"seal_approval_document_get",
|
||||
"seal_approval_documents_list",
|
||||
"seal_approval_rule_get",
|
||||
"seal_approval_rule_version_diff",
|
||||
"seal_approval_rule_version_get",
|
||||
"seal_approval_rule_versions_list",
|
||||
"seal_approval_rules_lint",
|
||||
"seal_approval_rules_list",
|
||||
"seal_approval_rules_pull",
|
||||
"seal_approval_run_attachments_get",
|
||||
"seal_approval_run_cited_rules_get",
|
||||
"seal_approval_run_diagnose",
|
||||
"seal_approval_run_document_summary_get",
|
||||
"seal_approval_run_flow_get",
|
||||
"seal_approval_run_get",
|
||||
"seal_approval_run_langfuse_bridge_get",
|
||||
"seal_approval_run_pick",
|
||||
"seal_approval_run_result_get",
|
||||
"seal_approval_run_url_get",
|
||||
"seal_approval_runs_count",
|
||||
"seal_approval_runs_export",
|
||||
"seal_approval_runs_search",
|
||||
"seal_approval_runs_stats",
|
||||
"seal_approval_runs_summary",
|
||||
"seal_approval_search",
|
||||
"seal_approval_style_preferences_get",
|
||||
"seal_billing_features_list",
|
||||
"seal_billing_plans_list",
|
||||
"seal_billing_status_get",
|
||||
"seal_contacts_department_children_list",
|
||||
"seal_contacts_department_get",
|
||||
"seal_contacts_department_users_list",
|
||||
"seal_contacts_departments_root_list",
|
||||
"seal_contacts_last_sync_time_get",
|
||||
"seal_delegation_list",
|
||||
"seal_deploy_hosecloud_get",
|
||||
"seal_deploy_hosecloud_list",
|
||||
"seal_deploy_hosecloud_requirements",
|
||||
"seal_deploy_hosecloud_status",
|
||||
"seal_expenses_list",
|
||||
"seal_insight_export",
|
||||
"seal_insight_performance_get",
|
||||
"seal_insight_risks_by_tag_get",
|
||||
"seal_insight_stats_get",
|
||||
"seal_invoices_list",
|
||||
"seal_llm_config_get",
|
||||
"seal_llm_providers_list",
|
||||
"seal_permissions_available_list",
|
||||
"seal_permissions_configs_list",
|
||||
"seal_preference_get",
|
||||
"seal_preference_thinking_depth_policies_list",
|
||||
"seal_session_get",
|
||||
"seal_simulation_batch_get",
|
||||
"seal_simulation_batch_records_get",
|
||||
"seal_simulation_batch_status",
|
||||
"seal_simulation_batch_wait",
|
||||
"seal_simulation_batches_list",
|
||||
"seal_simulation_feishu_approval_definitions_list",
|
||||
"seal_simulation_integrations_get",
|
||||
"seal_simulation_specifications_list",
|
||||
"seal_simulation_templates_get",
|
||||
"seal_user_get",
|
||||
"seal_user_search",
|
||||
"seal_webhook_get",
|
||||
"seal_webhook_list",
|
||||
"seal_webhook_ready",
|
||||
"seal_whoami"
|
||||
"sealApprovalContextGet",
|
||||
"sealApprovalDocumentGet",
|
||||
"sealApprovalDocumentsList",
|
||||
"sealApprovalRuleGet",
|
||||
"sealApprovalRuleVersionDiff",
|
||||
"sealApprovalRuleVersionGet",
|
||||
"sealApprovalRuleVersionsList",
|
||||
"sealApprovalRulesLint",
|
||||
"sealApprovalRulesList",
|
||||
"sealApprovalRulesPull",
|
||||
"sealApprovalRunAttachmentsGet",
|
||||
"sealApprovalRunCitedRulesGet",
|
||||
"sealApprovalRunDiagnose",
|
||||
"sealApprovalRunDocumentSummaryGet",
|
||||
"sealApprovalRunFlowGet",
|
||||
"sealApprovalRunGet",
|
||||
"sealApprovalRunLangfuseBridgeGet",
|
||||
"sealApprovalRunPick",
|
||||
"sealApprovalRunResultGet",
|
||||
"sealApprovalRunUrlGet",
|
||||
"sealApprovalRunsCount",
|
||||
"sealApprovalRunsExport",
|
||||
"sealApprovalRunsSearch",
|
||||
"sealApprovalRunsStats",
|
||||
"sealApprovalRunsSummary",
|
||||
"sealApprovalSearch",
|
||||
"sealApprovalStylePreferencesGet",
|
||||
"sealBillingFeaturesList",
|
||||
"sealBillingPlansList",
|
||||
"sealBillingStatusGet",
|
||||
"sealContactsDepartmentChildrenList",
|
||||
"sealContactsDepartmentGet",
|
||||
"sealContactsDepartmentUsersList",
|
||||
"sealContactsDepartmentsRootList",
|
||||
"sealContactsLastSyncTimeGet",
|
||||
"sealDelegationList",
|
||||
"sealDeployHosecloudGet",
|
||||
"sealDeployHosecloudList",
|
||||
"sealDeployHosecloudRequirements",
|
||||
"sealDeployHosecloudStatus",
|
||||
"sealExpensesList",
|
||||
"sealInsightExport",
|
||||
"sealInsightPerformanceGet",
|
||||
"sealInsightRisksByTagGet",
|
||||
"sealInsightStatsGet",
|
||||
"sealInvoicesList",
|
||||
"sealLlmConfigGet",
|
||||
"sealLlmProvidersList",
|
||||
"sealPermissionsAvailableList",
|
||||
"sealPermissionsConfigsList",
|
||||
"sealPreferenceGet",
|
||||
"sealPreferenceThinkingDepthPoliciesList",
|
||||
"sealSessionGet",
|
||||
"sealSimulationBatchGet",
|
||||
"sealSimulationBatchRecordsGet",
|
||||
"sealSimulationBatchStatus",
|
||||
"sealSimulationBatchWait",
|
||||
"sealSimulationBatchesList",
|
||||
"sealSimulationFeishuApprovalDefinitionsList",
|
||||
"sealSimulationIntegrationsGet",
|
||||
"sealSimulationSpecificationsList",
|
||||
"sealSimulationTemplatesGet",
|
||||
"sealUserGet",
|
||||
"sealUserSearch",
|
||||
"sealWebhookGet",
|
||||
"sealWebhookList",
|
||||
"sealWebhookReady",
|
||||
"sealWhoami"
|
||||
]);
|
||||
|
||||
export const SEAL_MUTATING_CAPABILITIES: ReadonlySet<string> = new Set([
|
||||
"seal_approval_delete_document",
|
||||
"seal_approval_document_create",
|
||||
"seal_approval_document_update",
|
||||
"seal_approval_rule_create",
|
||||
"seal_approval_rule_delete",
|
||||
"seal_approval_rule_update",
|
||||
"seal_approval_rule_version_publish",
|
||||
"seal_approval_rules_clear",
|
||||
"seal_approval_rules_push",
|
||||
"seal_approval_style_preferences_update",
|
||||
"seal_delegation_create",
|
||||
"seal_delegation_revoke",
|
||||
"seal_deploy_hosecloud_configure",
|
||||
"seal_deploy_hosecloud_sync",
|
||||
"seal_insight_record_analyze",
|
||||
"seal_preference_decision_update",
|
||||
"seal_preference_thinking_depth_policies_remove",
|
||||
"seal_preference_thinking_depth_policies_upsert",
|
||||
"seal_preference_thinking_depth_set",
|
||||
"seal_simulation_batch_clean",
|
||||
"seal_simulation_batch_create",
|
||||
"seal_simulation_material_package_upload",
|
||||
"seal_user_activate",
|
||||
"seal_user_create",
|
||||
"seal_user_delegation_create",
|
||||
"seal_user_delete",
|
||||
"seal_user_reset_password",
|
||||
"seal_webhook_add",
|
||||
"seal_webhook_delete",
|
||||
"seal_webhook_material_pack",
|
||||
"seal_webhook_replay",
|
||||
"seal_webhook_update"
|
||||
"sealApprovalDeleteDocument",
|
||||
"sealApprovalDocumentCreate",
|
||||
"sealApprovalDocumentUpdate",
|
||||
"sealApprovalRuleCreate",
|
||||
"sealApprovalRuleDelete",
|
||||
"sealApprovalRuleUpdate",
|
||||
"sealApprovalRuleVersionPublish",
|
||||
"sealApprovalRulesClear",
|
||||
"sealApprovalRulesPush",
|
||||
"sealApprovalStylePreferencesUpdate",
|
||||
"sealDelegationCreate",
|
||||
"sealDelegationRevoke",
|
||||
"sealDeployHosecloudConfigure",
|
||||
"sealDeployHosecloudSync",
|
||||
"sealInsightRecordAnalyze",
|
||||
"sealPreferenceDecisionUpdate",
|
||||
"sealPreferenceThinkingDepthPoliciesRemove",
|
||||
"sealPreferenceThinkingDepthPoliciesUpsert",
|
||||
"sealPreferenceThinkingDepthSet",
|
||||
"sealSimulationBatchClean",
|
||||
"sealSimulationBatchCreate",
|
||||
"sealSimulationMaterialPackageUpload",
|
||||
"sealUserActivate",
|
||||
"sealUserCreate",
|
||||
"sealUserDelegationCreate",
|
||||
"sealUserDelete",
|
||||
"sealUserResetPassword",
|
||||
"sealWebhookAdd",
|
||||
"sealWebhookDelete",
|
||||
"sealWebhookMaterialPack",
|
||||
"sealWebhookReplay",
|
||||
"sealWebhookUpdate"
|
||||
]);
|
||||
|
||||
export function isReadOnlySealCapability(name: string): boolean {
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
|
||||
export const insightCapabilities = [
|
||||
{
|
||||
name: "seal_insight_stats_get",
|
||||
name: "sealInsightStatsGet",
|
||||
description: "查询智能洞察风险标签统计及分析状态",
|
||||
parameters: z.object({
|
||||
startDate: z.string().optional().describe("统计开始时间(ISO 8601)"),
|
||||
@@ -21,7 +21,7 @@ export const insightCapabilities = [
|
||||
) => api.getInsightStats(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_insight_risks_by_tag_get",
|
||||
name: "sealInsightRisksByTagGet",
|
||||
description: "按风险标签查询智能洞察风险单据明细及 AI 分析依据",
|
||||
parameters: z.object({
|
||||
tagId: z.string().describe("风险标签 ID(如 B.1.1、B.1.6)"),
|
||||
@@ -34,7 +34,7 @@ export const insightCapabilities = [
|
||||
) => api.getInsightRisksByTag(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_insight_performance_get",
|
||||
name: "sealInsightPerformanceGet",
|
||||
description: "查询智能洞察审核效能指标(自动化率、准确率等)及决策流向桑基图",
|
||||
parameters: z.object({
|
||||
startDate: z.union([z.string(), z.number()]).optional().describe("统计开始时间(ISO 8601 或毫秒时间戳)"),
|
||||
@@ -46,7 +46,7 @@ export const insightCapabilities = [
|
||||
) => api.getInsightPerformance(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_insight_record_analyze",
|
||||
name: "sealInsightRecordAnalyze",
|
||||
description: "对指定的审批单运行记录按需触发智能洞察风险分析",
|
||||
parameters: z.object({
|
||||
recordId: z.string().describe("审批单运行记录 ID (recordId)")
|
||||
@@ -57,7 +57,7 @@ export const insightCapabilities = [
|
||||
) => api.analyzeInsightRecord(client, params.recordId)
|
||||
},
|
||||
{
|
||||
name: "seal_insight_export",
|
||||
name: "sealInsightExport",
|
||||
description: "导出智能洞察风险研报为高保真 Excel 文件(含效能概览、Top风险标签、风险单据穿透明细)",
|
||||
parameters: z.object({
|
||||
startDate: z.string().optional().describe("统计开始时间(ISO 8601 或时间戳)"),
|
||||
@@ -74,7 +74,7 @@ export const insightCapabilities = [
|
||||
) => exportInsightReportToExcel(client, context.corp, params)
|
||||
},
|
||||
{
|
||||
name: "seal_expenses_list",
|
||||
name: "sealExpensesList",
|
||||
description: "分页查询费用明细",
|
||||
parameters: z.object({
|
||||
offset: z.number().int().nonnegative().optional(),
|
||||
@@ -86,7 +86,7 @@ export const insightCapabilities = [
|
||||
handler: async (client: KyInstance, params: api.DataListParams) => api.listExpenses(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_invoices_list",
|
||||
name: "sealInvoicesList",
|
||||
description: "分页查询进项发票",
|
||||
parameters: z.object({
|
||||
offset: z.number().int().nonnegative().optional(),
|
||||
|
||||
@@ -17,7 +17,7 @@ const {
|
||||
|
||||
export const preferenceCapabilities = [
|
||||
{
|
||||
name: "seal_preference_get",
|
||||
name: "sealPreferenceGet",
|
||||
description: "获取当前决策偏好、思考深度偏好与绑定的规则版本",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -30,7 +30,7 @@ export const preferenceCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_preference_decision_update",
|
||||
name: "sealPreferenceDecisionUpdate",
|
||||
description: "修改审核决策偏好(立即影响当前运行中的审核智能体及后续决策)",
|
||||
parameters: z.object({
|
||||
explicitApprove: z.string().optional(),
|
||||
@@ -57,7 +57,7 @@ export const preferenceCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_preference_thinking_depth_set",
|
||||
name: "sealPreferenceThinkingDepthSet",
|
||||
description: "修改默认思考深度(medium 或 high)",
|
||||
parameters: z.object({
|
||||
defaultLevel: z.enum(["medium", "high"]).describe("默认思考深度"),
|
||||
@@ -80,7 +80,7 @@ export const preferenceCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_preference_thinking_depth_policies_list",
|
||||
name: "sealPreferenceThinkingDepthPoliciesList",
|
||||
description: "列出思考深度路由策略列表",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -91,7 +91,7 @@ export const preferenceCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_preference_thinking_depth_policies_upsert",
|
||||
name: "sealPreferenceThinkingDepthPoliciesUpsert",
|
||||
description: "新增或修改思考深度路由策略",
|
||||
parameters: ThinkingPolicySchema.extend({
|
||||
dryRun: z.boolean().optional().describe("只返回前后配置 Diff,不执行写入")
|
||||
@@ -118,7 +118,7 @@ export const preferenceCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_preference_thinking_depth_policies_remove",
|
||||
name: "sealPreferenceThinkingDepthPoliciesRemove",
|
||||
description: "删除一条思考深度路由策略",
|
||||
parameters: z.object({
|
||||
policyId: z.string().describe("路由策略 ID"),
|
||||
|
||||
@@ -49,7 +49,7 @@ function attachCrossEnvRule(context: CapabilityContext, rule: Record<string, unk
|
||||
|
||||
export const rulesCapabilities = [
|
||||
{
|
||||
name: "seal_approval_rules_list",
|
||||
name: "sealApprovalRulesList",
|
||||
description: "列出 Seal 审批规则(默认当前草稿,传 version='latest' 或版本号则列出对应已发布版本);支持 countOnly、fields、limit",
|
||||
parameters: z.object({
|
||||
version: z.string().optional().describe("可选发布版本号或 'latest';不传则读取当前草稿"),
|
||||
@@ -103,7 +103,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rules_clear",
|
||||
name: "sealApprovalRulesClear",
|
||||
description: "清空 Seal 当前草稿审批规则;用于测试环境导入规则前重置草稿规则集",
|
||||
parameters: z.object({
|
||||
dryRun: z.boolean().optional().describe("只预览将删除的规则数量,不执行删除"),
|
||||
@@ -172,7 +172,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_create",
|
||||
name: "sealApprovalRuleCreate",
|
||||
description: "新建 Seal 草稿审批规则",
|
||||
parameters: z.object({
|
||||
description: z.string().describe("规则描述"),
|
||||
@@ -189,7 +189,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_update",
|
||||
name: "sealApprovalRuleUpdate",
|
||||
description: "更新 Seal 草稿审批规则;支持 --if-unchanged 乐观并发预检(草稿在基准后被他人修改则拒绝)",
|
||||
parameters: z.object({
|
||||
ruleId: z.string().describe("规则 ID 或规则编号 code"),
|
||||
@@ -274,7 +274,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_delete",
|
||||
name: "sealApprovalRuleDelete",
|
||||
description: "删除 Seal 草稿审批规则",
|
||||
parameters: z.object({
|
||||
ruleId: z.string().describe("规则 ID 或规则编号 code")
|
||||
@@ -299,7 +299,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_versions_list",
|
||||
name: "sealApprovalRuleVersionsList",
|
||||
description: "列出 Seal 已发布审批规则版本摘要,不展开每个版本的规则快照",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -312,7 +312,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_version_get",
|
||||
name: "sealApprovalRuleVersionGet",
|
||||
description: "获取指定 Seal 已发布审批规则版本详情,包含该版本的规则快照",
|
||||
parameters: z.object({
|
||||
versionId: z.string().optional().describe("规则版本 ID"),
|
||||
@@ -340,7 +340,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_version_diff",
|
||||
name: "sealApprovalRuleVersionDiff",
|
||||
description: "对比两个已发布审批规则版本;优先使用本地持久化稳定 ID,没有时回退到 code",
|
||||
parameters: z.object({
|
||||
from: z.string().min(1).describe("起始规则版本号、版本 ID 或 latest"),
|
||||
@@ -388,7 +388,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_version_publish",
|
||||
name: "sealApprovalRuleVersionPublish",
|
||||
description: "发布 Seal 草稿审批规则为新版本",
|
||||
parameters: z.object({
|
||||
versionName: z.string().describe("版本名称")
|
||||
@@ -403,7 +403,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_get",
|
||||
name: "sealApprovalRuleGet",
|
||||
description: "按规则编号 code(或规则 ID)获取单条规则详情;默认读取当前草稿(含规则 ID),指定 version 或 recordId 时读取对应发布版本快照",
|
||||
parameters: z.object({
|
||||
versionId: z.string().optional().describe("规则版本 ID"),
|
||||
@@ -466,7 +466,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rules_lint",
|
||||
name: "sealApprovalRulesLint",
|
||||
description: "对 Seal 本地规则文件、草稿审批规则或指定发布版本规则进行质量与可执行性检查(模糊词、悬空例外检测)",
|
||||
parameters: z.object({
|
||||
file: z.string().optional().describe("指定本地规则文件路径进行离线质检(支持 .json),0网络请求、不污染远端草稿"),
|
||||
@@ -566,7 +566,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rules_pull",
|
||||
name: "sealApprovalRulesPull",
|
||||
description: "从 Seal 远端拉取草稿或指定版本规则,保存至本地规则文件(支持离线编辑与本地 Lint,绝不污染远端草稿)",
|
||||
parameters: z.object({
|
||||
version: z.string().optional().describe("指定拉取的历史发布版本号或 ID(如 16 或 latest),不传默认拉取当前草稿规则"),
|
||||
@@ -639,7 +639,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rules_push",
|
||||
name: "sealApprovalRulesPush",
|
||||
description: "将本地规则文件增量同步到远端草稿;按规则 ID 更新/删除并保留未变更规则,支持直接发布为正式版本",
|
||||
parameters: z.object({
|
||||
file: z.string().optional().describe("要推送的本地规则文件路径,默认为 ./rules.local.json"),
|
||||
@@ -762,7 +762,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_documents_list",
|
||||
name: "sealApprovalDocumentsList",
|
||||
description: "列出 Seal 审批知识文档",
|
||||
parameters: z.object({
|
||||
scenarios: z.array(z.string()).optional().describe("场景过滤"),
|
||||
@@ -775,7 +775,7 @@ export const rulesCapabilities = [
|
||||
) => api.listApprovalDocuments(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_approval_document_get",
|
||||
name: "sealApprovalDocumentGet",
|
||||
description: "获取 Seal 审批知识文档详情",
|
||||
parameters: z.object({
|
||||
documentId: z.string().describe("文档 ID")
|
||||
@@ -784,7 +784,7 @@ export const rulesCapabilities = [
|
||||
api.getApprovalDocument(client, params.documentId)
|
||||
},
|
||||
{
|
||||
name: "seal_approval_document_create",
|
||||
name: "sealApprovalDocumentCreate",
|
||||
description: "新建 Seal 审批知识文档",
|
||||
parameters: z.object({
|
||||
title: z.string(),
|
||||
@@ -811,7 +811,7 @@ export const rulesCapabilities = [
|
||||
) => api.createApprovalDocument(client, params)
|
||||
},
|
||||
{
|
||||
name: "seal_approval_document_update",
|
||||
name: "sealApprovalDocumentUpdate",
|
||||
description: "更新 Seal 审批知识文档",
|
||||
parameters: z.object({
|
||||
documentId: z.string(),
|
||||
@@ -843,7 +843,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_delete_document",
|
||||
name: "sealApprovalDeleteDocument",
|
||||
description: "删除 Seal 审批知识文档",
|
||||
parameters: z.object({
|
||||
documentId: z.string().describe("知识文档 ID")
|
||||
@@ -852,7 +852,7 @@ export const rulesCapabilities = [
|
||||
api.deleteApprovalDocument(client, params.documentId)
|
||||
},
|
||||
{
|
||||
name: "seal_approval_search",
|
||||
name: "sealApprovalSearch",
|
||||
description: "按关键词组检索 Seal 审批规则、审批文档和审批偏好配置,返回命中位置、字段、行号和前后三行上下文",
|
||||
parameters: z.object({
|
||||
keywords: z.array(z.string()).min(1).describe("关键词组"),
|
||||
@@ -894,7 +894,7 @@ export const rulesCapabilities = [
|
||||
) => searchApprovalContent(client, context.corp, params)
|
||||
},
|
||||
{
|
||||
name: "seal_approval_context_get",
|
||||
name: "sealApprovalContextGet",
|
||||
description: "聚合获取 Seal 现有审批规则、审批文档和审批风格偏好",
|
||||
parameters: z.object({
|
||||
documentLimit: z.number().int().positive().optional().describe("最多返回的审批文档数量"),
|
||||
@@ -932,7 +932,7 @@ export const rulesCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_style_preferences_get",
|
||||
name: "sealApprovalStylePreferencesGet",
|
||||
description: "获取 Seal 审批风格偏好配置",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance, _params: unknown, context: CapabilityContext) =>
|
||||
@@ -942,7 +942,7 @@ export const rulesCapabilities = [
|
||||
)
|
||||
},
|
||||
{
|
||||
name: "seal_approval_style_preferences_update",
|
||||
name: "sealApprovalStylePreferencesUpdate",
|
||||
description: "更新 Seal 审批风格偏好配置",
|
||||
parameters: z.object({
|
||||
tone: z.string().optional(),
|
||||
|
||||
@@ -20,7 +20,7 @@ const {
|
||||
|
||||
export const simulationCapabilities = [
|
||||
{
|
||||
name: "seal_simulation_feishu_approval_definitions_list",
|
||||
name: "sealSimulationFeishuApprovalDefinitionsList",
|
||||
description: "列出飞书模拟测试可用的审批定义,便于选择 approvalCode",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -29,7 +29,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_batch_records_get",
|
||||
name: "sealSimulationBatchRecordsGet",
|
||||
description: "获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",
|
||||
parameters: z.object({
|
||||
batchId: z.string().describe("simulation batch ID"),
|
||||
@@ -53,7 +53,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_batch_create",
|
||||
name: "sealSimulationBatchCreate",
|
||||
description: "创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;默认幂等:复用窗口内同 flow-ids/packageIds 的既有批次直接返回不重复扣费(--force 跳过);其他取数模式通过 rawParams 预留透传。",
|
||||
parameters: z.object({
|
||||
mode: z.enum(["hosecloud", "material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),
|
||||
@@ -185,7 +185,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_batches_list",
|
||||
name: "sealSimulationBatchesList",
|
||||
description: "列出 Seal 模拟测试批次摘要(含状态、统计计数与展示摘要)",
|
||||
parameters: z.object({
|
||||
limit: z.number().int().positive().max(100).optional().describe("最多返回批次数量, 默认 50")
|
||||
@@ -203,7 +203,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_batch_get",
|
||||
name: "sealSimulationBatchGet",
|
||||
description: "获取某一次 Seal 模拟测试批次的详情,包含服务端回显的创建参数、展示摘要和任务统计",
|
||||
parameters: z.object({
|
||||
batchId: z.string().describe("simulation batch ID")
|
||||
@@ -219,7 +219,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_batch_status",
|
||||
name: "sealSimulationBatchStatus",
|
||||
description: "单次读取 Seal 模拟批次状态,不阻塞等待;适合根据异步票据轮询",
|
||||
parameters: z.object({
|
||||
batchId: z.string().describe("simulation batch ID")
|
||||
@@ -245,7 +245,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_templates_get",
|
||||
name: "sealSimulationTemplatesGet",
|
||||
description: "列出 Seal 模拟测试模板(我的模板,保存常用配置快速复用)",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -267,7 +267,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_integrations_get",
|
||||
name: "sealSimulationIntegrationsGet",
|
||||
description: "查询模拟测试可用的来源集成状态与合思集成选项(signKey 等)",
|
||||
parameters: z.object({}),
|
||||
handler: async (client: KyInstance) => {
|
||||
@@ -279,7 +279,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_material_package_upload",
|
||||
name: "sealSimulationMaterialPackageUpload",
|
||||
description: "上传材料包 ZIP 到 Seal 模拟测试;服务端解析 Excel/AI 推断配置并返回材料包 id 与 schemaConfig(字段映射确认后用于创建模拟批次)",
|
||||
parameters: z.object({
|
||||
filePath: z.string().describe("材料包 ZIP 文件路径(含 信息表.xlsx 与附件)")
|
||||
@@ -303,7 +303,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_batch_wait",
|
||||
name: "sealSimulationBatchWait",
|
||||
description: "等待 Seal 模拟测试批次完成(轮询状态直到 completed/failed/canceled 或超时)",
|
||||
parameters: z.object({
|
||||
batchId: z.string().describe("模拟批次 ID"),
|
||||
@@ -339,7 +339,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_batch_clean",
|
||||
name: "sealSimulationBatchClean",
|
||||
description: "删除模拟测试批次产生的测试数据",
|
||||
parameters: z.object({
|
||||
batchId: z.string().describe("模拟批次 ID")
|
||||
@@ -354,7 +354,7 @@ export const simulationCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_simulation_specifications_list",
|
||||
name: "sealSimulationSpecificationsList",
|
||||
description: "列出指定合思集成可用的单据模板列表",
|
||||
parameters: z.object({
|
||||
signKey: z.string().optional().describe("合思集成 sign-key")
|
||||
|
||||
@@ -22,7 +22,7 @@ function rejectsWith(toolName: string, params: Record<string, unknown>): string
|
||||
|
||||
describe("parseCapabilityParams", () => {
|
||||
test("accepts valid params and returns the exact object it was given", () => {
|
||||
const target = tool("seal_user_create");
|
||||
const target = tool("sealUserCreate");
|
||||
const params = { name: "张三", phone: "13800001111", departmentIds: ["d1"] };
|
||||
|
||||
// Identity matters: handlers read keys the schema does not declare, so the
|
||||
@@ -31,19 +31,19 @@ describe("parseCapabilityParams", () => {
|
||||
});
|
||||
|
||||
test("names the missing required field instead of letting the handler crash on undefined", () => {
|
||||
const message = rejectsWith("seal_user_create", { phone: "13800001111" });
|
||||
expect(message).toContain("seal_user_create");
|
||||
const message = rejectsWith("sealUserCreate", { phone: "13800001111" });
|
||||
expect(message).toContain("sealUserCreate");
|
||||
expect(message).toContain("name");
|
||||
});
|
||||
|
||||
test("enforces the value bound a handler would otherwise silently accept", () => {
|
||||
// limit is capped at 100 in the schema; nothing in the handler checks it.
|
||||
const message = rejectsWith("seal_approval_runs_search", { limit: 9999 });
|
||||
const message = rejectsWith("sealApprovalRunsSearch", { limit: 9999 });
|
||||
expect(message).toContain("limit");
|
||||
});
|
||||
|
||||
test("coerces query-string values before checking, without touching the original", () => {
|
||||
const target = tool("seal_approval_runs_search");
|
||||
const target = tool("sealApprovalRunsSearch");
|
||||
const params = { limit: "50", includeBridge: "true" } as Record<string, unknown>;
|
||||
|
||||
// /v1/* passes url.searchParams through: everything arrives as a string,
|
||||
@@ -55,7 +55,7 @@ describe("parseCapabilityParams", () => {
|
||||
});
|
||||
|
||||
test("still rejects a string that merely looks like a wire value", () => {
|
||||
const message = rejectsWith("seal_approval_runs_search", { limit: "abc" });
|
||||
const message = rejectsWith("sealApprovalRunsSearch", { limit: "abc" });
|
||||
expect(message).toContain("limit");
|
||||
});
|
||||
|
||||
@@ -63,25 +63,25 @@ describe("parseCapabilityParams", () => {
|
||||
// `?fields=id,code` on /v1/approval/rules: today the handler receives a
|
||||
// string and pickRuleFields iterates its characters, returning empty
|
||||
// objects. Validation splits it so the documented form actually works.
|
||||
expect(parseCapabilityParams(tool("seal_approval_rules_list"), { fields: "id,code" })).toEqual({
|
||||
expect(parseCapabilityParams(tool("sealApprovalRulesList"), { fields: "id,code" })).toEqual({
|
||||
fields: "id,code"
|
||||
});
|
||||
expect(rejectsWith("seal_approval_rules_list", { fields: "id,not-a-field" })).toContain("fields");
|
||||
expect(rejectsWith("sealApprovalRulesList", { fields: "id,not-a-field" })).toContain("fields");
|
||||
});
|
||||
|
||||
test("ignores undeclared keys rather than rejecting the request", () => {
|
||||
// z.object is non-strict: an extra HTTP body key is a compatibility
|
||||
// non-event, not an error. This gate checks declared params only.
|
||||
const target = tool("seal_approval_runs_search");
|
||||
const target = tool("sealApprovalRunsSearch");
|
||||
expect(parseCapabilityParams(target, { status: "TERMINATED", corp: "corp-a", stray: 1 })).toBeTypeOf("object");
|
||||
});
|
||||
|
||||
test("lets the legacy credential aliases through to the handler that supports them", () => {
|
||||
// seal_deploy_hosecloud_configure has always accepted appKey/appSecurity
|
||||
// sealDeployHosecloudConfigure has always accepted appKey/appSecurity
|
||||
// alongside apiKey/apiSecret; a schema that declared only apiKey as
|
||||
// required would have blocked that documented path.
|
||||
expect(() =>
|
||||
parseCapabilityParams(tool("seal_deploy_hosecloud_configure"), {
|
||||
parseCapabilityParams(tool("sealDeployHosecloudConfigure"), {
|
||||
appKey: "key-1",
|
||||
appSecurity: "secret-1",
|
||||
mode: "assisted"
|
||||
|
||||
@@ -17,7 +17,7 @@ import type { SealCapability } from "./index.js";
|
||||
* Two deliberate properties:
|
||||
*
|
||||
* - **Original params are returned, not `result.data`.** Handlers read keys the
|
||||
* schema does not declare — `seal_deploy_hosecloud_configure` accepts the
|
||||
* schema does not declare — `sealDeployHosecloudConfigure` accepts the
|
||||
* legacy `appKey`/`appSecurity` aliases alongside `apiKey`/`apiSecret` — and
|
||||
* zod's default strip would silently drop them. Validation must never change
|
||||
* what a working handler receives, only block what would have failed anyway.
|
||||
|
||||
@@ -31,7 +31,7 @@ const {
|
||||
|
||||
export const webhookCapabilities = [
|
||||
{
|
||||
name: "seal_webhook_list",
|
||||
name: "sealWebhookList",
|
||||
description: "列出当前 Seal 租户的 Webhook 集成,可按 ID、名称或 URL 查找",
|
||||
parameters: z.object({
|
||||
query: z.string().optional().describe("按集成 ID、名称或 URL 做本地包含匹配"),
|
||||
@@ -56,7 +56,7 @@ export const webhookCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_webhook_get",
|
||||
name: "sealWebhookGet",
|
||||
description: "按 Webhook 集成 ID 或名称精确查找一条集成",
|
||||
parameters: z.object({
|
||||
selector: z.string().min(1).describe("Webhook 集成 ID 或名称"),
|
||||
@@ -78,7 +78,7 @@ export const webhookCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_webhook_add",
|
||||
name: "sealWebhookAdd",
|
||||
description: "新增 Webhook 集成;使用 dryRun=true 可只预览请求而不持久化",
|
||||
parameters: z.object({
|
||||
name: z.string().min(1).describe("集成名称"),
|
||||
@@ -128,7 +128,7 @@ export const webhookCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_webhook_update",
|
||||
name: "sealWebhookUpdate",
|
||||
description: "更新现有 Webhook 集成;使用 dryRun=true 可只预览请求而不持久化",
|
||||
parameters: z.object({
|
||||
selector: z.string().min(1).describe("Webhook 集成 ID 或名称"),
|
||||
@@ -187,7 +187,7 @@ export const webhookCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_webhook_delete",
|
||||
name: "sealWebhookDelete",
|
||||
description: "删除指定 Webhook 集成;使用 dryRun=true 可只预览请求而不持久化",
|
||||
parameters: z.object({
|
||||
selector: z.string().min(1).describe("Webhook 集成 ID 或名称"),
|
||||
@@ -226,7 +226,7 @@ export const webhookCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_webhook_replay",
|
||||
name: "sealWebhookReplay",
|
||||
description: "将正式(生产)企业或指定企业的审批记录通过 Webhook 渠道重放到测试企业进行规则回归与模拟验证",
|
||||
parameters: z.object({
|
||||
recordId: z.string().optional().describe("待重放的单条审批记录 ID"),
|
||||
@@ -304,7 +304,7 @@ export const webhookCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_webhook_ready",
|
||||
name: "sealWebhookReady",
|
||||
description: "检查当前企业的 Webhook 就绪状态看板(包括企业环境、租户身份、凭证连通性、已激活 Webhook 通道及材料包预检)",
|
||||
parameters: z.object({
|
||||
filePath: z.string().optional().describe("可选的材料包路径(ZIP 或 信息表.xlsx),用于同步做本地预检")
|
||||
@@ -318,7 +318,7 @@ export const webhookCapabilities = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_webhook_material_pack",
|
||||
name: "sealWebhookMaterialPack",
|
||||
description: "将官方材料包格式本地校验、解析并通过 Seal 入站 Webhook 触发 AI 审批;preview 模式不联网,push 模式单通道自动选择",
|
||||
parameters: z.object({
|
||||
filePath: z.string().describe("材料包 ZIP 或 信息表.xlsx 文件路径"),
|
||||
|
||||
@@ -109,7 +109,7 @@ describe("rules-local offline lint tool integration", () => {
|
||||
]
|
||||
});
|
||||
|
||||
const lintCapability = findSealCapability("seal_approval_rules_lint")!;
|
||||
const lintCapability = findSealCapability("sealApprovalRulesLint")!;
|
||||
expect(lintCapability).toBeDefined();
|
||||
|
||||
const result = await lintCapability.handler(
|
||||
@@ -139,7 +139,7 @@ describe("rules-local offline lint tool integration", () => {
|
||||
]
|
||||
});
|
||||
|
||||
const lintCapability = findSealCapability("seal_approval_rules_lint")!;
|
||||
const lintCapability = findSealCapability("sealApprovalRulesLint")!;
|
||||
|
||||
const result = await lintCapability.handler(
|
||||
null as any,
|
||||
|
||||
@@ -529,7 +529,7 @@ describe("findReusableSimulationBatch", () => {
|
||||
|
||||
describe("simulation tool handlers", () => {
|
||||
test("create tool resolves signKey automatically and posts the payload", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_simulation_batch_create");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealSimulationBatchCreate");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
let postedBody: Record<string, unknown> | undefined;
|
||||
@@ -579,7 +579,7 @@ describe("simulation tool handlers", () => {
|
||||
});
|
||||
|
||||
test("create tool reuses a recent identical batch instead of creating a new one", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_simulation_batch_create");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealSimulationBatchCreate");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
let postCalls = 0;
|
||||
@@ -625,7 +625,7 @@ describe("simulation tool handlers", () => {
|
||||
});
|
||||
|
||||
test("create tool force bypasses the reuse check", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_simulation_batch_create");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealSimulationBatchCreate");
|
||||
let posted = false;
|
||||
const client = {
|
||||
get: (url: string) => {
|
||||
@@ -665,7 +665,7 @@ describe("simulation tool handlers", () => {
|
||||
});
|
||||
|
||||
test("create tool creates a new batch when the identical batch is outside the reuse window", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_simulation_batch_create");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealSimulationBatchCreate");
|
||||
let posted = false;
|
||||
const client = {
|
||||
get: (url: string) => {
|
||||
@@ -703,7 +703,7 @@ describe("simulation tool handlers", () => {
|
||||
});
|
||||
|
||||
test("create tool surface exposes mode, flowIds, and rawParams", () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_simulation_batch_create");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealSimulationBatchCreate");
|
||||
const { z } = require("zod") as typeof import("zod");
|
||||
const schema = z.toJSONSchema(tool!.parameters) as { properties?: Record<string, unknown> };
|
||||
expect(Object.keys(schema.properties ?? {})).toEqual(
|
||||
@@ -712,17 +712,17 @@ describe("simulation tool handlers", () => {
|
||||
});
|
||||
|
||||
test("includes the simulation management tool set", () => {
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_batches_list")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_batch_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_batch_status")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_templates_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_integrations_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_batch_records_get")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "seal_simulation_material_package_upload")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationBatchesList")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationBatchGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationBatchStatus")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationTemplatesGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationIntegrationsGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationBatchRecordsGet")).toBeDefined();
|
||||
expect(sealCapabilities.find((item) => item.name === "sealSimulationMaterialPackageUpload")).toBeDefined();
|
||||
});
|
||||
|
||||
test("status tool performs one non-blocking check and exposes the next action", async () => {
|
||||
const tool = sealCapabilities.find((item) => item.name === "seal_simulation_batch_status");
|
||||
const tool = sealCapabilities.find((item) => item.name === "sealSimulationBatchStatus");
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const client = {
|
||||
|
||||
Reference in new issue
Block a user