Extend ext/agent with skill match/assign and multi-column tables.
Compose ext/llm, add ABI match_skill/bump_load, map-valued GFM tables, and agent-assign gold coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3a7e11c995
commit
c4ffb9473f
15 files changed
+476
-31
No files matched your search
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: ext/agent match and assign
|
||||
description: Multi-column tables + skill match (needs MARQDO_AGENT_PLUGIN).
|
||||
> ext/agent.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
> load_native
|
||||
|
||||
*`cwd` = > cwd *
|
||||
*`bot` = > agent root=`cwd` *
|
||||
|
||||
`技能表` =
|
||||
| 成员 | 技能 | 负载 |
|
||||
|------|------|------|
|
||||
| 张三 | Python, ML | 2 |
|
||||
| 李四 | 前端, UX | 1 |
|
||||
| 王五 | 后端, 运维 | 3 |
|
||||
| 赵六 | 数据分析 | 0 |
|
||||
|
||||
*`m` = > `bot`.match_skill skill=Python members=`技能表` *
|
||||
*`name` = > get value=`m` key=成员 *
|
||||
> print text=`name`
|
||||
|
||||
*`m2` = > `bot`.match_skill skill=安全审计 members=`技能表` *
|
||||
+ `m2`
|
||||
> print text=unexpected-match
|
||||
+ *
|
||||
*`path` = > `bot`.create_ticket title=no_owner detail=security *
|
||||
> print text=`path`
|
||||
|
||||
*`m3` = > `bot`.update_load member=`m` delta=1 *
|
||||
*`load` = > get value=`m3` key=负载 *
|
||||
> print text=`load`
|
||||
@@ -728,6 +728,45 @@ fn ext_cli_add_agent_with_native() {
|
||||
assert!(tmp.join("agent.plugin").is_file());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ext_agent_assign() {
|
||||
let status = Command::new(env!("CARGO"))
|
||||
.args(["build", "-p", "marqdo_plugin_agent"])
|
||||
.status()
|
||||
.expect("cargo build plugin agent");
|
||||
assert!(status.success(), "failed to build marqdo_plugin_agent");
|
||||
|
||||
let lib_name = if cfg!(windows) {
|
||||
"agent.dll"
|
||||
} else if cfg!(target_os = "macos") {
|
||||
"libagent.dylib"
|
||||
} else {
|
||||
"libagent.so"
|
||||
};
|
||||
let built = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("target")
|
||||
.join("debug")
|
||||
.join(lib_name);
|
||||
let ext_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("tests")
|
||||
.join("ext");
|
||||
let plugin = ext_dir.join(lib_name);
|
||||
std::fs::copy(&built, &plugin).expect("copy agent plugin");
|
||||
let _ = std::fs::remove_file(ext_dir.join("ticket.txt"));
|
||||
let _ = std::fs::remove_file(ext_dir.join("ticket-stub.txt"));
|
||||
|
||||
let output = Command::new(env!("CARGO_BIN_EXE_marqdo"))
|
||||
.args(["run", "tests/ext/agent-assign.mq.md"])
|
||||
.env("MARQDO_AGENT_PLUGIN", lib_name)
|
||||
.output()
|
||||
.expect("run agent-assign");
|
||||
let code = output.status.code().unwrap_or(1);
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
assert_eq!(code, 0, "agent-assign stderr={stderr}");
|
||||
assert_eq!(stdout.trim_end(), "张三\nticket.txt\n3", "agent-assign");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ext_agent_scaffold() {
|
||||
let status = Command::new(env!("CARGO"))
|
||||
|
||||
Reference in new issue
Block a user