Add module namespaces and harden L1/agent after the import redesign.
Bind imports to library names with bare path calls (and use), forward optional host args through mq wrappers, stabilize writeback replacement newlines, and document the M1/M2 decisions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
99132ac8fc
commit
1f23e2ed93
108 files changed
+3228
-1023
No files matched your search
@@ -6,7 +6,7 @@ title: import official lib (Chinese)
|
||||
|
||||
# main
|
||||
|
||||
*`t` = > 去空白 s= x *
|
||||
*`t` = > 文本.去空白 s= x *
|
||||
|
||||
> 打印 内容=`t`
|
||||
|
||||
@@ -17,10 +17,10 @@ title: import official lib (Chinese)
|
||||
| a |
|
||||
| b |
|
||||
|
||||
*`n` = > 行数 xs=`xs`*
|
||||
*`n` = > 表.行数 xs=`xs`*
|
||||
|
||||
> 打印 内容=`n`
|
||||
|
||||
*`row` = > 取行 xs=`xs` i=0*
|
||||
*`row` = > 表.取行 xs=`xs` i=0*
|
||||
|
||||
> 打印 内容=`row`
|
||||
@@ -7,8 +7,8 @@ title: 跨文件导入示例
|
||||
|
||||
导入 `utils.mq.md` 后:用返回值绑定,再输出;并直接调用问候。
|
||||
|
||||
*`y` = > 加一 n=41*
|
||||
*`y` = > utils.加一 n=41*
|
||||
|
||||
> print text=`y`
|
||||
|
||||
> 问候 谁=Marqdo
|
||||
> utils.问候 谁=Marqdo
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: namespace path helpers
|
||||
---
|
||||
|
||||
## pack
|
||||
|
||||
Nested free function (not an object method) for `helpers.pack.label`.
|
||||
|
||||
### label
|
||||
+ `s`
|
||||
|
||||
**`s`**
|
||||
|
||||
# Box
|
||||
|
||||
## tag
|
||||
+ `s`
|
||||
|
||||
**`s`**
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: three-segment library path
|
||||
> helpers.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*`v` = > helpers.pack.label s=ok*
|
||||
|
||||
> print text=`v`
|
||||
|
||||
*`b` = > helpers.Box *
|
||||
|
||||
> print text=constructed
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: frontmatter use short name
|
||||
> lib/text.mq.md
|
||||
> use text.str_trim as trim_text
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*`t` = > trim_text s= hi *
|
||||
|
||||
> print text=`t`
|
||||
@@ -6,32 +6,32 @@ title: object handle smoke
|
||||
# counter
|
||||
+ `n`
|
||||
|
||||
*`t` = > parse text={"p":"{\"n\":","s":"}"} *
|
||||
*`t` = > json.parse text={"p":"{\"n\":","s":"}"} *
|
||||
*`qn` = > str `n` *
|
||||
*`p` = > get value=`t` key=p *
|
||||
*`s` = > get value=`t` key=s *
|
||||
*`p` = > json.get value=`t` key=p *
|
||||
*`s` = > json.get value=`t` key=s *
|
||||
*`raw` = `p` + `qn` + `s` *
|
||||
**> parse text=`raw`**
|
||||
**> json.parse text=`raw`**
|
||||
|
||||
## bump
|
||||
|
||||
*`n` = > get value=`self` key=n *
|
||||
*`n` = > json.get value=`self` key=n *
|
||||
*`n2` = `n` + 1*
|
||||
*`t` = > parse text={"p":"{\"n\":","s":"}"} *
|
||||
*`t` = > json.parse text={"p":"{\"n\":","s":"}"} *
|
||||
*`qn` = > str `n2` *
|
||||
*`p` = > get value=`t` key=p *
|
||||
*`s` = > get value=`t` key=s *
|
||||
*`p` = > json.get value=`t` key=p *
|
||||
*`s` = > json.get value=`t` key=s *
|
||||
*`raw` = `p` + `qn` + `s` *
|
||||
*`m` = > parse text=`raw` *
|
||||
*`m` = > json.parse text=`raw` *
|
||||
**`m`**
|
||||
|
||||
# main
|
||||
|
||||
*`c` = > counter n=3 *
|
||||
*`ty` = > get value=`c` key=_type *
|
||||
*`ty` = > json.get value=`c` key=_type *
|
||||
> print text=`ty`
|
||||
*`n` = > get value=`c` key=n *
|
||||
*`n` = > json.get value=`c` key=n *
|
||||
> print text=`n`
|
||||
*`c2` = > `c`.bump *
|
||||
*`n2` = > get value=`c2` key=n *
|
||||
*`n2` = > json.get value=`c2` key=n *
|
||||
> print text=`n2`
|
||||
Reference in new issue
Block a user