Make file subtasks return #main value and expose it as plan.result.

Quiet spawn still hides child stdout; workbooks solidify to **returns**, agent-kb lives in the plugin, and multi-step follows OKF file relay rather than print-based answers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-07 17:53:14 +08:00
1 parent fbece725e1
commit d1b33c78c6
55 files changed
+3498 -169

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
---
title: agent inspect_workbook (offline)
description: Parse named writeback slots from a fixture workbook path.
> ext/ai/agent.mq.md
> lib/json.mq.md
> lib/fs.mq.md
---
# main
*`paths` = > json.parse text={"f":".marqdo/agent-runs/inspect-fixture.mq.md"} *
*`fixture` = > json.get value=`paths` key=f *
*`body` = > json.parse text={"t":"# main\n\n> print text=hi\n<!-- marqdo-out ok\n{\"status\":\"ok\",\"result\":\"done\"}\n-->\n<!-- marqdo-out error\npending\n-->\n"} *
*`t` = > json.get value=`body` key=t *
> fs.write_text path=`fixture` text=`t`
*`obs` = > agent.inspect_workbook path=`fixture` exit_code=0 *
*`code` = > json.get value=`obs` key=exit_code *
> print text=`code`
*`ok` = > json.get value=`obs` key=last_ok *
*`has` = > split value=`ok` sep=done *
*`n` = > len value=`has` *
1. `n` > 1
> print text=ok-slot
2. *
> print text=ok-missing
*`err` = > json.get value=`obs` key=last_error *
> print text=`err`
+67
View File
@@ -0,0 +1,67 @@
---
title: OKF agent-kb promote + lookup + spawn (offline)
description: Promote a solidified workbook, lookup by goal, spawn without parent LLM.
> ext/ai/agent.mq.md
> lib/fs.mq.md
> lib/json.mq.md
> lib/subtask.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
*`paths` = > json.parse text={"kb":".marqdo/agent-kb","wb":".marqdo/agent-runs/pong-solid.mq.md","goal":"Reply with exactly the word pong and nothing else.","body":"---\ntitle: pong skill\n---\n\n# main\n\n**pong**\n"} *
*`kb` = > json.get value=`paths` key=kb *
*`wb` = > json.get value=`paths` key=wb *
*`goal` = > json.get value=`paths` key=goal *
*`body` = > json.get value=`paths` key=body *
> fs.write_text path=`wb` text=`body`
*`sig` = > agent_goal_sig goal=`goal` *
> print text=`sig`
*`slug0` = > agent_goal_slug goal=`goal` *
> print text=`slug0`
*`prom` = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb` *
*`okp` = > json.get value=`prom` key=promoted *
1. `okp`
> print text=promoted
2. *
> print text=promote-fail
*`st` = > json.get value=`prom` key=status *
> print text=`st`
*`slug` = > json.get value=`prom` key=slug *
> print text=`slug`
*`hit` = > agent_kb_lookup kb_dir=`kb` goal=`goal` *
1. `hit`
> print text=lookup-ok
2. *
> print text=lookup-miss
*`res` = > json.get value=`hit` key=resource *
*`id` = > subtask.spawn path=`res` *
*`waited` = > subtask.wait id=`id` *
*`code` = > json.get value=`waited` key=code *
*`val` = > json.get value=`waited` key=value *
> print text=`code`
> print text=`val`
*`hit2` = > agent_kb_lookup kb_dir=`kb` goal=`goal` *
*`res2` = > json.get value=`hit2` key=resource *
1. `res` == `res2`
> print text=stable-path
2. *
> print text=path-drift
+36
View File
@@ -0,0 +1,36 @@
---
title: agent plan confirm (offline)
description: Create workbook skeleton with confirm=True; no LLM spawn loop.
> ext/ai/llm.mq.md
> ext/ai/agent.mq.md
> lib/json.mq.md
> lib/fs.mq.md
---
# main
> llm.load_env path=.env
*`model` = > llm.llm *
*`tools` = > json.parse text=[] *
*`助手` = > agent.agent model=`model` tools=`tools` standing=offline plan confirm *
*`out` = > `助手`.plan goal=say hi confirm=True workbook_dir=".marqdo/agent-runs" writeback=False *
*`st` = > json.get value=`out` key=status *
> print text=`st`
*`path` = > json.get value=`out` key=workbook *
*`ex` = > fs.exists path=`path` *
1. `ex`
> print text=workbook-ok
2. *
> print text=workbook-missing
*`src` = > fs.read_text path=`path` *
*`parts` = > split value=`src` sep=agent.agent *
*`n` = > len value=`parts` *
1. `n` > 1
> print text=skeleton-ok
2. *
> print text=skeleton-bad
+48
View File
@@ -0,0 +1,48 @@
---
title: agent plan decision + dual skeleton (offline)
description: extract_plan_decision/summary; dual skeleton contains research+writer; patch apply on fixture.
> ext/ai/agent.mq.md
> lib/json.mq.md
> lib/fs.mq.md
---
# main
*`samples` = > json.parse text={"done":"DECISION: DONE\nSUMMARY: all good\n","cont":"DECISION: CONTINUE\nPATCH:\n<<<\nFIND\nold\n===\nREPLACE\nnew\n>>>\n","zh":"决定:完成\n汇总:好了\n"} *
*`d1` = > json.get value=`samples` key=done *
*`r1` = > agent.extract_plan_decision reply=`d1` *
> print text=`r1`
*`s1` = > agent.extract_plan_summary reply=`d1` *
> print text=`s1`
*`d2` = > json.get value=`samples` key=cont *
*`r2` = > agent.extract_plan_decision reply=`d2` *
> print text=`r2`
*`d3` = > json.get value=`samples` key=zh *
*`r3` = > agent.extract_plan_decision reply=`d3` *
> print text=`r3`
*`dual` = > agent.render_workbook_skeleton goal=demo skeleton=dual *
*`has_r` = > split value=`dual` sep=research *
*`n_r` = > len value=`has_r` *
1. `n_r` > 1
> print text=dual-ok
2. *
> print text=dual-missing
*`has_s` = > split value=`dual` sep=Solidify *
*`n_s` = > len value=`has_s` *
1. `n_s` > 1
> print text=solidify-ok
2. *
> print text=solidify-missing
*`paths` = > json.parse text={"p":".marqdo/agent-runs/decision-patch.md","t":"keep old keep"} *
*`path` = > json.get value=`paths` key=p *
*`seed` = > json.get value=`paths` key=t *
> fs.write_text path=`path` text=`seed`
*`n` = > fs.apply_patch_blocks path=`path` text=`d2` *
> print text=`n`
*`out` = > fs.read_text path=`path` *
> print text=`out`
+43
View File
@@ -0,0 +1,43 @@
---
title: ext/agent plan live (DeepSeek)
description: Full plan loop — spawn workbook, inspect, secondary plan; simple pong goal.
> ext/ai/llm.mq.md
> ext/ai/agent.mq.md
> lib/json.mq.md
> lib/fs.mq.md
---
# main
> llm.load_env path=.env
*`model` = > llm.llm *
*`tools` = > json.parse text=[] *
*`助手` = > agent.agent model=`model` tools=`tools` standing=You are a Marqdo agent-development master. Prefer DONE when the workbook already satisfies the goal. *
*`out` = > `助手`.plan goal=Reply with exactly the word pong and nothing else. max_rounds=3 writeback=False *
*`st` = > json.get value=`out` key=status *
> print text=`st`
*`sum` = > json.get value=`out` key=summary *
1. `sum`
> print text=`sum`
2. *
> print text=no-summary
*`cache` = > json.get value=`out` key=cache *
> print text=`cache`
*`path` = > json.get value=`out` key=workbook *
*`ex` = > fs.exists path=`path` *
1. `ex`
> print text=workbook-ok
2. *
> print text=workbook-missing
*`out2` = > `助手`.plan goal=Reply with exactly the word pong and nothing else. max_rounds=3 writeback=False *
*`st2` = > json.get value=`out2` key=status *
> print text=`st2`
*`cache2` = > json.get value=`out2` key=cache *
> print text=`cache2`
+23
View File
@@ -0,0 +1,23 @@
---
title: fs text_patch / apply_patch_blocks (offline)
> lib/fs.mq.md
> lib/json.mq.md
---
# main
*`paths` = > json.parse text={"p":".marqdo/agent-runs/patch-demo.md","t":"alpha beta gamma"} *
*`path` = > json.get value=`paths` key=p *
*`seed` = > json.get value=`paths` key=t *
> fs.write_text path=`path` text=`seed`
> fs.text_patch path=`path` find=beta replace=BETA
*`s1` = > fs.read_text path=`path` *
> print text=`s1`
*`reply` = > json.parse text={"t":"DECISION: CONTINUE\n<<<\nFIND\nalpha\n===\nREPLACE\nALPHA\n>>>\n<<<\nFIND\ngamma\n===\nREPLACE\nGAMMA\n>>>\n"} *
*`t` = > json.get value=`reply` key=t *
*`n` = > fs.apply_patch_blocks path=`path` text=`t` *
> print text=`n`
*`s2` = > fs.read_text path=`path` *
> print text=`s2`