mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-14 01:46:44 +00:00
Compare commits
2 Commits
test/plugi
...
03b817db2e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03b817db2e | ||
|
|
8e45f1850c |
@@ -3523,10 +3523,10 @@ fn run_resume_command(
|
|||||||
Ok(ResumeCommandOutcome {
|
Ok(ResumeCommandOutcome {
|
||||||
session: session.clone(),
|
session: session.clone(),
|
||||||
message: Some(handle_agents_slash_command(args.as_deref(), &cwd)?),
|
message: Some(handle_agents_slash_command(args.as_deref(), &cwd)?),
|
||||||
json: Some(serde_json::json!({
|
json: Some(
|
||||||
"kind": "agents",
|
serde_json::to_value(handle_agents_slash_command_json(args.as_deref(), &cwd)?)
|
||||||
"text": handle_agents_slash_command(args.as_deref(), &cwd)?,
|
.unwrap_or_else(|_| serde_json::json!(null)),
|
||||||
})),
|
),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
SlashCommand::Skills { args } => {
|
SlashCommand::Skills { args } => {
|
||||||
|
|||||||
@@ -105,6 +105,18 @@ fn inventory_commands_emit_structured_json_when_requested() {
|
|||||||
let skills = assert_json_command(&root, &["--output-format", "json", "skills"]);
|
let skills = assert_json_command(&root, &["--output-format", "json", "skills"]);
|
||||||
assert_eq!(skills["kind"], "skills");
|
assert_eq!(skills["kind"], "skills");
|
||||||
assert_eq!(skills["action"], "list");
|
assert_eq!(skills["action"], "list");
|
||||||
|
|
||||||
|
let plugins = assert_json_command(&root, &["--output-format", "json", "plugins"]);
|
||||||
|
assert_eq!(plugins["kind"], "plugin");
|
||||||
|
assert_eq!(plugins["action"], "list");
|
||||||
|
assert!(
|
||||||
|
plugins["reload_runtime"].is_boolean(),
|
||||||
|
"plugins reload_runtime should be a boolean"
|
||||||
|
);
|
||||||
|
assert!(
|
||||||
|
plugins["target"].is_null(),
|
||||||
|
"plugins target should be null when no plugin is targeted"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -348,6 +360,34 @@ fn resumed_inventory_commands_emit_structured_json_when_requested() {
|
|||||||
assert_eq!(skills["action"], "list");
|
assert_eq!(skills["action"], "list");
|
||||||
assert!(skills["summary"]["total"].is_number());
|
assert!(skills["summary"]["total"].is_number());
|
||||||
assert!(skills["skills"].is_array());
|
assert!(skills["skills"].is_array());
|
||||||
|
|
||||||
|
let agents = assert_json_command_with_env(
|
||||||
|
&root,
|
||||||
|
&[
|
||||||
|
"--output-format",
|
||||||
|
"json",
|
||||||
|
"--resume",
|
||||||
|
session_path.to_str().expect("utf8 session path"),
|
||||||
|
"/agents",
|
||||||
|
],
|
||||||
|
&[
|
||||||
|
(
|
||||||
|
"CLAW_CONFIG_HOME",
|
||||||
|
config_home.to_str().expect("utf8 config home"),
|
||||||
|
),
|
||||||
|
("HOME", home.to_str().expect("utf8 home")),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
assert_eq!(agents["kind"], "agents");
|
||||||
|
assert_eq!(agents["action"], "list");
|
||||||
|
assert!(
|
||||||
|
agents["agents"].is_array(),
|
||||||
|
"agents field must be a JSON array"
|
||||||
|
);
|
||||||
|
assert!(
|
||||||
|
agents["count"].is_number(),
|
||||||
|
"count must be a number, not a text render"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user