Add destructive confirmation and import guidance

This commit is contained in:
github-ops
2026-06-21 01:42:45 +00:00
parent ef2912855b
commit 5447e1bad0
29 changed files with 1099 additions and 24 deletions
@@ -35,6 +35,28 @@ fn builds_tools_list_manifest_from_published_agent_tool() {
);
}
#[test]
fn marks_destructive_tools_as_two_step_confirmation_calls() {
let mut tool = published_tool();
let Target::Rest(target) = &mut tool.operation.target;
target.method = HttpMethod::Delete;
let definitions = tool_definitions(&tool);
let definition = &definitions[0];
assert!(
definition["description"]
.as_str()
.unwrap()
.contains("_crank_confirmation_token")
);
assert_eq!(
definition["inputSchema"]["properties"]["_crank_confirmation_token"]["type"],
"string"
);
assert_eq!(definition["inputSchema"]["required"], json!(["base"]));
}
fn published_tool() -> PublishedAgentTool {
PublishedAgentTool {
workspace_id: WorkspaceId::new("ws_01"),
@@ -83,6 +105,7 @@ fn operation() -> RegistryOperation {
retry_policy: None,
response_cache: None,
idempotency: None,
safety: None,
auth_profile_ref: None,
headers: BTreeMap::new(),
},