Land OKF aliases, view SSE, workbook nav, and explicit parent ctor.
Complete the core agent roadmap: soft KB hits via Task aliases, EventBus-backed view streaming, D4 writeback/workbook navigation, and I3 explicit-super without implicit auto-super. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d1ddb74235
commit
2a9fceb51c
26 files changed
+918
-54
No files matched your search
@@ -0,0 +1,64 @@
|
||||
---
|
||||
title: OKF agent-kb alias lookup (offline)
|
||||
description: Promote resource; patch Task aliases; variant goal hits same resource.
|
||||
> ext/ai/agent.mq.md
|
||||
> lib/fs.mq.md
|
||||
> lib/json.mq.md
|
||||
> lib/plugin.mq.md
|
||||
> lib/sys.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*`p` = > plugin.native_path name=agent *
|
||||
1. `p`
|
||||
> plugin.load path=`p`
|
||||
2. *
|
||||
> print text=no-agent-plugin
|
||||
> sys.exit code=1
|
||||
|
||||
*`kb` = .marqdo/agent-kb-alias-test *
|
||||
*`wb` = .marqdo/agent-runs/alias-pong.mq.md *
|
||||
*`goal` = Reply with exactly the word pong and nothing else. *
|
||||
*`alias` = say pong only *
|
||||
*`body` = "---\ntitle: pong skill\n---\n\n# main\n\n**pong**\n" *
|
||||
|
||||
> fs.write_text path=`wb` text=`body`
|
||||
*`prom` = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb` aliases=`alias` *
|
||||
*`okp` = > json.get value=`prom` key=promoted *
|
||||
1. `okp`
|
||||
> print text=promoted
|
||||
2. *
|
||||
> print text=promote-fail
|
||||
|
||||
*`slug` = > json.get value=`prom` key=slug *
|
||||
*`parts` = > json.parse text={"a":"/concepts/tasks/","b":".md"} *
|
||||
*`a` = > json.get value=`parts` key=a *
|
||||
*`b` = > json.get value=`parts` key=b *
|
||||
*`task` = `kb` + `a` + `slug` + `b` *
|
||||
*`src` = > fs.read_text path=`task` *
|
||||
*`has` = > split value=`src` sep=say pong only *
|
||||
*`hn` = > len value=`has` *
|
||||
1. `hn` > 1
|
||||
> print text=alias-written
|
||||
2. *
|
||||
> print text=alias-missing
|
||||
|
||||
*`hit` = > agent_kb_lookup kb_dir=`kb` goal=`alias` *
|
||||
1. `hit`
|
||||
> print text=alias-ok
|
||||
2. *
|
||||
> print text=alias-miss
|
||||
|
||||
*`mk` = > json.get value=`hit` key=match *
|
||||
> print text=`mk`
|
||||
|
||||
*`slug_hit` = > json.get value=`hit` key=slug *
|
||||
1. `slug` == `slug_hit`
|
||||
> print text=same-slug
|
||||
2. *
|
||||
> print text=slug-drift
|
||||
|
||||
*`exact` = > agent_kb_lookup kb_dir=`kb` goal=`goal` *
|
||||
*`mk2` = > json.get value=`exact` key=match *
|
||||
> print text=`mk2`
|
||||
@@ -85,6 +85,16 @@ HELLO, world!",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn structure_inherit_explicit_super() {
|
||||
assert_out(
|
||||
"tests/structure/inherit-explicit-super.mq.md",
|
||||
"Child
|
||||
child
|
||||
Ada",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn structure_nested_call() {
|
||||
assert_out("tests/structure/nested-call.mq.md", "Hello World!");
|
||||
@@ -1385,6 +1395,25 @@ fn ext_agent_kb_reuse() {
|
||||
assert_out("tests/ext/agent-kb-reuse.mq.md", &expect);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ext_agent_kb_alias() {
|
||||
let status = Command::new("cargo")
|
||||
.args(["build", "-p", "marqdo_plugin_agent"])
|
||||
.current_dir(env!("CARGO_MANIFEST_DIR"))
|
||||
.status()
|
||||
.expect("build agent plugin");
|
||||
assert!(status.success(), "failed to build marqdo_plugin_agent");
|
||||
assert_out(
|
||||
"tests/ext/agent-kb-alias.mq.md",
|
||||
"promoted
|
||||
alias-written
|
||||
alias-ok
|
||||
alias
|
||||
same-slug
|
||||
exact",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lib_net_encode() {
|
||||
assert_out("tests/lib/net-encode.mq.md", "a+b");
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: inherit explicit parent constructor
|
||||
> lib/json.mq.md
|
||||
---
|
||||
|
||||
# Parent
|
||||
+ `name`
|
||||
|
||||
*`out` = > json.parse text={"role":"parent"} *
|
||||
*`out` = > json.set map=`out` key=name value=`name` *
|
||||
**`out`**
|
||||
|
||||
# Child = > Parent
|
||||
+ `name`
|
||||
|
||||
*`self` = > Parent name=`name` *
|
||||
*`self` = > json.set map=`self` key=role value=child *
|
||||
**`self`**
|
||||
|
||||
# main
|
||||
|
||||
*`c` = > Child name=Ada *
|
||||
*`ty` = > json.get value=`c` key=_type *
|
||||
*`role` = > json.get value=`c` key=role *
|
||||
*`name` = > json.get value=`c` key=name *
|
||||
> print text=`ty`
|
||||
> print text=`role`
|
||||
> print text=`name`
|
||||
Reference in new issue
Block a user