Unify bare-identifier semantics in *…* / **…** (Python namespace)

Inside italic/bold code segments every bare word is a variable — including
call arguments and method-call receivers — so text literals must be quoted
and receivers no longer need backticks. A bare dotted callee `a.b` resolves
as a method call when `a` is a local variable, otherwise as a library path
(Python-style unified namespace), in both the tree-walk and bytecode backends.

Migrate ~70 tests plus ext/web, ext/quantum, ext/ai and the example projects
to the new idiom; update SKILL.md and the design docs; fix the web/quantum
example data model (db/index.mq.md). Unit and gold suites pass; only the 3
network-live tests fail offline.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-18 11:20:46 +08:00
1 parent f275d1e030
commit bd5555afaa
86 files changed
+1539 -1467

No files matched your search

+1 -1
View File
@@ -4,4 +4,4 @@ title: empty split sep
# main
*xs = > split value=ab sep=*
*xs = > split value="ab" sep=*
+6 -6
View File
@@ -9,22 +9,22 @@ import fs:lib/fs.mq.md
# main
*paths = > json.parse text={"f":".marqdo/agent-runs/inspect-fixture.mq.md"}*
*fixture = > json.get value=`paths` key=f*
*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*
*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*
*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*
*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*
*err = > json.get value=`obs` key="last_error"*
> print text=`err`
+12 -12
View File
@@ -10,7 +10,7 @@ import sys:lib/sys.mq.md
# main
*p = > plugin.native_path name=agent*
*p = > plugin.native_path name="agent"*
1. `p`
> plugin.load path=`p`
2. *
@@ -25,19 +25,19 @@ import sys:lib/sys.mq.md
> 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*
*okp = > json.get value=`prom` key="promoted"*
1. `okp`
> print text=promoted
2. *
> print text=promote-fail
*slug = > json.get value=`prom` key=slug*
*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*
*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*
*has = > split value=`src` sep="say pong only"*
*hn = > len value=`has`*
1. `hn` > 1
> print text=alias-written
@@ -50,17 +50,17 @@ import sys:lib/sys.mq.md
2. *
> print text=alias-miss
*mk = > json.get value=`hit` key=match*
*mk = > json.get value=`hit` key="match"*
> print text=`mk`
*slug_hit = > json.get value=`hit` key=slug*
*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*
*mk2 = > json.get value=`exact` key="match"*
> print text=`mk2`
*g_trip = "帮我规划明天的行程"*
@@ -68,7 +68,7 @@ import sys:lib/sys.mq.md
*body2 = "---\ntitle: trip\n---\n\n# main\n\n*msg = \"trip-ok\"*\n\n**msg**\n"*
> fs.write_text path=`wb2` text=`body2`
*prom2 = > agent_kb_promote kb_dir=`kb` goal=`g_trip` workbook=`wb2`*
*ok2 = > json.get value=`prom2` key=promoted*
*ok2 = > json.get value=`prom2` key="promoted"*
1. `ok2`
> print text=trip-promoted
2. *
@@ -82,11 +82,11 @@ import sys:lib/sys.mq.md
> print text=canonical-ok
2. *
> print text=canonical-miss
*mk3 = > json.get value=`hit_c` key=match*
*mk3 = > json.get value=`hit_c` key="match"*
> print text=`mk3`
*listed = > agent_kb_list_tasks kb_dir=`kb`*
*tc = > json.get value=`listed` key=count*
*tc = > json.get value=`listed` key="count"*
1. `tc` > 1
> print text=list-ok
2. *
+9 -9
View File
@@ -10,7 +10,7 @@ import sys:lib/sys.mq.md
# main
*p = > plugin.native_path name=agent*
*p = > plugin.native_path name="agent"*
1. `p`
> plugin.load path=`p`
2. *
@@ -24,13 +24,13 @@ import sys:lib/sys.mq.md
> fs.write_text path=`wb` text=`body`
*prom = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb`*
*okp = > json.get value=`prom` key=promoted*
*okp = > json.get value=`prom` key="promoted"*
1. `okp`
> print text=promoted
2. *
> print text=promote-fail
*slug = > json.get value=`prom` key=slug*
*slug = > json.get value=`prom` key="slug"*
*g1 = "帮我规划明天行程"*
*hit1 = > agent_kb_lookup kb_dir=`kb` goal=`g1` near_match=True near_threshold=0.78*
@@ -38,9 +38,9 @@ import sys:lib/sys.mq.md
> print text=near-ok
2. *
> print text=near-miss
*mk1 = > json.get value=`hit1` key=match*
*mk1 = > json.get value=`hit1` key="match"*
> print text=`mk1`
*slug1 = > json.get value=`hit1` key=slug*
*slug1 = > json.get value=`hit1` key="slug"*
1. `slug` == `slug1`
> print text=same-slug
2. *
@@ -60,16 +60,16 @@ import sys:lib/sys.mq.md
> print text=neg-miss
*ranked = > agent_kb_near_match kb_dir=`kb` goal=`g1`*
*best = > json.get value=`ranked` key=best*
*bs = > json.get value=`best` key=slug*
*best = > json.get value=`ranked` key="best"*
*bs = > json.get value=`best` key="slug"*
1. `bs` == `slug`
> print text=rank-ok
2. *
> print text=rank-bad
*tasks = > json.get value=`ranked` key=candidates*
*tasks = > json.get value=`ranked` key="candidates"*
*prompt = > agent.build_soft_match_prompt goal=`g1` tasks=`tasks`*
*has = > split value=`prompt` sep=score=*
*has = > split value=`prompt` sep="score="*
*hn = > len value=`has`*
1. `hn` > 1
> print text=prompt-score-ok
+12 -12
View File
@@ -11,7 +11,7 @@ import sys:lib/sys.mq.md
# main
*p = > plugin.native_path name=agent*
*p = > plugin.native_path name="agent"*
1. `p`
> plugin.load path=`p`
2. *
@@ -19,10 +19,10 @@ import sys:lib/sys.mq.md
> 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*msg = \"pong\"*\n\n**msg**\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*
*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`
@@ -33,16 +33,16 @@ import sys:lib/sys.mq.md
> print text=`slug0`
*prom = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb`*
*okp = > json.get value=`prom` key=promoted*
*okp = > json.get value=`prom` key="promoted"*
1. `okp`
> print text=promoted
2. *
> print text=promote-fail
*st = > json.get value=`prom` key=status*
*st = > json.get value=`prom` key="status"*
> print text=`st`
*slug = > json.get value=`prom` key=slug*
*slug = > json.get value=`prom` key="slug"*
> print text=`slug`
*hit = > agent_kb_lookup kb_dir=`kb` goal=`goal`*
@@ -51,16 +51,16 @@ import sys:lib/sys.mq.md
2. *
> print text=lookup-miss
*res = > json.get value=`hit` key=resource*
*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*
*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*
*res2 = > json.get value=`hit2` key="resource"*
1. `res` == `res2`
> print text=stable-path
2. *
+9 -9
View File
@@ -10,25 +10,25 @@ import sys:lib/sys.mq.md
# main
*parts = > json.parse text={"a":"CALL:lib.fs.exists","b":"ARGS:{\"path\":\".\"}","nl":"\n"}*
*a = > json.get value=`parts` key=a*
*b = > json.get value=`parts` key=b*
*nl = > json.get value=`parts` key=nl*
*a = > json.get value=`parts` key="a"*
*b = > json.get value=`parts` key="b"*
*nl = > json.get value=`parts` key="nl"*
*t_ok = a + nl + b + nl*
*act = > agent.extract_plan_act reply=`t_ok`*
*kind = > json.get value=`act` key=kind*
*name = > json.get value=`act` key=name*
*kind = > json.get value=`act` key="kind"*
*name = > json.get value=`act` key="name"*
> print text=`kind`
> print text=`name`
*out = > agent.run_parent_tool name=`name` path=. reply=`t_ok`*
*out = > agent.run_parent_tool name=`name` path="." reply=`t_ok`*
1. `out`
> print text=exists-ok
2. *
> print text=exists-bad
*deny = > agent.run_parent_tool name=lib.net.get path=. reply=CALL:lib.net.get*
*deny = > agent.run_parent_tool name="lib.net.get" path="." reply="CALL:lib.net.get"*
*sep = > json.parse text={"s":"not allowed"}*
*s = > json.get value=`sep` key=s*
*s = > json.get value=`sep` key="s"*
*dparts = > split value=`deny` sep=`s`*
*pn = > len value=`dparts`*
1. `pn` > 1
@@ -37,7 +37,7 @@ import sys:lib/sys.mq.md
> print text=deny-bad
*cat = > agent.lib_catalog*
*callable = > json.get value=`cat` key=callable*
*callable = > json.get value=`cat` key="callable"*
*cn = > len value=`callable`*
1. `cn` > 3
> print text=callable-ok
+5 -5
View File
@@ -13,14 +13,14 @@ import fs:lib/fs.mq.md
*model = > llm.llm*
*tools = > json.parse text=[]*
*助手 = > agent.agent model=`model` tools=`tools` standing=offline plan confirm*
*助手 = > agent.agent model=`model` tools=`tools` standing="offline plan confirm"*
*out = > `助手`.plan goal=say hi confirm=True workbook_dir=".marqdo/agent-runs" writeback=False*
*out = > `助手`.plan goal="say hi" confirm=True workbook_dir=".marqdo/agent-runs" writeback=False*
*st = > json.get value=`out` key=status*
*st = > json.get value=`out` key="status"*
> print text=`st`
*path = > json.get value=`out` key=workbook*
*path = > json.get value=`out` key="workbook"*
*ex = > fs.exists path=`path`*
1. `ex`
> print text=workbook-ok
@@ -28,7 +28,7 @@ import fs:lib/fs.mq.md
> print text=workbook-missing
*src = > fs.read_text path=`path`*
*parts = > split value=`src` sep=agent.agent*
*parts = > split value=`src` sep="agent.agent"*
*n = > len value=`parts`*
1. `n` > 1
> print text=skeleton-ok
+21 -21
View File
@@ -9,25 +9,25 @@ import fs: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","run":"DECISION: RUN\n","zh_run":"决定:运行\n"}*
*d1 = > json.get value=`samples` key=done*
*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*
*d2 = > json.get value=`samples` key="cont"*
*r2 = > agent.extract_plan_decision reply=`d2`*
> print text=`r2`
*d3 = > json.get value=`samples` key=zh*
*d3 = > json.get value=`samples` key="zh"*
*r3 = > agent.extract_plan_decision reply=`d3`*
> print text=`r3`
*d4 = > json.get value=`samples` key=run*
*d4 = > json.get value=`samples` key="run"*
*r4 = > agent.extract_plan_decision reply=`d4`*
> print text=`r4`
*d5 = > json.get value=`samples` key=zh_run*
*d5 = > json.get value=`samples` key="zh_run"*
*r5 = > agent.extract_plan_decision reply=`d5`*
> print text=`r5`
@@ -37,47 +37,47 @@ import fs:lib/fs.mq.md
*act_call = "CALL:lib_catalog"*
*a1 = > agent.extract_plan_act reply=`act_call`*
*a1k = > json.get value=`a1` key=kind*
*a1n = > json.get value=`a1` key=name*
*a1k = > json.get value=`a1` key="kind"*
*a1n = > json.get value=`a1` key="name"*
> print text=`a1k`
> print text=`a1n`
*act_read = "READ:stderr"*
*a2 = > agent.extract_plan_act reply=`act_read`*
*a2k = > json.get value=`a2` key=kind*
*a2n = > json.get value=`a2` key=name*
*a2k = > json.get value=`a2` key="kind"*
*a2n = > json.get value=`a2` key="name"*
> print text=`a2k`
> print text=`a2n`
*act_dec = > json.get value=`samples` key=done*
*act_dec = > json.get value=`samples` key="done"*
*a3 = > agent.extract_plan_act reply=`act_dec`*
*a3k = > json.get value=`a3` key=kind*
*a3k = > json.get value=`a3` key="kind"*
> print text=`a3k`
*cat = > agent.lib_catalog*
*files = > json.get value=`cat` key=files*
*files = > json.get value=`cat` key="files"*
*nf = > len value=`files`*
1. `nf` > 5
> print text=catalog-ok
2. *
> print text=catalog-bad
*dual = > agent.render_workbook_skeleton goal=demo skeleton=dual*
*has_r = > split value=`dual` sep=research*
*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*
*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
*has_imp = > split value=`dual` sep=import llm:ext/ai/llm.mq.md*
*has_imp = > split value=`dual` sep="import llm:ext/ai/llm.mq.md"*
*n_imp = > len value=`has_imp`*
1. `n_imp` > 1
> print text=import-ok
@@ -85,19 +85,19 @@ import fs:lib/fs.mq.md
> print text=import-missing
*paths = > json.parse text={"p":".marqdo/agent-runs/decision-patch.md","t":"keep old keep","fence":"alpha beta","p2":".marqdo/agent-runs/decision-fence.md"}*
*path = > json.get value=`paths` key=p*
*seed = > json.get value=`paths` key=t*
*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`
*path2 = > json.get value=`paths` key=p2*
*seed2 = > json.get value=`paths` key=fence*
*path2 = > json.get value=`paths` key="p2"*
*seed2 = > json.get value=`paths` key="fence"*
> fs.write_text path=`path2` text=`seed2`
*fence_pack = > json.parse text={"t":"DECISION: CONTINUE\n\u0060\u0060\u0060find\nalpha\n\u0060\u0060\u0060\n\u0060\u0060\u0060replace\nALPHA\n\u0060\u0060\u0060\n"}*
*fence_reply = > json.get value=`fence_pack` key=t*
*fence_reply = > json.get value=`fence_pack` key="t"*
*n2 = > fs.apply_patch_blocks path=`path2` text=`fence_reply`*
> print text=`n2`
*out2 = > fs.read_text path=`path2`*
+9 -9
View File
@@ -13,31 +13,31 @@ import fs:lib/fs.mq.md
*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.*
*助手 = > 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*
*out = > `助手`.plan goal="Reply with exactly the word pong and nothing else." max_rounds=3 writeback=False*
*st = > json.get value=`out` key=status*
*st = > json.get value=`out` key="status"*
> print text=`st`
*sum = > json.get value=`out` key=summary*
*sum = > json.get value=`out` key="summary"*
1. `sum`
> print text=`sum`
2. *
> print text=no-summary
*cache = > json.get value=`out` key=cache*
*cache = > json.get value=`out` key="cache"*
> print text=`cache`
*path = > json.get value=`out` key=workbook*
*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*
*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*
*cache2 = > json.get value=`out2` key="cache"*
> print text=`cache2`
+8 -8
View File
@@ -8,29 +8,29 @@ import fs:lib/fs.mq.md
# main
*paths = > json.parse text={"p":".marqdo/agent-runs/observe-fixture.mq.md"}*
*path = > json.get value=`paths` key=p*
*path = > json.get value=`paths` key="p"*
*seed = > json.parse text={"t":"---\ntitle: fixture\n---\n\n# main\n\n<!-- marqdo-out ok\nHUGE_BODY_SHOULD_BE_STRIPPED\n-->\n\n*msg = \"ok\"*\n\n**msg**\n"}*
*text = > json.get value=`seed` key=t*
*text = > json.get value=`seed` key="t"*
> fs.write_text path=`path` text=`text`
*obs = > agent.inspect_workbook path=`path` exit_code=0 value=ok*
*obs = > agent.inspect_workbook path=`path` exit_code=0 value="ok"*
*compact = > agent.compact_plan_observation observation=`obs`*
*ex = > json.get value=`compact` key=source_excerpt*
*parts = > split value=`ex` sep=HUGE_BODY*
*ex = > json.get value=`compact` key="source_excerpt"*
*parts = > split value=`ex` sep="HUGE_BODY"*
*n = > len value=`parts`*
1. `n` == 1
> print text=excerpt-stripped
2. *
> print text=excerpt-leak
*has = > json.get value=`compact` key=has_value*
*has = > json.get value=`compact` key="has_value"*
1. `has`
> print text=has-value-ok
2. *
> print text=has-value-bad
*deep = > agent.plan_read_deepen observation=`obs` kind=source path=`path`*
*ex2 = > json.get value=`deep` key=source_excerpt*
*deep = > agent.plan_read_deepen observation=`obs` kind="source" path=`path`*
*ex2 = > json.get value=`deep` key="source_excerpt"*
1. `ex2`
> print text=read-source-ok
2. *
+20 -20
View File
@@ -10,34 +10,34 @@ import fs:lib/fs.mq.md
# main
*events = > json.parse text=[]*
*events = > agent.plan_append_round events=`events` round=1 workbook=wb.mq.md exit_code=0 stream=True*
*events = > agent.plan_append_round events=`events` round=1 workbook="wb.mq.md" exit_code=0 stream=True*
*from = > json.parse text=[{"type":"delta","text":"Hi"},{"type":"done","result":"Hi"}]*
*events = > agent.plan_merge_deltas events=`events` from=`from` stream=True*
*events = > agent.plan_append_decision events=`events` decision=DONE stream=True summary=ok*
*events = > agent.plan_append_decision events=`events` decision="DONE" stream=True summary="ok"*
*out = > json.parse text={"status":"ok"}*
*out = > agent.plan_finish_stream out=`out` events=`events` stream=True result=child*
*out = > agent.plan_finish_stream out=`out` events=`events` stream=True result="child"*
*evs = > json.get value=`out` key=events*
*evs = > json.get value=`out` key="events"*
*n = > len value=`evs`*
> print text=`n`
*e0 = > at value=`evs` index=0*
*t0 = > json.get value=`e0` key=type*
*t0 = > json.get value=`e0` key="type"*
> print text=`t0`
*e1 = > at value=`evs` index=1*
*t1 = > json.get value=`e1` key=type*
*x1 = > json.get value=`e1` key=text*
*t1 = > json.get value=`e1` key="type"*
*x1 = > json.get value=`e1` key="text"*
> print text=`t1`
> print text=`x1`
*e2 = > at value=`evs` index=2*
*t2 = > json.get value=`e2` key=type*
*t2 = > json.get value=`e2` key="type"*
> print text=`t2`
*e3 = > at value=`evs` index=3*
*t3 = > json.get value=`e3` key=type*
*r3 = > json.get value=`e3` key=result*
*t3 = > json.get value=`e3` key="type"*
*r3 = > json.get value=`e3` key="result"*
> print text=`t3`
> print text=`r3`
@@ -45,27 +45,27 @@ import fs:lib/fs.mq.md
*model = > llm.llm*
*tools = > json.parse text=[]*
*助手 = > agent.agent model=`model` tools=`tools` standing=offline plan stream*
*助手 = > agent.agent model=`model` tools=`tools` standing="offline plan stream"*
*pout = > `助手`.plan goal=say hi confirm=True workbook_dir=".marqdo/agent-runs" writeback=False stream=True*
*pout = > `助手`.plan goal="say hi" confirm=True workbook_dir=".marqdo/agent-runs" writeback=False stream=True*
*st = > json.get value=`pout` key=status*
*st = > json.get value=`pout` key="status"*
> print text=`st`
*pevs = > json.get value=`pout` key=events*
*pevs = > json.get value=`pout` key="events"*
*pn = > len value=`pevs`*
> print text=`pn`
*plast = > at value=`pevs` index=0*
*pt = > json.get value=`plast` key=type*
*pt = > json.get value=`plast` key="type"*
> print text=`pt`
*aev = > agent.plan_echo_await round=2 workbook=wb.mq.md stream=True*
*at = > json.get value=`aev` key=type*
*aev = > agent.plan_echo_await round=2 workbook="wb.mq.md" stream=True*
*at = > json.get value=`aev` key="type"*
> print text=`at`
*ar = > json.get value=`aev` key=round*
*ar = > json.get value=`aev` key="round"*
> print text=`ar`
*dev = > agent.plan_echo_decompose workbook=wb.mq.md stream=True*
*dt = > json.get value=`dev` key=type*
*dev = > agent.plan_echo_decompose workbook="wb.mq.md" stream=True*
*dt = > json.get value=`dev` key="type"*
> print text=`dt`
+7 -7
View File
@@ -11,7 +11,7 @@ import agent:ext/ai/agent.mq.md
## 获取时间
*u = > time.now_unix*
*s = > time.format unix=`u` pattern=%Y-%m-%d*
*s = > time.format unix=`u` pattern="%Y-%m-%d"*
**s**
# main
@@ -25,25 +25,25 @@ import agent:ext/ai/agent.mq.md
|------|
| 获取时间 |
*助手 = > agent.agent model=`模型` tools=`工具表` standing=You are a Marqdo agent. When you need the current date, reply with exactly one line CALL:获取时间 and nothing else.*
*助手 = > agent.agent model=`模型` tools=`工具表` standing="You are a Marqdo agent. When you need the current date, reply with exactly one line CALL:获取时间 and nothing else."*
*out = > `助手`.step task=请调用获取时间工具,然后用一句话告诉用户今天的日期。*
*out = > `助手`.step task="请调用获取时间工具,然后用一句话告诉用户今天的日期。"*
<!-- marqdo-out ok
{"decision":"CALL:获取时间","result":"今天是2026年8月7日。","status":"ok","task":"请调用获取时间工具,然后用一句话告诉用户今天的日期。","tool":"获取时间","tool_result":"\"2026-08-07\""}
-->
*status = > json.get value=`out` key=status*
*回复 = > json.get value=`out` key=result*
*status = > json.get value=`out` key="status"*
*回复 = > json.get value=`out` key="result"*
> print text=`回复`
*cached = > writeback.get key=ok*
*cached = > writeback.get key="ok"*
1. `cached`
> print text=writeback-ok
2. *
> print text=writeback-missing
*id = > json.get value=`助手` key=id*
*id = > json.get value=`助手` key="id"*
*历史 = > agent_history_get id=`id`*
*条数 = > len value=`历史`*
> print text=`条数`
+12 -12
View File
@@ -9,7 +9,7 @@ import agent:ext/ai/agent.mq.md
## 获取时间
*esc = > json.parse text={"v":"ok-time"}*
**> json.get value=`esc` key=v**
**> json.get value=`esc` key="v"**
# main
@@ -21,34 +21,34 @@ import agent:ext/ai/agent.mq.md
| 获取时间 |
*模型 = > llm.llm*
*助手 = > agent.agent model=`模型` tools=`工具表` standing=you are a readable Marqdo agent*
*助手 = > agent.agent model=`模型` tools=`工具表` standing="you are a readable Marqdo agent"*
*id = > json.get value=`助手` key=id*
*id = > json.get value=`助手` key="id"*
*ctx = > agent.build_step_context agent=`助手` task=probe*
*ctx = > agent.build_step_context agent=`助手` task="probe"*
*has_skill = > split value=`ctx` sep=Marqdo*
*has_skill = > split value=`ctx` sep="Marqdo"*
*sk_n = > len value=`has_skill`*
1. `sk_n` > 1
> print text=skill-ok
2. *
> print text=skill-missing
*has_tools = > split value=`ctx` sep=获取时间*
*has_tools = > split value=`ctx` sep="获取时间"*
*tool_n = > len value=`has_tools`*
1. `tool_n` > 1
> print text=tools-ok
2. *
> print text=tools-missing
*has_src = > split value=`ctx` sep=probe*
*has_src = > split value=`ctx` sep="probe"*
*src_n = > len value=`has_src`*
1. `src_n` > 1
> print text=source-ok
2. *
> print text=source-missing
*has_act = > split value=`ctx` sep=CALL:*
*has_act = > split value=`ctx` sep="CALL:"*
*act_n = > len value=`has_act`*
1. `act_n` > 1
> print text=protocol-ok
@@ -56,15 +56,15 @@ import agent:ext/ai/agent.mq.md
> print text=protocol-missing
*samples = > json.parse text={"r":"CALL:获取时间","m":"think\nCALL:获取时间"}*
*raw1 = > json.get value=`samples` key=r*
*raw1 = > json.get value=`samples` key="r"*
*name1 = > agent.extract_tool_name reply=`raw1`*
> print text=`name1`
*raw2 = > json.get value=`samples` key=m*
*raw2 = > json.get value=`samples` key="m"*
*name2 = > agent.extract_tool_name reply=`raw2`*
> print text=`name2`
*tool_out = > agent.run_tool tools=`工具表` name=获取时间*
*tool_out = > agent.run_tool tools=`工具表` name="获取时间"*
> print text=`tool_out`
*turn = > json.parse text={"role":"user","content":"one"}*
@@ -83,5 +83,5 @@ import agent:ext/ai/agent.mq.md
> print text=`n2`
*site = > agent_call_site*
*fn = > json.get value=`site` key=function*
*fn = > json.get value=`site` key="function"*
> print text=`fn`
+5 -5
View File
@@ -8,25 +8,25 @@ import json:lib/json.mq.md
# main
*samples = > json.parse text={"reuse":"DECISION: REUSE\nSLUG: trip-plan\n","new":"DECISION: NEW\n","zh":"决定:复用\n标识:行程-a\n"}*
*r1 = > json.get value=`samples` key=reuse*
*r1 = > json.get value=`samples` key="reuse"*
*d1 = > agent.extract_plan_decision reply=`r1`*
> print text=`d1`
*s1 = > agent.extract_soft_match_slug reply=`r1`*
> print text=`s1`
*r2 = > json.get value=`samples` key=new*
*r2 = > json.get value=`samples` key="new"*
*d2 = > agent.extract_plan_decision reply=`r2`*
> print text=`d2`
*r3 = > json.get value=`samples` key=zh*
*r3 = > json.get value=`samples` key="zh"*
*d3 = > agent.extract_plan_decision reply=`r3`*
> print text=`d3`
*s3 = > agent.extract_soft_match_slug reply=`r3`*
> print text=`s3`
*tasks = > json.parse text=[{"slug":"a","title":"Alpha"},{"slug":"b","title":"Beta"}]*
*prompt = > agent.build_soft_match_prompt goal=demo tasks=`tasks`*
*has = > split value=`prompt` sep=DECISION: REUSE*
*prompt = > agent.build_soft_match_prompt goal="demo" tasks=`tasks`*
*has = > split value=`prompt` sep="DECISION: REUSE"*
*n = > len value=`has`*
1. `n` > 1
> print text=prompt-ok
+3 -3
View File
@@ -7,8 +7,8 @@ import json: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*
*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
@@ -16,7 +16,7 @@ import json:lib/json.mq.md
> 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*
*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`*
+1 -1
View File
@@ -10,6 +10,6 @@ import llm:ext/ai/llm.mq.md
*model = > llm.llm*
*reply = > `model`.complete prompt=Reply with exactly one English word: pong*
*reply = > `model`.complete prompt="Reply with exactly one English word: pong"*
> print text=`reply`
+1 -1
View File
@@ -11,7 +11,7 @@ import json:lib/json.mq.md
*model = > llm.llm*
*events = > `model`.complete prompt=Reply with exactly one English word: pong stream=True echo=True*
*events = > `model`.complete prompt="Reply with exactly one English word: pong" stream=True echo=True*
*n = > len value=`events`*
> print text=`n`
+1 -1
View File
@@ -8,7 +8,7 @@ import quantum:ext/quantum/quantum.mq.md
*qc = > quantum.circuit qubits=1*
*qc = > `qc`.x qubit=0*
*qc = > `qc`.noise kind=amplitude_damping p=1*
*qc = > `qc`.noise kind="amplitude_damping" p=1*
*r = > `qc`.run shots=32 seed=7*
*c0 = r[^counts][^0]*
+1 -1
View File
@@ -8,7 +8,7 @@ description: 泡利X 后 振幅阻尼 p=1 全部落回 |0⟩.
*qc = > 量子.电路 比特数=1*
*qc = > `qc`.泡利X 比特=0*
*qc = > `qc`.噪声 种类=振幅阻尼 概率=1*
*qc = > `qc`.噪声 种类="振幅阻尼" 概率=1*
*r = > `qc`.运行 次数=32 种子=7*
*c0 = r[^counts][^0]*
+1 -1
View File
@@ -19,7 +19,7 @@ import quantum:ext/quantum/quantum.mq.md
2. *
> print text=state-fail
*img = > `qc`.draw path=quantum-author-draw.svg*
*img = > `qc`.draw path="quantum-author-draw.svg"*
*kind = img[^kind]*
1. `kind` == circuit
> print text=draw-ok
+1 -1
View File
@@ -19,7 +19,7 @@ description: 屏障 / 测量 / 追加 / 态 / 绘图.
2. *
> print text=state-fail
*img = > `qc`.绘图 路径=quantum-author-zh-draw.svg*
*img = > `qc`.绘图 路径="quantum-author-zh-draw.svg"*
*kind = img[^kind]*
1. `kind` == circuit
> print text=draw-ok
+1 -1
View File
@@ -12,7 +12,7 @@ $$
\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix}
$$
*U = > quantum.gate matrix=`H_matrix` name=U*
*U = > quantum.gate matrix=`H_matrix` name="U"*
*qc = > quantum.circuit qubits=1*
*qc = > `qc`.apply gate=`U` qubits=0*
*p = > `qc`.probabilities*
+1 -1
View File
@@ -12,7 +12,7 @@ $$
\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix}
$$
*U = > 量子.门 矩阵=`H矩阵` 名=U*
*U = > 量子.门 矩阵=`H矩阵` 名="U"*
*qc = > 量子.电路 比特数=1*
*qc = > `qc`.施加 门=`U` 比特=0*
*p = > `qc`.概率*
+2 -2
View File
@@ -14,7 +14,7 @@ import quantum:ext/quantum/quantum.mq.md
| 2 | CX | 0,1 |
*qc = > quantum.circuit qubits=2 steps=`steps`*
*img = > `qc`.draw kind=probs path=quantum-draw-probs.svg*
*img = > `qc`.draw kind="probs" path="quantum-draw-probs.svg"*
*kind = img[^kind]*
1. `kind` == probs
@@ -24,7 +24,7 @@ import quantum:ext/quantum/quantum.mq.md
*qc1 = > quantum.circuit qubits=1*
*qc1 = > `qc1`.h qubit=0*
*bloch = > `qc1`.draw kind=bloch path=quantum-draw-bloch.svg*
*bloch = > `qc1`.draw kind="bloch" path="quantum-draw-bloch.svg"*
*bk = bloch[^kind]*
1. `bk` == bloch
+2 -2
View File
@@ -6,8 +6,8 @@ import quantum:ext/quantum/quantum.mq.md
# main
*H = > quantum.gate name=H*
*img = > `H`.draw kind=matrix path=quantum-gate-heatmap.svg*
*H = > quantum.gate name="H"*
*img = > `H`.draw kind="matrix" path="quantum-gate-heatmap.svg"*
*kind = img[^kind]*
1. `kind` == matrix
+1 -1
View File
@@ -8,7 +8,7 @@ import json:lib/json.mq.md
# main
*H_matrix = > json.parse text=[[0.7071067811865475,0.7071067811865475],[0.7071067811865475,-0.7071067811865475]]*
*H = > quantum.gate name=H*
*H = > quantum.gate name="H"*
*ok = > `H`.matches_matrix matrix=`H_matrix`*
1. `ok`
+1 -1
View File
@@ -8,7 +8,7 @@ import quantum:ext/quantum/quantum.mq.md
*qc = > quantum.circuit qubits=1*
*qc = > `qc`.i qubit=0*
*qc = > `qc`.noise kind=bitflip p=1*
*qc = > `qc`.noise kind="bitflip" p=1*
*r = > `qc`.run shots=32 seed=3*
*c1 = r[^counts][^1]*
+1 -1
View File
@@ -8,7 +8,7 @@ description: 噪声 bitflip p=1 后 I 使全部射中 |1⟩.
*qc = > 量子.电路 比特数=1*
*qc = > `qc`.单位 比特=0*
*qc = > `qc`.噪声 种类=bitflip 概率=1*
*qc = > `qc`.噪声 种类="bitflip" 概率=1*
*r = > `qc`.运行 次数=32 种子=3*
*c1 = r[^counts][^1]*
+1 -1
View File
@@ -28,7 +28,7 @@ import math:lib/math.mq.md
2. *
> print text=steps-fail
*img = > `qc`.draw path=quantum-steps-draw.svg*
*img = > `qc`.draw path="quantum-steps-draw.svg"*
*kind = img[^kind]*
1. `kind` == circuit
+13 -13
View File
@@ -13,18 +13,18 @@ import json:lib/json.mq.md
> `store`.init name=articles fields=`schema`
> `store`.exec sql="DELETE FROM articles"
> `store`.exec sql="DELETE FROM sqlite_sequence WHERE name='articles'"
*url = > json.get value=`store` key=url*
*url = > json.get value=`store` key="url"*
*info = > web_db_table_info url=`url` table=articles*
*cols = > json.get value=`info` key=columns*
*info = > web_db_table_info url=`url` table="articles"*
*cols = > json.get value=`info` key="columns"*
*n = > len value=`cols`*
1. `n` >= 2
> print text=schema-ok
2. *
> print text=schema-fail
*fnew = > web_form_from_schema url=`url` table=articles action=insert*
*fields = > json.get value=`fnew` key=fields*
*fnew = > web_form_from_schema url=`url` table="articles" action="insert"*
*fields = > json.get value=`fnew` key="fields"*
*nf = > len value=`fields`*
1. `nf` >= 1
> print text=new-form-ok
@@ -38,20 +38,20 @@ import json:lib/json.mq.md
| Admin create | via schema form |
*sub = > web_form_submit form=`fnew` data=`row` url=`url`*
*sok = > json.get value=`sub` key=ok*
*sok = > json.get value=`sub` key="ok"*
1. `sok`
> print text=insert-ok
2. *
> print text=insert-fail
*got = > `store`.get table=articles id=1*
*title = > json.get value=`got` key=title*
*got = > `store`.get table="articles" id=1*
*title = > json.get value=`got` key="title"*
1. `title` == "Admin create"
> print text=get-ok
2. *
> print text=get-fail
*fedit = > web_form_from_schema url=`url` table=articles action=update id=1*
*fedit = > web_form_from_schema url=`url` table="articles" action="update" id=1*
`patch` =
| title | body |
@@ -59,14 +59,14 @@ import json:lib/json.mq.md
| Admin edited | body updated |
*up = > web_form_submit form=`fedit` data=`patch` url=`url`*
*uok = > json.get value=`up` key=ok*
*uok = > json.get value=`up` key="ok"*
1. `uok`
> print text=update-ok
2. *
> print text=update-fail
*got2 = > `store`.get table=articles id=1*
*title2 = > json.get value=`got2` key=title*
*got2 = > `store`.get table="articles" id=1*
*title2 = > json.get value=`got2` key="title"*
1. `title2` == "Admin edited"
> print text=edit-ok
2. *
@@ -79,7 +79,7 @@ import json:lib/json.mq.md
| | |
*bad = > web_form_submit form=`fnew` data=`empty` url=`url`*
*bok = > json.get value=`bad` key=ok*
*bok = > json.get value=`bad` key="ok"*
1. `bok`
> print text=required-should-fail
2. *
+3 -3
View File
@@ -14,13 +14,13 @@ import json:lib/json.mq.md
| title | Title | text | true | |
| body | Body | textarea | false | |
*f = > web.form table=articles action=insert*
*f = > web.form table="articles" action="insert"*
*f = > `f`.fields fields=`fields`*
*page = > web.page title="Compose" intro="<h1>Compose</h1>"*
*page = > `page`.compose_form id=article form=`f`*
*page = > `page`.compose_form id="article" form=`f`*
*fid = > json.get value=`page` key=form_id*
*fid = > json.get value=`page` key="form_id"*
1. `fid`
> print text=form-id-ok
2. *
+5 -5
View File
@@ -26,7 +26,7 @@ import json:lib/json.mq.md
| title | required | Title is required |
| title | max:120 | Title is too long |
*f = > web.form table=articles action=insert*
*f = > web.form table="articles" action="insert"*
*f = > `f`.fields fields=`fields`*
*f = > `f`.rules rules=`rules`*
@@ -37,7 +37,7 @@ import json:lib/json.mq.md
| | hello |
*v = > `f`.validate data=`bad`*
*ok = > json.get value=`v` key=ok*
*ok = > json.get value=`v` key="ok"*
1. `ok`
> print text=validate-should-fail
2. *
@@ -50,20 +50,20 @@ import json:lib/json.mq.md
| From form | Body via submit |
*sub = > `f`.submit data=`good` db=`store`*
*sok = > json.get value=`sub` key=ok*
*sok = > json.get value=`sub` key="ok"*
1. `sok`
> print text=submit-ok
2. *
> print text=submit-fail
*rows = > `store`.select table=articles limit=10*
*rows = > `store`.select table="articles" limit=10*
*n = > len value=`rows`*
1. `n` >= 1
> print text=db-ok
2. *
> print text=db-fail
*html = > `f`.render id=article*
*html = > `f`.render id="article"*
1. `html`
> print text=render-ok
2. *
+5 -5
View File
@@ -25,18 +25,18 @@ import json:lib/json.mq.md
*about = > `about`.compose_components components=`layout`*
*app = > web.app page=`home` host=127.0.0.1 port=18081*
*app = > `app`.route path=/about page=`about`*
*app = > `app`.route path="/about" page=`about`*
*routes = > json.get value=`app` key=routes*
*routes = > json.get value=`app` key="routes"*
*routed = > json.get value=`routes` key="/about"*
*route = > json.get value=`routed` key=_route*
*route = > json.get value=`routed` key="_route"*
1. `route` == "/about"
> print text=route-stamp-ok
2. *
> print text=route-stamp-fail
*home_html = > `home`.render*
*home_chunks = > split value=`home_html` sep=/_part/*
*home_chunks = > split value=`home_html` sep="/_part/"*
*hn = > len value=`home_chunks`*
1. `hn` >= 2
> print text=home-part-ok
@@ -44,7 +44,7 @@ import json:lib/json.mq.md
> print text=home-part-fail
*about_html = > `routed`.render*
*about_chunks = > split value=`about_html` sep=/about/_part/*
*about_chunks = > split value=`about_html` sep="/about/_part/"*
*an = > len value=`about_chunks`*
1. `an` >= 2
> print text=route-part-ok
+3 -3
View File
@@ -10,10 +10,10 @@ import json:lib/json.mq.md
*home = > web.page title="Home" intro="<h1>Home</h1>"*
*about = > web.page title="About" intro="<h1>About</h1>"*
*app = > web.app page=`home` host=127.0.0.1 port=18081*
*app = > `app`.route path=/about page=`about`*
*app = > `app`.route path=docs page=`about`*
*app = > `app`.route path="/about" page=`about`*
*app = > `app`.route path="docs" page=`about`*
*routes = > json.get value=`app` key=routes*
*routes = > json.get value=`app` key="routes"*
*about_page = > json.get value=`routes` key="/about"*
*docs_page = > json.get value=`routes` key="/docs"*
+3 -3
View File
@@ -29,7 +29,7 @@ import json:lib/json.mq.md
|-------|------|
| Alpha | first |
*hit = > `store`.select table=articles where=`eq` limit=50*
*hit = > `store`.select table="articles" where=`eq` limit=50*
*n = > len value=`hit`*
1. `n` == 1
> print text=map-where-ok
@@ -42,14 +42,14 @@ import json:lib/json.mq.md
|------|------|-----|
| title | like | %Alpha% |
*like_rows = > `store`.select table=articles where=`filt` limit=50*
*like_rows = > `store`.select table="articles" where=`filt` limit=50*
*ln = > len value=`like_rows`*
1. `ln` == 2
> print text=like-ok
2. *
> print text=like-fail
*all = > `store`.select table=articles limit=50*
*all = > `store`.select table="articles" limit=50*
*an = > len value=`all`*
1. `an` == 3
> print text=all-ok
+8 -8
View File
@@ -16,7 +16,7 @@ import json:lib/json.mq.md
*store = > web.db url="sqlite:web-fixtures/data/smoke.db"*
*fields = > articles.schema*
> `store`.init name=articles fields=`fields`
*rows = > `store`.select table=articles limit=1*
*rows = > `store`.select table="articles" limit=1*
1. `rows`
*_ = 1*
2. *
@@ -48,33 +48,33 @@ import json:lib/json.mq.md
2. *
> print text=render-fail
*nav = > json.get value=`page` key=nav*
*nav = > json.get value=`page` key="nav"*
1. `nav`
> print text=compose-nav-ok
2. *
> print text=compose-nav-fail
*side = > json.get value=`page` key=sidebar*
*side = > json.get value=`page` key="sidebar"*
1. `side`
> print text=compose-side-ok
2. *
> print text=compose-side-fail
*css = > json.get value=`page` key=styles_css*
*css = > json.get value=`page` key="styles_css"*
1. `css`
> print text=styles-ok
2. *
> print text=styles-fail
*parts = > json.get value=`page` key=parts*
*index_part = > json.get value=`parts` key=index*
*parts = > json.get value=`page` key="parts"*
*index_part = > json.get value=`parts` key="index"*
1. `index_part`
> print text=compose-ok
2. *
> print text=compose-fail
*got = > `store`.get table=articles id=1*
*title = > json.get value=`got` key=title*
*got = > `store`.get table="articles" id=1*
*title = > json.get value=`got` key="title"*
1. `title` == "Hello Marqdo"
> print text=db-ok
2. *
+5 -5
View File
@@ -9,22 +9,22 @@ import json:lib/json.mq.md
*home = > web.page title="Home"*
*app = > web.app page=`home` host=127.0.0.1 port=18081*
*app = > `app`.static dir=web-fixtures/public mount=/static*
*app = > `app`.static dir="web-fixtures/public" mount="/static"*
*dir = > json.get value=`app` key=static_dir*
*dir = > json.get value=`app` key="static_dir"*
1. `dir` == "web-fixtures/public"
> print text=dir-ok
2. *
> print text=dir-fail
*mount = > json.get value=`app` key=static_mount*
*mount = > json.get value=`app` key="static_mount"*
1. `mount` == "/static"
> print text=mount-ok
2. *
> print text=mount-fail
*app2 = > `app`.static dir=assets mount=/assets*
*m2 = > json.get value=`app2` key=static_mount*
*app2 = > `app`.static dir="assets" mount="/assets"*
*m2 = > json.get value=`app2` key="static_mount"*
1. `m2` == "/assets"
> print text=custom-ok
2. *
+6 -6
View File
@@ -50,7 +50,7 @@ import json:lib/json.mq.md
2. *
> print text=render-fail
*nav = > json.get value=`page` key=nav*
*nav = > json.get value=`page` key="nav"*
1. `nav`
> print text=compose-ok
2. *
@@ -62,10 +62,10 @@ import json:lib/json.mq.md
|------|------|------|------|------|
| title | 标题 | text | true | |
*f = > 网页.表单 表=articles 动作=插入*
*f = > 网页.表单 表="articles" 动作="插入"*
*f = > `f`.字段 字段=`fields`*
*page = > `page`.表单装配 id=article 表单=`f`*
*fid = > json.get value=`page` key=form_id*
*page = > `page`.表单装配 id="article" 表单=`f`*
*fid = > json.get value=`page` key="form_id"*
1. `fid` == "article"
> print text=form-ok
2. *
@@ -73,8 +73,8 @@ import json:lib/json.mq.md
*app = > 网页.应用 页面=`page` 数据库=`store` 主机=127.0.0.1 端口=18082*
*about = > 网页.页面 标题="关于" 引言="<p>关于</p>"*
*app = > `app`.路由 路径=/about 页面=`about`*
*routes = > json.get value=`app` key=routes*
*app = > `app`.路由 路径="/about" 页面=`about`*
*routes = > json.get value=`app` key="routes"*
*routed = > json.get value=`routes` key="/about"*
1. `routed`
> print text=route-ok
+1 -1
View File
@@ -5,6 +5,6 @@ description: Read one stdin line (optional prompt)
# main
*name = > input prompt=Name:*
*name = > input prompt="Name:"*
> print text=Hello `name`!
+1 -1
View File
@@ -5,6 +5,6 @@ import foreign:lib/foreign.mq.md
# main
*out = > foreign.run_lang lang=python source=print(2+2)*
*out = > foreign.run_lang lang="python" source=print(2+2)*
> print text=`out`
+2 -2
View File
@@ -5,13 +5,13 @@ import fs:lib/fs.mq.md
# main
*ok = > fs.exists path=hello.txt*
*ok = > fs.exists path="hello.txt"*
1. `ok`
> print text=exists
2. *
> print text=missing
*t = > fs.read_text path=hello.txt*
*t = > fs.read_text path="hello.txt"*
> print text=`t`
+1 -1
View File
@@ -5,6 +5,6 @@ import json:lib/json.mq.md
# main
*q = > json.quote text=hi*
*q = > json.quote text="hi"*
> print text=`q`
+2 -2
View File
@@ -6,7 +6,7 @@ import json:lib/json.mq.md
# main
*raw = > fs.read_text path=sample.json*
*raw = > fs.read_text path="sample.json"*
*obj = > json.parse text=`raw`*
@@ -14,7 +14,7 @@ import json:lib/json.mq.md
> print text=`ty`
*a = > json.get value=`obj` key=a*
*a = > json.get value=`obj` key="a"*
> print text=`a`
+3 -3
View File
@@ -10,16 +10,16 @@ $$
x^3
$$
*df = > math.diff formula=`f` var=x*
*df = > math.diff formula=`f` var="x"*
*ty = > type `df`*
> print text=`ty`
*df2 = > math.diff formula=`df` var=x*
*df2 = > math.diff formula=`df` var="x"*
> print text=`df2`
*y = > math.eval formula=`df` var=x value=2*
*y = > math.eval formula=`df` var="x" value=2*
> print text=`y`
+3 -3
View File
@@ -14,14 +14,14 @@ $$
> print text=`ty`
*df = > math.diff formula=`f` var=x*
*df = > math.diff formula=`f` var="x"*
> print text=`df`
*roots = > math.solve formula=`f` var=x*
*roots = > math.solve formula=`f` var="x"*
> print text=`roots`
*y = > math.eval formula=`f` var=x value=3*
*y = > math.eval formula=`f` var="x" value=3*
> print text=`y`
+1 -1
View File
@@ -10,7 +10,7 @@ $$
x^2
$$
*svg = > math.plot formula=`f` var=x min=-2 max=2*
*svg = > math.plot formula=`f` var="x" min=-2 max=2*
*ok = > type `svg`*
+6 -6
View File
@@ -14,19 +14,19 @@ import json:lib/json.mq.md
> print text=`n`
*e0 = > at value=`events` index=0*
*t0 = > json.get value=`e0` key=type*
*x0 = > json.get value=`e0` key=text*
*t0 = > json.get value=`e0` key="type"*
*x0 = > json.get value=`e0` key="text"*
> print text=`t0`
> print text=`x0`
*e1 = > at value=`events` index=1*
*t1 = > json.get value=`e1` key=type*
*x1 = > json.get value=`e1` key=text*
*t1 = > json.get value=`e1` key="type"*
*x1 = > json.get value=`e1` key="text"*
> print text=`t1`
> print text=`x1`
*e2 = > at value=`events` index=2*
*t2 = > json.get value=`e2` key=type*
*r2 = > json.get value=`e2` key=result*
*t2 = > json.get value=`e2` key="type"*
*r2 = > json.get value=`e2` key="result"*
> print text=`t2`
> print text=`r2`
+3 -3
View File
@@ -11,12 +11,12 @@ import json:lib/json.mq.md
*events = > net.openai_sse_parse text=`fixture`*
- [`ev`](`events`)
*t = > json.get value=`ev` key=type*
*t = > json.get value=`ev` key="type"*
1. `t` == "delta"
*chunk = > json.get value=`ev` key=text*
*chunk = > json.get value=`ev` key="text"*
> print text=`chunk`
2. `t` == "done"
*answer = > json.get value=`ev` key=result*
*answer = > json.get value=`ev` key="result"*
> print text=`answer`
3. *
> print text=bad
+2 -2
View File
@@ -7,7 +7,7 @@ import sys:lib/sys.mq.md
# main
*p = > sys.env_get name=MARQDO_TEST_PLUGIN*
*p = > sys.env_get name="MARQDO_TEST_PLUGIN"*
> plugin.load path=`p`
@@ -15,6 +15,6 @@ import sys:lib/sys.mq.md
> print text=`sum`
*echo = > demo_echo text=ok*
*echo = > demo_echo text="ok"*
> print text=`echo`
+1 -1
View File
@@ -8,7 +8,7 @@ import json:lib/json.mq.md
*args = > json.parse text={"n":21}*
*id = > subtask.spawn fn=worker args=`args`*
*id = > subtask.spawn fn="worker" args=`args`*
*v = > subtask.wait id=`id`*
+4 -4
View File
@@ -6,11 +6,11 @@ import json:lib/json.mq.md
# main
*id = > subtask.spawn path=subtask-child-print.mq.md*
*id = > subtask.spawn path="subtask-child-print.mq.md"*
*waited = > subtask.wait id=`id`*
*code = > json.get value=`waited` key=code*
*val = > json.get value=`waited` key=value*
*stdout = > json.get value=`waited` key=stdout*
*code = > json.get value=`waited` key="code"*
*val = > json.get value=`waited` key="value"*
*stdout = > json.get value=`waited` key="stdout"*
1. `code` == 0
1. `val` == "child_ok"
+6 -6
View File
@@ -6,11 +6,11 @@ import json:lib/json.mq.md
# main
*id = > subtask.spawn path=subtask-child.mq.md quiet=False*
*id = > subtask.spawn path="subtask-child.mq.md" quiet=False*
*waited = > subtask.wait id=`id`*
*code = > json.get value=`waited` key=code*
*val = > json.get value=`waited` key=value*
*code = > json.get value=`waited` key="code"*
*val = > json.get value=`waited` key="value"*
1. `code` == 0
> print text=`val`
@@ -19,11 +19,11 @@ import json:lib/json.mq.md
> print text=done
*id2 = > subtask.spawn path=subtask-child.mq.md*
*id2 = > subtask.spawn path="subtask-child.mq.md"*
*waited2 = > subtask.wait id=`id2`*
*code2 = > json.get value=`waited2` key=code*
*val2 = > json.get value=`waited2` key=value*
*code2 = > json.get value=`waited2` key="code"*
*val2 = > json.get value=`waited2` key="value"*
1. `code2` == 0
1. `val2` == "child_ok"
+1 -1
View File
@@ -10,6 +10,6 @@ import fs:lib/fs.mq.md
> sys.load_dotenv path=dotenv-fixture.env
*v = > sys.env_get name=MARQDO_DOTENV_FIXTURE*
*v = > sys.env_get name="MARQDO_DOTENV_FIXTURE"*
> print text=`v`
+7 -7
View File
@@ -6,7 +6,7 @@ import table:lib/table.mq.md
# main
*h = > table.put in=None at=Authorization value=Bearer-x*
*h = > table.put in=None at="Authorization" value="Bearer-x"*
> print text=`h`[^Authorization]
`xs` =
@@ -16,7 +16,7 @@ import table:lib/table.mq.md
| a |
| b |
*xs = > table.put in=`xs` at=1 value=A*
*xs = > table.put in=`xs` at=1 value="A"*
> print text=`xs`[^1]
> print text=`xs`[^2]
@@ -26,15 +26,15 @@ import table:lib/table.mq.md
|-------|----------|
| m1 | None |
*msg = > table.put in=None at=role value=user*
*msg = > table.put in=`msg` at=content value=hi*
*msg = > table.put in=None at="role" value="user"*
*msg = > table.put in=`msg` at="content" value="hi"*
*messages = > table.append list=None item=`msg`*
*req = > table.put in=`req` at=messages value=`messages`*
*req = > table.put in=`req` at=stream value=True*
*req = > table.put in=`req` at="messages" value=`messages`*
*req = > table.put in=`req` at="stream" value=True*
> print text=`req`[^messages][^1][^content]
> print text=`req`[^stream]
*xs = > table.append list=`xs` item=c*
*xs = > table.append list=`xs` item="c"*
*n = > table.len xs=`xs`*
> print text=`n`
+2 -2
View File
@@ -5,13 +5,13 @@ title: 中文文件库
# main
*有 = > 文件.存在 路径=hello.txt*
*有 = > 文件.存在 路径="hello.txt"*
1. `有`
> 打印 内容=存在
2. *
> 打印 内容=缺失
*t = > 文件.读文本 路径=hello.txt*
*t = > 文件.读文本 路径="hello.txt"*
> 打印 内容=`t`
+3 -3
View File
@@ -6,7 +6,7 @@ description: 改 + 列表字典
# main
*h = > 表.改 入=None 于=Authorization 值=Bearer-x*
*h = > 表.改 入=None 于="Authorization" 值="Bearer-x"*
> 打印 内容=`h`[^Authorization]
`xs` =
@@ -16,9 +16,9 @@ description: 改 + 列表字典
| a |
| b |
*xs = > 表.改 入=`xs` 于=1 值=A*
*xs = > 表.改 入=`xs` 于=1 值="A"*
> 打印 内容=`xs`[^1]
*xs = > 表.追加 list=`xs` item=c*
*xs = > 表.追加 list=`xs` item="c"*
*n = > 表.长度 xs=`xs`*
> 打印 内容=`n`
+1 -1
View File
@@ -6,7 +6,7 @@ title: import official lib (Chinese)
# main
*t = > 文本.去空白 s= x*
*t = > 文本.去空白 s=" x"*
> 打印 内容=`t`
+6 -6
View File
@@ -7,22 +7,22 @@ import json:lib/json.mq.md
+ `name`
*out = > json.parse text={"role":"parent"}*
*out = > json.set map=`out` key=name value=`name`*
*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 = > 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*
*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`
+2 -2
View File
@@ -21,8 +21,8 @@ title: inherit method override
# main
*g = > Greeter*
*m = > `g`.hello who=world*
*m = > `g`.hello who="world"*
> print text=`m`
*l = > Loud*
*m2 = > `l`.hello who=world*
*m2 = > `l`.hello who="world"*
> print text=`m2`
+2 -2
View File
@@ -16,7 +16,7 @@ import json:lib/json.mq.md
# main
*l = > Loud*
*ty = > json.get value=`l` key=_type*
*ty = > json.get value=`l` key="_type"*
> print text=`ty`
*m = > `l`.hello who=world*
*m = > `l`.hello who="world"*
> print text=`m`
+1 -1
View File
@@ -5,7 +5,7 @@ import helpers:helpers.mq.md
# main
*v = > helpers.pack.label s=ok*
*v = > helpers.pack.label s="ok"*
> print text=`v`
+1 -1
View File
@@ -6,6 +6,6 @@ import trim_text:text.str_trim
# main
*t = > trim_text s= hi*
*t = > trim_text s=" hi"*
> print text=`t`
+8 -8
View File
@@ -8,19 +8,19 @@ import json:lib/json.mq.md
*t = > json.parse text={"p":"{\"n\":","s":"}"}*
*qn = > str `n`*
*p = > json.get value=`t` key=p*
*s = > json.get value=`t` key=s*
*p = > json.get value=`t` key="p"*
*s = > json.get value=`t` key="s"*
*raw = p + qn + s*
**> json.parse text=`raw`**
## bump
*n = > json.get value=`self` key=n*
*n = > json.get value=`self` key="n"*
*n2 = n + 1*
*t = > json.parse text={"p":"{\"n\":","s":"}"}*
*qn = > str `n2`*
*p = > json.get value=`t` key=p*
*s = > json.get value=`t` key=s*
*p = > json.get value=`t` key="p"*
*s = > json.get value=`t` key="s"*
*raw = p + qn + s*
*m = > json.parse text=`raw`*
**m**
@@ -28,10 +28,10 @@ import json:lib/json.mq.md
# main
*c = > counter n=3*
*ty = > json.get value=`c` key=_type*
*ty = > json.get value=`c` key="_type"*
> print text=`ty`
*n = > json.get value=`c` key=n*
*n = > json.get value=`c` key="n"*
> print text=`n`
*c2 = > `c`.bump*
*n2 = > json.get value=`c2` key=n*
*n2 = > json.get value=`c2` key="n"*
> print text=`n2`