feat(markup): adopt v0.3 as sole mapping (** code, * return)

Make prose-unified Markup the only runtime: bold segments are executable,
italic is return, params can be inferred from body/prose, with no v0.2 dual
mode. Migrate lib and structure/keywords golds; gate on tests/markup-v03.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-13 20:38:53 +08:00
1 parent 00a77181ef
commit bfb10d172b
114 files changed
+2271 -732

No files matched your search

+36 -36
View File
@@ -12,8 +12,8 @@ import table:lib/table.mq.md
Build set_text effect map for the official bridge.
*`m` = > table.put in=None at=sel value=text*
**> table.put in=None at="set_text" value=m**
**`m` = > table.put in=None at=sel value=text**
*> table.put in=None at="set_text" value=m*
## set_html
+ `sel`
@@ -21,8 +21,8 @@ Build set_text effect map for the official bridge.
Build set_html effect map.
*`m` = > table.put in=None at=sel value=html*
**> table.put in=None at="set_html" value=m**
**`m` = > table.put in=None at=sel value=html**
*> table.put in=None at="set_html" value=m*
## set_value
+ `sel`
@@ -30,8 +30,8 @@ Build set_html effect map.
Build set_value effect map.
*`m` = > table.put in=None at=sel value=value*
**> table.put in=None at="set_value" value=m**
**`m` = > table.put in=None at=sel value=value**
*> table.put in=None at="set_value" value=m*
## set_class
+ `sel`
@@ -39,8 +39,8 @@ Build set_value effect map.
Build set_class effect map.
*`m` = > table.put in=None at=sel value=class*
**> table.put in=None at="set_class" value=m**
**`m` = > table.put in=None at=sel value=class**
*> table.put in=None at="set_class" value=m*
## set_attr
+ `sel`
@@ -48,8 +48,8 @@ Build set_class effect map.
Build set_attr effect map; attrs is usually a small map of attribute names to values.
*`m` = > table.put in=None at=sel value=attrs*
**> table.put in=None at="set_attr" value=m**
**`m` = > table.put in=None at=sel value=attrs**
*> table.put in=None at="set_attr" value=m*
## wrap
+ `key`
@@ -57,7 +57,7 @@ Build set_attr effect map; attrs is usually a small map of attribute names to va
Single-key effect map wrapper.
**> table.put in=None at=key value=value**
*> table.put in=None at=key value=value*
## merge
+ `a`
@@ -65,7 +65,7 @@ Single-key effect map wrapper.
Merge two effect maps; right-hand keys win.
**> table.merge a=`a` b=`b`**
*> table.merge a=`a` b=`b`*
## canvas
+ `sel`
@@ -80,7 +80,7 @@ Build canvas effect; commands is usually an @ GFM table.
|-----|-------|----------|
| `sel` | `clear` | `commands` |
**> table.put in=None at="canvas" value=spec**
*> table.put in=None at="canvas" value=spec*
## audio
+ `op`="play"
@@ -92,17 +92,17 @@ Build canvas effect; commands is usually an @ GFM table.
Build audio effect for the bridge.
*`spec` = > table.put in=None at="op" value=op*
*`spec` = > table.put in=`spec` at="id" value=id*
**`spec` = > table.put in=None at="op" value=op**
**`spec` = > table.put in=`spec` at="id" value=id**
1. `src` != ""
*`spec` = > table.put in=`spec` at="src" value=src*
**`spec` = > table.put in=`spec` at="src" value=src**
1. `freq` != None
*`spec` = > table.put in=`spec` at="freq" value=freq*
**`spec` = > table.put in=`spec` at="freq" value=freq**
1. `ms` != None
*`spec` = > table.put in=`spec` at="ms" value=ms*
**`spec` = > table.put in=`spec` at="ms" value=ms**
1. `sel` != ""
*`spec` = > table.put in=`spec` at="sel" value=sel*
**> table.put in=None at="audio" value=spec**
**`spec` = > table.put in=`spec` at="sel" value=sel**
*> table.put in=None at="audio" value=spec*
## read_file
+ `sel`
@@ -117,26 +117,26 @@ Build read_file effect.
|-----|----|------|
| `sel` | `as` | `then` |
**> table.put in=None at="read_file" value=spec**
*> table.put in=None at="read_file" value=spec*
## observe
+ `specs`
Build observe effect; specs is one map or an @ list of maps.
**> table.put in=None at="observe" value=specs**
*> table.put in=None at="observe" value=specs*
## unobserve
+ `specs`
Build unobserve effect; specs is a map or @ list with id.
**> table.put in=None at="unobserve" value=specs**
*> table.put in=None at="unobserve" value=specs*
## focus
+ `sel`
**> table.put in=None at="focus" value=sel**
*> table.put in=None at="focus" value=sel*
## navigate
+ `url`
@@ -148,12 +148,12 @@ Build unobserve effect; specs is a map or @ list with id.
|-----|---------|
| `url` | `replace` |
**> table.put in=None at="navigate" value=spec**
*> table.put in=None at="navigate" value=spec*
## storage
+ `spec`
**> table.put in=None at="storage" value=spec**
*> table.put in=None at="storage" value=spec*
## interval
+ `ms`
@@ -166,13 +166,13 @@ Build unobserve effect; specs is a map or @ list with id.
|----|------|----|
| `ms` | `then` | `id` |
**> table.put in=None at="interval" value=spec**
*> table.put in=None at="interval" value=spec*
## clear_interval
+ `id`="default"
*`spec` = > table.put in=None at="id" value=id*
**> table.put in=None at="clear_interval" value=spec**
**`spec` = > table.put in=None at="id" value=id**
*> table.put in=None at="clear_interval" value=spec*
## fetch
+ `url`
@@ -185,7 +185,7 @@ Build unobserve effect; specs is a map or @ list with id.
|-----|------|--------|
| `url` | `then` | `method` |
**> table.put in=None at="fetch" value=spec**
*> table.put in=None at="fetch" value=spec*
## fetch_all
+ `requests`
@@ -197,7 +197,7 @@ Build unobserve effect; specs is a map or @ list with id.
|----------|------|
| `requests` | `then` |
**> table.put in=None at="fetch_all" value=spec**
*> table.put in=None at="fetch_all" value=spec*
## after
+ `ms`
@@ -209,18 +209,18 @@ Build unobserve effect; specs is a map or @ list with id.
|----|------|
| `ms` | `then` |
**> table.put in=None at="after" value=spec**
*> table.put in=None at="after" value=spec*
## ws
+ `spec`
**> table.put in=None at="ws" value=spec**
*> table.put in=None at="ws" value=spec*
## clipboard
+ `text`
*`spec` = > table.put in=None at="text" value=text*
**> table.put in=None at="clipboard" value=spec**
**`spec` = > table.put in=None at="text" value=text**
*> table.put in=None at="clipboard" value=spec*
## download
+ `body`
@@ -233,4 +233,4 @@ Build unobserve effect; specs is a map or @ list with id.
|------|----------|------|
| `body` | `filename` | `mime` |
**> table.put in=None at="download" value=spec**
*> table.put in=None at="download" value=spec*
+1 -1
View File
@@ -8,4 +8,4 @@ description: Parse argv flags (Mid M5). --key value / --key=value / --flag; posi
Parse `--key value` / `--key=value` / `--flag`. A bare `--flag` must not be followed by a non-option token if you need it as boolean (put flags last, or use `--flag=true`). Positionals land under `_`.
**> host_cli_parse args=`args`**
*> host_cli_parse args=`args`*
+2 -2
View File
@@ -6,9 +6,9 @@ description: RFC4180-ish CSV parse/stringify (Mid M4). First row = headers → l
## parse
+ `text`
**> host_csv_parse text=`text`**
*> host_csv_parse text=`text`*
## stringify
+ `rows`
**> host_csv_stringify rows=`rows`**
*> host_csv_stringify rows=`rows`*
+7 -7
View File
@@ -7,18 +7,18 @@ description: Calendar moments as maps {unix, zone, iso} (Mid2 M7). Fixed offsets
Current UTC moment map.
**> host_datetime_now**
*> host_datetime_now*
## from_unix
+ `unix`
+ `zone`=None
**> host_datetime_from_unix unix=`unix` zone=`zone`**
*> host_datetime_from_unix unix=`unix` zone=`zone`*
## to_unix
+ `dt`
**> host_datetime_to_unix dt=`dt`**
*> host_datetime_to_unix dt=`dt`*
## parse
+ `text`
@@ -26,7 +26,7 @@ Current UTC moment map.
RFC3339 / `YYYY-MM-DD[ HH:MM:SS]` by default; `pattern=` is strftime or `rfc3339`.
**> host_datetime_parse text=`text` pattern=`pattern`**
*> host_datetime_parse text=`text` pattern=`pattern`*
## format
+ `dt`
@@ -34,7 +34,7 @@ RFC3339 / `YYYY-MM-DD[ HH:MM:SS]` by default; `pattern=` is strftime or `rfc3339
Styles: `rfc3339` (default), `date`, `time`, or a strftime pattern.
**> host_datetime_format dt=`dt` style=`style`**
*> host_datetime_format dt=`dt` style=`style`*
## add
+ `dt`
@@ -43,7 +43,7 @@ Styles: `rfc3339` (default), `date`, `time`, or a strftime pattern.
+ `minutes`=None
+ `seconds`=None
**> host_datetime_add dt=`dt` days=`days` hours=`hours` minutes=`minutes` seconds=`seconds`**
*> host_datetime_add dt=`dt` days=`days` hours=`hours` minutes=`minutes` seconds=`seconds`*
## in_zone
+ `dt`
@@ -51,4 +51,4 @@ Styles: `rfc3339` (default), `date`, `time`, or a strftime pattern.
Re-express the same instant in `+08:00` / `UTC` / fixed aliases like `Asia/Shanghai`.
**> host_datetime_in_zone dt=`dt` zone=`zone`**
*> host_datetime_in_zone dt=`dt` zone=`zone`*
+6 -6
View File
@@ -6,31 +6,31 @@ description: Base64, hex, and base32 encode/decode (Mid M1 + Mid2 M8). UTF-8 tex
## base64_encode
+ `text`
**> host_encoding_base64_encode text=`text`**
*> host_encoding_base64_encode text=`text`*
## base64_decode
+ `text`
**> host_encoding_base64_decode text=`text`**
*> host_encoding_base64_decode text=`text`*
## hex_encode
+ `text`
**> host_encoding_hex_encode text=`text`**
*> host_encoding_hex_encode text=`text`*
## hex_decode
+ `text`
**> host_encoding_hex_decode text=`text`**
*> host_encoding_hex_decode text=`text`*
## base32_encode
+ `text`
RFC 4648 alphabet; padding with `=`.
**> host_encoding_base32_encode text=`text`**
*> host_encoding_base32_encode text=`text`*
## base32_decode
+ `text`
**> host_encoding_base32_decode text=`text`**
*> host_encoding_base32_decode text=`text`*
+4 -4
View File
@@ -7,21 +7,21 @@ description: Run bound code fences and inline sources via local interpreters
+ `lang`
+ `cmd`
**> host_foreign_set_cmd lang=`lang` cmd=`cmd`**
*> host_foreign_set_cmd lang=`lang` cmd=`cmd`*
## run
+ `code`
+ `stdin`=None
**> host_foreign_run code=`code` stdin=`stdin`**
*> host_foreign_run code=`code` stdin=`stdin`*
## run_lang
+ `lang`
+ `source`
+ `stdin`=None
**> host_foreign_run_lang lang=`lang` source=`source` stdin=`stdin`**
*> host_foreign_run_lang lang=`lang` source=`source` stdin=`stdin`*
## langs
**> host_foreign_langs**
*> host_foreign_langs*
+17 -17
View File
@@ -6,67 +6,67 @@ description: English filesystem wrappers
## read_text
+ `path`
**> host_read_text path=`path`**
*> host_read_text path=`path`*
## write_text
+ `path`
+ `text`
**> host_write_text path=`path` text=`text`**
*> host_write_text path=`path` text=`text`*
## append_text
+ `path`
+ `text`
**> host_append_text path=`path` text=`text`**
*> host_append_text path=`path` text=`text`*
## exists
+ `path`
**> host_exists path=`path`**
*> host_exists path=`path`*
## list_dir
+ `path`
**> host_list_dir path=`path`**
*> host_list_dir path=`path`*
## make_dir
+ `path`
**> host_make_dir path=`path`**
*> host_make_dir path=`path`*
## make_dirs
+ `path`
Create directories recursively (`mkdir -p`).
**> host_make_dirs path=`path`**
*> host_make_dirs path=`path`*
## remove
+ `path`
**> host_remove path=`path`**
*> host_remove path=`path`*
## remove_tree
+ `path`
Remove a directory recursively. Errors if `path` is a file.
**> host_remove_tree path=`path`**
*> host_remove_tree path=`path`*
## stat
+ `path`
Returns `{size, mtime_unix, is_file, is_dir}`.
**> host_stat path=`path`**
*> host_stat path=`path`*
## walk
+ `path`
Depth-first listing of relative paths under `path` (forward slashes).
**> host_walk path=`path`**
*> host_walk path=`path`*
## copy_file
+ `src`
@@ -74,7 +74,7 @@ Depth-first listing of relative paths under `path` (forward slashes).
Copy a file (overwrites `dest` if it exists). Paths are sandboxed like other fs ops.
**> host_copy_file src=`src` dest=`dest`**
*> host_copy_file src=`src` dest=`dest`*
## move
+ `src`
@@ -82,14 +82,14 @@ Copy a file (overwrites `dest` if it exists). Paths are sandboxed like other fs
Rename / move within the sandbox.
**> host_move src=`src` dest=`dest`**
*> host_move src=`src` dest=`dest`*
## make_temp
+ `prefix`=None
Create an empty temp file under the program directory; return its relative path.
**> host_make_temp prefix=`prefix`**
*> host_make_temp prefix=`prefix`*
## text_patch
+ `path`
@@ -98,7 +98,7 @@ Create an empty temp file under the program directory; return its relative path.
Exact FIND→REPLACE once in a UTF-8 text file. `find` must match exactly once.
**> host_text_patch path=`path` find=`find` replace=`replace`**
*> host_text_patch path=`path` find=`find` replace=`replace`*
## apply_patch_blocks
+ `path`
@@ -107,6 +107,6 @@ Exact FIND→REPLACE once in a UTF-8 text file. `find` must match exactly once.
Apply plan-style triple-angle FIND/REPLACE blocks from `text` to `path`.
Also accepts fenced find/replace pairs and minimal Begin Patch hunks.
When `soft=True`, **only** “FIND not found” returns `0` (run continues). Empty FIND, multi-match, parse errors, and whole-file FIND still abort — whole-file rewrite is forbidden.
When `soft=True`, *only* “FIND not found” returns `0` (run continues). Empty FIND, multi-match, parse errors, and whole-file FIND still abort — whole-file rewrite is forbidden.
**> host_apply_patch_blocks path=`path` text=`text` soft=`soft`**
*> host_apply_patch_blocks path=`path` text=`text` soft=`soft`*
+4 -4
View File
@@ -6,20 +6,20 @@ description: Digests and HMAC (Mid M3). Integrity / cache keys — not password
## sha256
+ `text`
**> host_hash_sha256 text=`text`**
*> host_hash_sha256 text=`text`*
## sha1
+ `text`
**> host_hash_sha1 text=`text`**
*> host_hash_sha1 text=`text`*
## md5
+ `text`
**> host_hash_md5 text=`text`**
*> host_hash_md5 text=`text`*
## hmac_sha256
+ `key`
+ `text`
**> host_hash_hmac_sha256 key=`key` text=`text`**
*> host_hash_hmac_sha256 key=`key` text=`text`*
+2 -2
View File
@@ -6,9 +6,9 @@ description: HTML escape / unescape (Mid2 M8). XSS floor for string assembly.
## escape
+ `text`
**> host_html_escape text=`text`**
*> host_html_escape text=`text`*
## unescape
+ `text`
**> host_html_unescape text=`text`**
*> host_html_unescape text=`text`*
+7 -7
View File
@@ -6,39 +6,39 @@ description: JSON parse/stringify (shared EN/ZH import)
## parse
+ `text`
**> host_json_parse text=`text`**
*> host_json_parse text=`text`*
## stringify
+ `value`
+ `indent`=None
**> host_json_stringify value=`value` indent=`indent`**
*> host_json_stringify value=`value` indent=`indent`*
## get
+ `value`
+ `key`
**> host_json_get value=`value` key=`key`**
*> host_json_get value=`value` key=`key`*
## keys
+ `value`
**> host_json_keys value=`value`**
*> host_json_keys value=`value`*
## quote
+ `text`
**> host_json_quote text=`text`**
*> host_json_quote text=`text`*
## set
+ `map`
+ `key`
+ `value`
**> host_map_set map=`map` key=`key` value=`value`**
*> host_map_set map=`map` key=`key` value=`value`*
## append
+ `list`
+ `item`
**> host_list_append list=`list` item=`item`**
*> host_list_append list=`list` item=`item`*
+9 -9
View File
@@ -8,44 +8,44 @@ description: Level-filtered one-line logs (Mid M6 + Mid2 M10 fields). Default le
level is debug / info / warn / error.
**> host_log_set_level level=`level`**
*> host_log_set_level level=`level`*
## debug
+ `text`
+ `fields`=None
*line = > host_log_line level="debug" text=`text` fields=`fields`*
**line = > host_log_line level="debug" text=`text` fields=`fields`**
1. `line`
> print text=`line`
2. *
2. **
****
## info
+ `text`
+ `fields`=None
*line = > host_log_line level="info" text=`text` fields=`fields`*
**line = > host_log_line level="info" text=`text` fields=`fields`**
1. `line`
> print text=`line`
2. *
2. **
****
## warn
+ `text`
+ `fields`=None
*line = > host_log_line level="warn" text=`text` fields=`fields`*
**line = > host_log_line level="warn" text=`text` fields=`fields`**
1. `line`
> print text=`line`
2. *
2. **
****
## error
+ `text`
+ `fields`=None
*line = > host_log_line level="error" text=`text` fields=`fields`*
**line = > host_log_line level="error" text=`text` fields=`fields`**
1. `line`
> print text=`line`
2. *
2. **
****
+36 -36
View File
@@ -5,173 +5,173 @@ description: High-school math — num, random, formula, plot
## pi
**> host_pi**
*> host_pi*
## e
**> host_e**
*> host_e*
## num
+ `value`
**> host_num value=`value`**
*> host_num value=`value`*
## add
+ `a`
+ `b`
**> host_math_add a=`a` b=`b`**
*> host_math_add a=`a` b=`b`*
## sub
+ `a`
+ `b`
**> host_math_sub a=`a` b=`b`**
*> host_math_sub a=`a` b=`b`*
## mul
+ `a`
+ `b`
**> host_math_mul a=`a` b=`b`**
*> host_math_mul a=`a` b=`b`*
## div
+ `a`
+ `b`
**> host_math_div a=`a` b=`b`**
*> host_math_div a=`a` b=`b`*
## pow
+ `a`
+ `b`
**> host_math_pow a=`a` b=`b`**
*> host_math_pow a=`a` b=`b`*
## neg
+ `value`
**> host_math_neg value=`value`**
*> host_math_neg value=`value`*
## sin
+ `value`
**> host_math_sin value=`value`**
*> host_math_sin value=`value`*
## cos
+ `value`
**> host_math_cos value=`value`**
*> host_math_cos value=`value`*
## tan
+ `value`
**> host_math_tan value=`value`**
*> host_math_tan value=`value`*
## asin
+ `value`
**> host_math_asin value=`value`**
*> host_math_asin value=`value`*
## acos
+ `value`
**> host_math_acos value=`value`**
*> host_math_acos value=`value`*
## atan
+ `value`
**> host_math_atan value=`value`**
*> host_math_atan value=`value`*
## sqrt
+ `value`
**> host_math_sqrt value=`value`**
*> host_math_sqrt value=`value`*
## abs
+ `value`
**> host_math_abs value=`value`**
*> host_math_abs value=`value`*
## ln
+ `value`
**> host_math_ln value=`value`**
*> host_math_ln value=`value`*
## exp
+ `value`
**> host_math_exp value=`value`**
*> host_math_exp value=`value`*
## floor
+ `value`
**> host_math_floor value=`value`**
*> host_math_floor value=`value`*
## ceil
+ `value`
**> host_math_ceil value=`value`**
*> host_math_ceil value=`value`*
## min
+ `a`
+ `b`
**> host_math_min a=`a` b=`b`**
*> host_math_min a=`a` b=`b`*
## max
+ `a`
+ `b`
**> host_math_max a=`a` b=`b`**
*> host_math_max a=`a` b=`b`*
## random
**> host_random**
*> host_random*
## random_int
+ `min`
+ `max`
**> host_random_int min=`min` max=`max`**
*> host_random_int min=`min` max=`max`*
## seed
+ `value`
**> host_seed value=`value`**
*> host_seed value=`value`*
## formula
+ `text`
**> host_formula value=`text`**
*> host_formula value=`text`*
## simplify
+ `formula`
**> host_simplify value=`formula`**
*> host_simplify value=`formula`*
## expand
+ `formula`
**> host_expand value=`formula`**
*> host_expand value=`formula`*
## diff
+ `formula`
+ `var`
**> host_diff formula=`formula` var=`var`**
*> host_diff formula=`formula` var=`var`*
## subs
+ `formula`
+ `var`
+ `value`
**> host_subs formula=`formula` var=`var` value=`value`**
*> host_subs formula=`formula` var=`var` value=`value`*
## eval
+ `formula`
+ `var`
+ `value`
**> host_eval formula=`formula` var=`var` value=`value`**
*> host_eval formula=`formula` var=`var` value=`value`*
## solve
+ `formula`
@@ -179,7 +179,7 @@ description: High-school math — num, random, formula, plot
+ `min`=None
+ `max`=None
**> host_solve formula=`formula` var=`var` min=`min` max=`max`**
*> host_solve formula=`formula` var=`var` min=`min` max=`max`*
## plot
+ `formula`
@@ -191,7 +191,7 @@ description: High-school math — num, random, formula, plot
+ `derivative`=None
+ `grid`=None
**> host_plot formula=`formula` var=`var` min=`min` max=`max` steps=`steps` path=`path` derivative=`derivative` grid=`grid`**
*> host_plot formula=`formula` var=`var` min=`min` max=`max` steps=`steps` path=`path` derivative=`derivative` grid=`grid`*
## plot_points
+ `xs`
@@ -199,7 +199,7 @@ description: High-school math — num, random, formula, plot
+ `path`=None
+ `grid`=None
**> host_plot_points xs=`xs` ys=`ys` path=`path` grid=`grid`**
*> host_plot_points xs=`xs` ys=`ys` path=`path` grid=`grid`*
## plot_conic
+ `kind`
@@ -210,4 +210,4 @@ description: High-school math — num, random, formula, plot
+ `path`=None
+ `grid`=None
**> host_plot_conic kind=`kind` a=`a` b=`b` h=`h` k=`k` path=`path` grid=`grid`**
*> host_plot_conic kind=`kind` a=`a` b=`b` h=`h` k=`k` path=`path` grid=`grid`*
+9 -9
View File
@@ -9,7 +9,7 @@ description: English HTTP(S) wrappers. Optional headers / content_type via host
HTTPS supported. Optional named arg `headers=` (map).
**> host_http_get url=`url` headers=`headers`**
*> host_http_get url=`url` headers=`headers`*
## http_post
+ `url`
@@ -19,7 +19,7 @@ HTTPS supported. Optional named arg `headers=` (map).
Default content type is JSON. Optional `content_type=` / `headers=` (map).
**> host_http_post url=`url` body=`body` content_type=`content_type` headers=`headers`**
*> host_http_post url=`url` body=`body` content_type=`content_type` headers=`headers`*
## http_post_sse
+ `url`
@@ -30,7 +30,7 @@ Default content type is JSON. Optional `content_type=` / `headers=` (map).
POST and consume OpenAI-compatible SSE. Returns `{status, events}` where `events` is a list of `{type, …}` maps (`delta` / `done` / `error`). Optional `echo=True` prints delta text to stdout as chunks arrive.
**> host_http_post_sse url=`url` body=`body` content_type=`content_type` headers=`headers` echo=`echo`**
*> host_http_post_sse url=`url` body=`body` content_type=`content_type` headers=`headers` echo=`echo`*
## openai_sse_parse
+ `text`
@@ -38,7 +38,7 @@ POST and consume OpenAI-compatible SSE. Returns `{status, events}` where `events
Offline: parse an OpenAI chat SSE body into the same event list (no network).
**> host_openai_sse_parse text=`text` echo=`echo`**
*> host_openai_sse_parse text=`text` echo=`echo`*
## http_request
+ `method`
@@ -49,12 +49,12 @@ Offline: parse an OpenAI chat SSE body into the same event list (no network).
Optional `body=` / `content_type=` / `headers=`.
**> host_http_request method=`method` url=`url` body=`body` content_type=`content_type` headers=`headers`**
*> host_http_request method=`method` url=`url` body=`body` content_type=`content_type` headers=`headers`*
## url_encode
+ `text`
**> host_url_encode text=`text`**
*> host_url_encode text=`text`*
## cookie_parse
+ `text`
@@ -62,7 +62,7 @@ Optional `body=` / `content_type=` / `headers=`.
Parse a `Cookie` request header (default) or one or more `Set-Cookie` response headers (`is_response=True`) into a list of `{name, value, path, domain, expires, max_age, secure, http_only, same_site}`.
**> host_cookie_parse text=`text` is_response=`is_response`**
*> host_cookie_parse text=`text` is_response=`is_response`*
## multipart_parse
+ `body`
@@ -70,11 +70,11 @@ Parse a `Cookie` request header (default) or one or more `Set-Cookie` response h
Parse a `multipart/form-data` request body (given its `boundary`) into a list of `{name, filename?, content_type?, value}` parts.
**> host_multipart_parse body=`body` boundary=`boundary`**
*> host_multipart_parse body=`body` boundary=`boundary`*
## markdown_parse
+ `text`
Parse Markdown / GFM into HTML (pure transform, no network I/O).
**> host_markdown_parse text=`text`**
*> host_markdown_parse text=`text`*
+7 -7
View File
@@ -7,34 +7,34 @@ description: Path algebra (Mid M2). No I/O; OS separators.
+ `a`
+ `b`
**> host_path_join a=`a` b=`b`**
*> host_path_join a=`a` b=`b`*
## split
+ `path`
**> host_path_split path=`path`**
*> host_path_split path=`path`*
## file_name
+ `path`
**> host_path_file_name path=`path`**
*> host_path_file_name path=`path`*
## parent
+ `path`
**> host_path_parent path=`path`**
*> host_path_parent path=`path`*
## extension
+ `path`
**> host_path_extension path=`path`**
*> host_path_extension path=`path`*
## normalize
+ `path`
**> host_path_normalize path=`path`**
*> host_path_normalize path=`path`*
## is_absolute
+ `path`
**> host_path_is_absolute path=`path`**
*> host_path_is_absolute path=`path`*
+4 -4
View File
@@ -6,19 +6,19 @@ description: Load optional native ABI plugins (.dll / .so / .dylib)
## load
+ `path`
**> host_plugin_load path=`path`**
*> host_plugin_load path=`path`*
## unload
**> host_plugin_unload**
*> host_plugin_unload*
## list
**> host_plugin_list**
*> host_plugin_list*
## native_path
+ `name`
Resolve installed / local native plugin path (e.g. `agent`).
**> host_ext_native_path name=`name`**
*> host_ext_native_path name=`name`*
+5 -5
View File
@@ -7,19 +7,19 @@ description: Regular expressions (Mid M1). Unicode; no backreferences.
+ `text`
+ `pattern`
**> host_re_is_match text=`text` pattern=`pattern`**
*> host_re_is_match text=`text` pattern=`pattern`*
## find
+ `text`
+ `pattern`
**> host_re_find text=`text` pattern=`pattern`**
*> host_re_find text=`text` pattern=`pattern`*
## find_all
+ `text`
+ `pattern`
**> host_re_find_all text=`text` pattern=`pattern`**
*> host_re_find_all text=`text` pattern=`pattern`*
## replace
+ `text`
@@ -29,10 +29,10 @@ description: Regular expressions (Mid M1). Unicode; no backreferences.
Optional `count=` limits replacements (`None` = all).
**> host_re_replace text=`text` pattern=`pattern` with=`with` count=`count`**
*> host_re_replace text=`text` pattern=`pattern` with=`with` count=`count`*
## split
+ `text`
+ `pattern`
**> host_re_split text=`text` pattern=`pattern`**
*> host_re_split text=`text` pattern=`pattern`*
+2 -2
View File
@@ -8,11 +8,11 @@ description: Cryptographic tokens (Mid M3). Do not use math.random for secrets.
Byte length `n` (default 16). Returns lowercase hex of length `2*n`.
**> host_secrets_token_hex n=`n`**
*> host_secrets_token_hex n=`n`*
## token_urlsafe
+ `n`=None
Byte length `n` (default 16). URL-safe Base64 without padding.
**> host_secrets_token_urlsafe n=`n`**
*> host_secrets_token_urlsafe n=`n`*
+3 -3
View File
@@ -6,16 +6,16 @@ description: Thin mean / median / sample stdev (Mid2 M10). Not a dataframe libra
## mean
+ `list`
**> host_stats_mean list=`list`**
*> host_stats_mean list=`list`*
## median
+ `list`
**> host_stats_median list=`list`**
*> host_stats_median list=`list`*
## stdev
+ `list`
Sample standard deviation; needs at least two values.
**> host_stats_stdev list=`list`**
*> host_stats_stdev list=`list`*
+5 -5
View File
@@ -18,23 +18,23 @@ Set `quiet=False` to inherit parent stdout/stderr.
File `wait` returns `{code, value}` plus optional `stdout`/`stderr` tails when quiet-captured.
`value` is the child's `# main` return (not stdout).
**> host_subtask_spawn path=`path` fn=`fn` args=`args` code=`code` lang=`lang` source=`source` stdin=`stdin` quiet=`quiet`**
*> host_subtask_spawn path=`path` fn=`fn` args=`args` code=`code` lang=`lang` source=`source` stdin=`stdin` quiet=`quiet`*
## poll
+ `id`
**> host_subtask_poll id=`id`**
*> host_subtask_poll id=`id`*
## wait
+ `id`
**> host_subtask_join id=`id`**
*> host_subtask_join id=`id`*
## kill
+ `id`
**> host_subtask_kill id=`id`**
*> host_subtask_kill id=`id`*
## wait_all
**> host_subtask_wait_all**
*> host_subtask_wait_all*
+9 -9
View File
@@ -6,33 +6,33 @@ description: English system wrappers (load_dotenv accepts optional path via host
## env_get
+ `name`
**> host_env_get name=`name`**
*> host_env_get name=`name`*
## env_set
+ `name`
+ `value`
**> host_env_set name=`name` value=`value`**
*> host_env_set name=`name` value=`value`*
## load_dotenv
+ `path`=None
Load `.env` (optional named arg `path=`). Existing process env is not overridden.
**> host_dotenv_load path=`path`**
*> host_dotenv_load path=`path`*
## args
**> host_args**
*> host_args*
## cwd
**> host_cwd**
*> host_cwd*
## exit
+ `code`
**> host_exit code=`code`**
*> host_exit code=`code`*
## exec
+ `cmd`
@@ -43,13 +43,13 @@ Run a process. Default return is the exit code (int).
With `capture=True`, return a map `{code, stdout, stderr}` (stdout/stderr may be truncated for huge output).
Inside `*…*` prefer bare `args=args` (variable); `` args=`args` `` is also accepted.
Inside `**…**` prefer bare `args=args` (variable); `` args=`args` `` is also accepted.
**> host_exec cmd=`cmd` args=`args` capture=`capture`**
*> host_exec cmd=`cmd` args=`args` capture=`capture`*
## stream_publish
+ `event`
Publish a stream event map onto the process EventBus (`marqdo view` SSE). No-op when nothing is subscribed.
**> host_stream_publish event=`event`**
*> host_stream_publish event=`event`*
+39 -39
View File
@@ -10,19 +10,19 @@ description: >-
+ `at`
+ `value`
Directly update one element. `at=` is a text key, a **1-based** list index, or a list path of keys/indices (same nesting as footnotes).
Directly update one element. `at=` is a text key, a *1-based* list index, or a list path of keys/indices (same nesting as footnotes).
**> host_collection_put in=`in` at=`at` value=`value`**
*> host_collection_put in=`in` at=`at` value=`value`*
## len
+ `xs`
**> len `xs`**
*> len `xs`*
## rows
+ `xs`
**> len `xs`**
*> len `xs`*
## at
+ `xs`
@@ -30,31 +30,31 @@ Directly update one element. `at=` is a text key, a **1-based** list index, or a
Index is zero-based (same as builtin `at`). Out of range → `None`.
**> at value=`xs` index=`i`**
*> at value=`xs` index=`i`*
## row_at
+ `xs`
+ `i`
**> at value=`xs` index=`i`**
*> at value=`xs` index=`i`*
## append
+ `list`
+ `item`
**> host_list_append list=`list` item=`item`**
*> host_list_append list=`list` item=`item`*
## prepend
+ `list`
+ `item`
**> host_list_prepend list=`list` item=`item`**
*> host_list_prepend list=`list` item=`item`*
## concat
+ `a`
+ `b`
**> host_list_concat a=`a` b=`b`**
*> host_list_concat a=`a` b=`b`*
## insert
+ `list`
@@ -63,7 +63,7 @@ Index is zero-based (same as builtin `at`). Out of range → `None`.
Index is zero-based (may insert at `len` to append).
**> host_list_insert list=`list` index=`index` item=`item`**
*> host_list_insert list=`list` index=`index` item=`item`*
## set_at
+ `list`
@@ -72,34 +72,34 @@ Index is zero-based (may insert at `len` to append).
Zero-based replace. Prefer `put` with 1-based index for author-facing edits.
**> host_list_set_at list=`list` index=`index` item=`item`**
*> host_list_set_at list=`list` index=`index` item=`item`*
## remove_at
+ `list`
+ `index`
**> host_list_remove_at list=`list` index=`index`**
*> host_list_remove_at list=`list` index=`index`*
## pop
+ `list`
Drop the last item (errors if empty). Use `last` first when you need the removed value.
*`n` = > len `list`*
**`n` = > len `list`**
1. `n` > 0
**> host_list_remove_at list=`list` index=`n` - 1**
*> host_list_remove_at list=`list` index=`n` - 1*
2. *
**> host_list_remove_at list=`list` index=0**
*> host_list_remove_at list=`list` index=0*
## first
+ `list`
**> host_list_first list=`list`**
*> host_list_first list=`list`*
## last
+ `list`
**> host_list_last list=`list`**
*> host_list_last list=`list`*
## slice
+ `list`
@@ -108,13 +108,13 @@ Drop the last item (errors if empty). Use `last` first when you need the removed
Zero-based half-open range from `start` to `end`.
**> host_list_slice list=`list` start=`start` end=`end`**
*> host_list_slice list=`list` start=`start` end=`end`*
## contains
+ `list`
+ `item`
**> host_list_contains list=`list` item=`item`**
*> host_list_contains list=`list` item=`item`*
## index_of
+ `list`
@@ -122,19 +122,19 @@ Zero-based half-open range from `start` to `end`.
Zero-based index or `None`.
**> host_list_index_of list=`list` item=`item`**
*> host_list_index_of list=`list` item=`item`*
## reverse
+ `list`
**> host_list_reverse list=`list`**
*> host_list_reverse list=`list`*
## sort
+ `list`
Ascending sort (int/num/text preferred).
**> host_list_sort list=`list`**
*> host_list_sort list=`list`*
## sort_by
+ `list`
@@ -142,20 +142,20 @@ Ascending sort (int/num/text preferred).
Sort a list of maps by `key`.
**> host_list_sort_by list=`list` key=`key`**
*> host_list_sort_by list=`list` key=`key`*
## unique
+ `list`
Stable unique (first wins).
**> host_list_unique list=`list`**
*> host_list_unique list=`list`*
## chunk
+ `list`
+ `size`
**> host_list_chunk list=`list` size=`size`**
*> host_list_chunk list=`list` size=`size`*
## zip
+ `a`
@@ -163,21 +163,21 @@ Stable unique (first wins).
Pairs until the shorter list ends.
**> host_list_zip a=`a` b=`b`**
*> host_list_zip a=`a` b=`b`*
## flatten
+ `list`
One-level flatten.
**> host_list_flatten list=`list`**
*> host_list_flatten list=`list`*
## clear
+ `value`
Empty list or empty map (by type).
**> host_collection_clear value=`value`**
*> host_collection_clear value=`value`*
## get
+ `map`
@@ -185,7 +185,7 @@ Empty list or empty map (by type).
Missing key → `None`.
**> host_map_get map=`map` key=`key`**
*> host_map_get map=`map` key=`key`*
## set
+ `map`
@@ -194,36 +194,36 @@ Missing key → `None`.
Shallow map update. Prefer `put` for nested paths.
**> host_map_set map=`map` key=`key` value=`value`**
*> host_map_set map=`map` key=`key` value=`value`*
## delete
+ `map`
+ `key`
**> host_map_delete map=`map` key=`key`**
*> host_map_delete map=`map` key=`key`*
## has
+ `map`
+ `key`
**> host_map_has map=`map` key=`key`**
*> host_map_has map=`map` key=`key`*
## keys
+ `map`
**> host_map_keys map=`map`**
*> host_map_keys map=`map`*
## values
+ `map`
**> host_map_values map=`map`**
*> host_map_values map=`map`*
## items
+ `map`
Rows shaped as key/value maps.
**> host_map_items map=`map`**
*> host_map_items map=`map`*
## merge
+ `a`
@@ -231,17 +231,17 @@ Rows shaped as key/value maps.
Right-hand keys win.
**> host_map_merge a=`a` b=`b`**
*> host_map_merge a=`a` b=`b`*
## size
+ `map`
**> host_map_size map=`map`**
*> host_map_size map=`map`*
## empty_list
**> host_list_concat a=None b=None**
*> host_list_concat a=None b=None*
## empty_map
**> host_map_merge a=None b=None**
*> host_map_merge a=None b=None*
+11 -11
View File
@@ -6,37 +6,37 @@ description: Text helpers (Mid M4 thicken). Literal replace — use lib/re for r
## str_trim
+ `s`
**> trim `s`**
*> trim `s`*
## str_split
+ `s`
+ `sep`
**> split value=`s` sep=`sep`**
*> split value=`s` sep=`sep`*
## str_join
+ `xs`
+ `sep`
**> join value=`xs` sep=`sep`**
*> join value=`xs` sep=`sep`*
## contains
+ `text`
+ `sub`
**> host_text_contains text=`text` sub=`sub`**
*> host_text_contains text=`text` sub=`sub`*
## starts_with
+ `text`
+ `prefix`
**> host_text_starts_with text=`text` prefix=`prefix`**
*> host_text_starts_with text=`text` prefix=`prefix`*
## ends_with
+ `text`
+ `suffix`
**> host_text_ends_with text=`text` suffix=`suffix`**
*> host_text_ends_with text=`text` suffix=`suffix`*
## replace
+ `text`
@@ -46,23 +46,23 @@ description: Text helpers (Mid M4 thicken). Literal replace — use lib/re for r
Literal substring replace (`count` optional).
**> host_text_replace text=`text` old=`old` new=`new` count=`count`**
*> host_text_replace text=`text` old=`old` new=`new` count=`count`*
## to_upper
+ `text`
**> host_text_to_upper text=`text`**
*> host_text_to_upper text=`text`*
## to_lower
+ `text`
**> host_text_to_lower text=`text`**
*> host_text_to_lower text=`text`*
## repeat
+ `text`
+ `n`
**> host_text_repeat text=`text` n=`n`**
*> host_text_repeat text=`text` n=`n`*
## pad
+ `text`
@@ -72,4 +72,4 @@ Literal substring replace (`count` optional).
align: left (default), right, or center.
**> host_text_pad text=`text` width=`width` fill=`fill` align=`align`**
*> host_text_pad text=`text` width=`width` fill=`fill` align=`align`*
+5 -5
View File
@@ -5,25 +5,25 @@ description: English time wrappers
## now_unix
**> host_now_unix**
*> host_now_unix*
## now_ms
**> host_now_ms**
*> host_now_ms*
## format
+ `unix`
+ `pattern`
**> host_format_time unix=`unix` pattern=`pattern`**
*> host_format_time unix=`unix` pattern=`pattern`*
## sleep_ms
+ `ms`
**> host_sleep_ms ms=`ms`**
*> host_sleep_ms ms=`ms`*
## parse
+ `text`
+ `pattern`
**> host_parse_time text=`text` pattern=`pattern`**
*> host_parse_time text=`text` pattern=`pattern`*
+1 -1
View File
@@ -6,4 +6,4 @@ description: Read-only TOML subset parse (Mid2 M8). Tables, scalars, arrays; no
## parse
+ `text`
**> host_toml_parse text=`text`**
*> host_toml_parse text=`text`*
+3 -3
View File
@@ -8,16 +8,16 @@ description: Parse URLs and query strings (Mid2 M7). Segment encoding stays in n
Returns `{scheme, userinfo, host, port, path, query, fragment}`.
**> host_url_parse text=`text`**
*> host_url_parse text=`text`*
## query_parse
+ `text`
Parse `a=1&b=2` into a map; repeated keys become a list.
**> host_url_query_parse text=`text`**
*> host_url_query_parse text=`text`*
## query_stringify
+ `map`
**> host_url_query_stringify map=`map`**
*> host_url_query_stringify map=`map`*
+1 -1
View File
@@ -5,4 +5,4 @@ description: UUID v4 (Mid M6). Cryptographic random via getrandom.
## v4
**> host_uuid_v4**
*> host_uuid_v4*
+7 -7
View File
@@ -9,9 +9,9 @@ description: Persist run output in .mq.md (Jupyter-style writeback)
+ `key`=None
+ `line`=None
Write `value` to `<!-- marqdo-out … -->` in the entry file. Default: insert or replace the block immediately below the call; `at_end=true` replaces the unkeyed EOF block. With `key=` (e.g. `ok` / `error`), replace or create that **named** slot only — slots do not overwrite each other. Optional `line=` anchors the block under that source line (needed when writing from a subtask).
Write `value` to `<!-- marqdo-out … -->` in the entry file. Default: insert or replace the block immediately below the call; `at_end=true` replaces the unkeyed EOF block. With `key=` (e.g. `ok` / `error`), replace or create that *named* slot only — slots do not overwrite each other. Optional `line=` anchors the block under that source line (needed when writing from a subtask).
**> host_writeback_record value=`value` at_end=`at_end` key=`key` line=`line`**
*> host_writeback_record value=`value` at_end=`at_end` key=`key` line=`line`*
## get
+ `at_end`=False
@@ -20,7 +20,7 @@ Write `value` to `<!-- marqdo-out … -->` in the entry file. Default: insert or
Read persisted output for the current call site (adjacent unkeyed block), the unkeyed EOF block when `at_end=true`, or a named slot when `key=` is set.
**> host_writeback_get at_end=`at_end` key=`key` line=`line`**
*> host_writeback_get at_end=`at_end` key=`key` line=`line`*
## clear
+ `at_end`=False
@@ -29,7 +29,7 @@ Read persisted output for the current call site (adjacent unkeyed block), the un
Remove the adjacent, EOF, or named output block.
**> host_writeback_clear at_end=`at_end` key=`key` line=`line`**
*> host_writeback_clear at_end=`at_end` key=`key` line=`line`*
## ensure
+ `key`
@@ -38,17 +38,17 @@ Remove the adjacent, EOF, or named output block.
Create a named slot with `placeholder` if missing. Never overwrites an existing slot body.
**> host_writeback_ensure key=`key` placeholder=`placeholder` line=`line`**
*> host_writeback_ensure key=`key` placeholder=`placeholder` line=`line`*
## list
List all output blocks in the entry file (includes `key` when named).
**> host_writeback_list**
*> host_writeback_list*
## scan_path
+ `path`
List `<!-- marqdo-out … -->` slots in any file (workbook inspection).
**> host_writeback_scan_path path=`path`**
*> host_writeback_scan_path path=`path`*
+1 -1
View File
@@ -8,4 +8,4 @@ description: 解析命令行参数(中层 M5)。--键 值 / --键=值 / --
省略 `参数` 时用进程 argv(系统.参数表)。
**> host_cli_parse args=`参数`**
*> host_cli_parse args=`参数`*
+4 -4
View File
@@ -6,20 +6,20 @@ description: 摘要与 HMAC(中层 M3)。完整性 / 缓存键 — 非密码
## 哈希256
+ `内容`
**> host_hash_sha256 text=`内容`**
*> host_hash_sha256 text=`内容`*
## 哈希1
+ `内容`
**> host_hash_sha1 text=`内容`**
*> host_hash_sha1 text=`内容`*
## md5
+ `内容`
**> host_hash_md5 text=`内容`**
*> host_hash_md5 text=`内容`*
## 密钥哈希256
+ `密钥`
+ `内容`
**> host_hash_hmac_sha256 key=`密钥` text=`内容`**
*> host_hash_hmac_sha256 key=`密钥` text=`内容`*
+3 -3
View File
@@ -6,14 +6,14 @@ description: 解析 URL 与查询串(中层 Mid2 M7)。单段编码仍用 `
## 解析
+ `内容`
**> host_url_parse text=`内容`**
*> host_url_parse text=`内容`*
## 查询解析
+ `内容`
**> host_url_query_parse text=`内容`**
*> host_url_query_parse text=`内容`*
## 查询串化
+ `表`
**> host_url_query_stringify map=`表`**
*> host_url_query_stringify map=`表`*
+4 -4
View File
@@ -7,21 +7,21 @@ description: 通过本机解释器运行绑定的代码围栏与内联源码
+ `语言`
+ `命令`
**> host_foreign_set_cmd lang=`语言` cmd=`命令`**
*> host_foreign_set_cmd lang=`语言` cmd=`命令`*
## 运行
+ `代码`
+ `标准输入`=None
**> host_foreign_run code=`代码` stdin=`标准输入`**
*> host_foreign_run code=`代码` stdin=`标准输入`*
## 按语言运行
+ `语言`
+ `源码`
+ `标准输入`=None
**> host_foreign_run_lang lang=`语言` source=`源码` stdin=`标准输入`**
*> host_foreign_run_lang lang=`语言` source=`源码` stdin=`标准输入`*
## 语言表
**> host_foreign_langs**
*> host_foreign_langs*
+5 -5
View File
@@ -17,23 +17,23 @@ description: 并发子任务 — 文件、函数或外联代码
`静默=假` 时继承父进程终端输出。
文件 `等待` 返回 `{code, value}`,静默捕获时另含截断的 `stdout`/`stderr`;`value` 为子 `# main` 返回值。
**> host_subtask_spawn path=`路径` fn=`函数` args=`参数` code=`代码` lang=`语言` source=`源码` stdin=`输入` quiet=`静默`**
*> host_subtask_spawn path=`路径` fn=`函数` args=`参数` code=`代码` lang=`语言` source=`源码` stdin=`输入` quiet=`静默`*
## 探测
+ `id`
**> host_subtask_poll id=`id`**
*> host_subtask_poll id=`id`*
## 等待
+ `id`
**> host_subtask_join id=`id`**
*> host_subtask_join id=`id`*
## 终止
+ `id`
**> host_subtask_kill id=`id`**
*> host_subtask_kill id=`id`*
## 等待全部
**> host_subtask_wait_all**
*> host_subtask_wait_all*
+4 -4
View File
@@ -6,19 +6,19 @@ description: 加载可选原生 ABI 插件(.dll / .so / .dylib)
## 加载
+ `路径`
**> host_plugin_load path=`路径`**
*> host_plugin_load path=`路径`*
## 卸载
**> host_plugin_unload**
*> host_plugin_unload*
## 列出
**> host_plugin_list**
*> host_plugin_list*
## 原生路径
+ `名`
解析已安装或本地原生插件路径(如 `agent`)。
**> host_ext_native_path name=`名`**
*> host_ext_native_path name=`名`*
+36 -36
View File
@@ -5,173 +5,173 @@ description: 高中数学 — 数值、随机、公式、作图
## 圆周率
**> host_pi**
*> host_pi*
## 自然底数
**> host_e**
*> host_e*
## 数
+ `value`
**> host_num value=`value`**
*> host_num value=`value`*
## 加
+ `a`
+ `b`
**> host_math_add a=`a` b=`b`**
*> host_math_add a=`a` b=`b`*
## 减
+ `a`
+ `b`
**> host_math_sub a=`a` b=`b`**
*> host_math_sub a=`a` b=`b`*
## 乘
+ `a`
+ `b`
**> host_math_mul a=`a` b=`b`**
*> host_math_mul a=`a` b=`b`*
## 除
+ `a`
+ `b`
**> host_math_div a=`a` b=`b`**
*> host_math_div a=`a` b=`b`*
## 幂
+ `a`
+ `b`
**> host_math_pow a=`a` b=`b`**
*> host_math_pow a=`a` b=`b`*
## 负
+ `value`
**> host_math_neg value=`value`**
*> host_math_neg value=`value`*
## 正弦
+ `value`
**> host_math_sin value=`value`**
*> host_math_sin value=`value`*
## 余弦
+ `value`
**> host_math_cos value=`value`**
*> host_math_cos value=`value`*
## 正切
+ `value`
**> host_math_tan value=`value`**
*> host_math_tan value=`value`*
## 反正弦
+ `value`
**> host_math_asin value=`value`**
*> host_math_asin value=`value`*
## 反余弦
+ `value`
**> host_math_acos value=`value`**
*> host_math_acos value=`value`*
## 反正切
+ `value`
**> host_math_atan value=`value`**
*> host_math_atan value=`value`*
## 平方根
+ `value`
**> host_math_sqrt value=`value`**
*> host_math_sqrt value=`value`*
## 绝对值
+ `value`
**> host_math_abs value=`value`**
*> host_math_abs value=`value`*
## 对数
+ `value`
**> host_math_ln value=`value`**
*> host_math_ln value=`value`*
## 指数
+ `value`
**> host_math_exp value=`value`**
*> host_math_exp value=`value`*
## 向下取整
+ `value`
**> host_math_floor value=`value`**
*> host_math_floor value=`value`*
## 向上取整
+ `value`
**> host_math_ceil value=`value`**
*> host_math_ceil value=`value`*
## 最小
+ `a`
+ `b`
**> host_math_min a=`a` b=`b`**
*> host_math_min a=`a` b=`b`*
## 最大
+ `a`
+ `b`
**> host_math_max a=`a` b=`b`**
*> host_math_max a=`a` b=`b`*
## 随机
**> host_random**
*> host_random*
## 随机整数
+ `min`
+ `max`
**> host_random_int min=`min` max=`max`**
*> host_random_int min=`min` max=`max`*
## 设种子
+ `value`
**> host_seed value=`value`**
*> host_seed value=`value`*
## 公式
+ `text`
**> host_formula value=`text`**
*> host_formula value=`text`*
## 化简
+ `formula`
**> host_simplify value=`formula`**
*> host_simplify value=`formula`*
## 展开
+ `formula`
**> host_expand value=`formula`**
*> host_expand value=`formula`*
## 求导
+ `formula`
+ `var`
**> host_diff formula=`formula` var=`var`**
*> host_diff formula=`formula` var=`var`*
## 代入
+ `formula`
+ `var`
+ `value`
**> host_subs formula=`formula` var=`var` value=`value`**
*> host_subs formula=`formula` var=`var` value=`value`*
## 求值
+ `formula`
+ `var`
+ `value`
**> host_eval formula=`formula` var=`var` value=`value`**
*> host_eval formula=`formula` var=`var` value=`value`*
## 求解
+ `formula`
@@ -179,7 +179,7 @@ description: 高中数学 — 数值、随机、公式、作图
+ `min`=None
+ `max`=None
**> host_solve formula=`formula` var=`var` min=`min` max=`max`**
*> host_solve formula=`formula` var=`var` min=`min` max=`max`*
## 绘图
+ `formula`
@@ -191,7 +191,7 @@ description: 高中数学 — 数值、随机、公式、作图
+ `derivative`=None
+ `grid`=None
**> host_plot formula=`formula` var=`var` min=`min` max=`max` steps=`steps` path=`path` derivative=`derivative` grid=`grid`**
*> host_plot formula=`formula` var=`var` min=`min` max=`max` steps=`steps` path=`path` derivative=`derivative` grid=`grid`*
## 绘点列
+ `xs`
@@ -199,7 +199,7 @@ description: 高中数学 — 数值、随机、公式、作图
+ `path`=None
+ `grid`=None
**> host_plot_points xs=`xs` ys=`ys` path=`path` grid=`grid`**
*> host_plot_points xs=`xs` ys=`ys` path=`path` grid=`grid`*
## 绘圆锥
+ `kind`
@@ -210,4 +210,4 @@ description: 高中数学 — 数值、随机、公式、作图
+ `path`=None
+ `grid`=None
**> host_plot_conic kind=`kind` a=`a` b=`b` h=`h` k=`k` path=`path` grid=`grid`**
*> host_plot_conic kind=`kind` a=`a` b=`b` h=`h` k=`k` path=`path` grid=`grid`*
+16 -16
View File
@@ -6,67 +6,67 @@ description: 中文文件系统包装
## 读文本
+ `路径`
**> host_read_text path=`路径`**
*> host_read_text path=`路径`*
## 写文本
+ `路径`
+ `内容`
**> host_write_text path=`路径` text=`内容`**
*> host_write_text path=`路径` text=`内容`*
## 追加文本
+ `路径`
+ `内容`
**> host_append_text path=`路径` text=`内容`**
*> host_append_text path=`路径` text=`内容`*
## 存在
+ `路径`
**> host_exists path=`路径`**
*> host_exists path=`路径`*
## 列目录
+ `路径`
**> host_list_dir path=`路径`**
*> host_list_dir path=`路径`*
## 建目录
+ `路径`
**> host_make_dir path=`路径`**
*> host_make_dir path=`路径`*
## 建目录树
+ `路径`
递归创建目录(等同 `mkdir -p`)。
**> host_make_dirs path=`路径`**
*> host_make_dirs path=`路径`*
## 删除
+ `路径`
**> host_remove path=`路径`**
*> host_remove path=`路径`*
## 删目录树
+ `路径`
递归删除目录;若路径是文件则报错。
**> host_remove_tree path=`路径`**
*> host_remove_tree path=`路径`*
## 状态
+ `路径`
返回 `{size, mtime_unix, is_file, is_dir}`。
**> host_stat path=`路径`**
*> host_stat path=`路径`*
## 遍历
+ `路径`
深度优先列出相对路径(正斜杠)。
**> host_walk path=`路径`**
*> host_walk path=`路径`*
## 复制文件
+ `源`
@@ -74,7 +74,7 @@ description: 中文文件系统包装
复制文件(目标已存在则覆盖)。路径沙箱同其他文件操作。
**> host_copy_file src=`源` dest=`目标`**
*> host_copy_file src=`源` dest=`目标`*
## 移动
+ `源`
@@ -82,14 +82,14 @@ description: 中文文件系统包装
在沙箱内重命名 / 移动。
**> host_move src=`源` dest=`目标`**
*> host_move src=`源` dest=`目标`*
## 建临时
+ `前缀`=None
在程序目录下创建空临时文件,返回相对路径。
**> host_make_temp prefix=`前缀`**
*> host_make_temp prefix=`前缀`*
## 文本补丁
+ `路径`
@@ -98,7 +98,7 @@ description: 中文文件系统包装
对 UTF-8 文本文件做精确 FIND→REPLACE(`查找` 必须唯一匹配一次)。
**> host_text_patch path=`路径` find=`查找` replace=`替换`**
*> host_text_patch path=`路径` find=`查找` replace=`替换`*
## 应用补丁块
+ `路径`
@@ -107,4 +107,4 @@ description: 中文文件系统包装
解析规划回复中的 FIND/REPLACE 块并应用到 `路径`。`软失败=真` 时仅「找不到 FIND」返回 0;空 FIND、多匹配、整文件重写仍报错。
**> host_apply_patch_blocks path=`路径` text=`文本` soft=`软失败`**
*> host_apply_patch_blocks path=`路径` text=`文本` soft=`软失败`*
+11 -11
View File
@@ -6,37 +6,37 @@ description: 文本库加厚(中层 M4)。字面替换 — 正则请用 lib/
## 去空白
+ `s`
**> trim `s`**
*> trim `s`*
## 拆分
+ `s`
+ `sep`
**> split value=`s` sep=`sep`**
*> split value=`s` sep=`sep`*
## 拼接
+ `xs`
+ `sep`
**> join value=`xs` sep=`sep`**
*> join value=`xs` sep=`sep`*
## 包含
+ `内容`
+ `子串`
**> host_text_contains text=`内容` sub=`子串`**
*> host_text_contains text=`内容` sub=`子串`*
## 开头是
+ `内容`
+ `前缀`
**> host_text_starts_with text=`内容` prefix=`前缀`**
*> host_text_starts_with text=`内容` prefix=`前缀`*
## 结尾是
+ `内容`
+ `后缀`
**> host_text_ends_with text=`内容` suffix=`后缀`**
*> host_text_ends_with text=`内容` suffix=`后缀`*
## 替换
+ `内容`
@@ -46,23 +46,23 @@ description: 文本库加厚(中层 M4)。字面替换 — 正则请用 lib/
字面子串替换(可选 `次数`)。
**> host_text_replace text=`内容` old=`旧` new=`新` count=`次数`**
*> host_text_replace text=`内容` old=`旧` new=`新` count=`次数`*
## 大写
+ `内容`
**> host_text_to_upper text=`内容`**
*> host_text_to_upper text=`内容`*
## 小写
+ `内容`
**> host_text_to_lower text=`内容`**
*> host_text_to_lower text=`内容`*
## 重复
+ `内容`
+ `次数`
**> host_text_repeat text=`内容` n=`次数`**
*> host_text_repeat text=`内容` n=`次数`*
## 填充
+ `内容`
@@ -72,4 +72,4 @@ description: 文本库加厚(中层 M4)。字面替换 — 正则请用 lib/
对齐:left(默认)/ right / center。
**> host_text_pad text=`内容` width=`宽度` fill=`填充符` align=`对齐`**
*> host_text_pad text=`内容` width=`宽度` fill=`填充符` align=`对齐`*
+9 -9
View File
@@ -8,44 +8,44 @@ description: 按级别过滤的一行日志(中层 M6 + Mid2 M10 字段)。
级别:debug / info / warn / error(或 调试/信息/警告/错误)。
**> host_log_set_level level=`级别`**
*> host_log_set_level level=`级别`*
## 调试
+ `内容`
+ `字段`=None
*line = > host_log_line level="debug" text=`内容` fields=`字段`*
**line = > host_log_line level="debug" text=`内容` fields=`字段`**
1. `line`
> 打印 内容=`line`
2. *
2. **
****
## 信息
+ `内容`
+ `字段`=None
*line = > host_log_line level="info" text=`内容` fields=`字段`*
**line = > host_log_line level="info" text=`内容` fields=`字段`**
1. `line`
> 打印 内容=`line`
2. *
2. **
****
## 警告
+ `内容`
+ `字段`=None
*line = > host_log_line level="warn" text=`内容` fields=`字段`*
**line = > host_log_line level="warn" text=`内容` fields=`字段`**
1. `line`
> 打印 内容=`line`
2. *
2. **
****
## 错误
+ `内容`
+ `字段`=None
*line = > host_log_line level="error" text=`内容` fields=`字段`*
**line = > host_log_line level="error" text=`内容` fields=`字段`**
1. `line`
> 打印 内容=`line`
2. *
2. **
****
+7 -7
View File
@@ -5,30 +5,30 @@ description: 日历时刻 map `{unix, zone, iso}`(中层 Mid2 M7)。固定
## 现在
**> host_datetime_now**
*> host_datetime_now*
## 自戳
+ `秒`
+ `区`=None
**> host_datetime_from_unix unix=`秒` zone=`区`**
*> host_datetime_from_unix unix=`秒` zone=`区`*
## 成戳
+ `时刻`
**> host_datetime_to_unix dt=`时刻`**
*> host_datetime_to_unix dt=`时刻`*
## 解析
+ `内容`
+ `格式`=None
**> host_datetime_parse text=`内容` pattern=`格式`**
*> host_datetime_parse text=`内容` pattern=`格式`*
## 格式化
+ `时刻`
+ `样式`=None
**> host_datetime_format dt=`时刻` style=`样式`**
*> host_datetime_format dt=`时刻` style=`样式`*
## 加
+ `时刻`
@@ -37,10 +37,10 @@ description: 日历时刻 map `{unix, zone, iso}`(中层 Mid2 M7)。固定
+ `分钟`=None
+ `秒数`=None
**> host_datetime_add dt=`时刻` days=`天` hours=`小时` minutes=`分钟` seconds=`秒数`**
*> host_datetime_add dt=`时刻` days=`天` hours=`小时` minutes=`分钟` seconds=`秒数`*
## 时区
+ `时刻`
+ `区`
**> host_datetime_in_zone dt=`时刻` zone=`区`**
*> host_datetime_in_zone dt=`时刻` zone=`区`*
+5 -5
View File
@@ -5,25 +5,25 @@ description: 中文时间包装
## 此刻秒
**> host_now_unix**
*> host_now_unix*
## 此刻毫秒
**> host_now_ms**
*> host_now_ms*
## 格式化
+ `秒`
+ `格式`
**> host_format_time unix=`秒` pattern=`格式`**
*> host_format_time unix=`秒` pattern=`格式`*
## 睡眠毫秒
+ `毫秒`
**> host_sleep_ms ms=`毫秒`**
*> host_sleep_ms ms=`毫秒`*
## 解析时间
+ `内容`
+ `格式`
**> host_parse_time text=`内容` pattern=`格式`**
*> host_parse_time text=`内容` pattern=`格式`*
+2 -2
View File
@@ -8,11 +8,11 @@ description: 安全随机令牌(中层 M3)。勿用 math.random 生成令牌
字节长度(默认 16),返回长度为 `2*字节数` 的小写 hex。
**> host_secrets_token_hex n=`字节数`**
*> host_secrets_token_hex n=`字节数`*
## 网址安全令牌
+ `字节数`=None
字节长度(默认 16),URL-safe Base64(无填充)。
**> host_secrets_token_urlsafe n=`字节数`**
*> host_secrets_token_urlsafe n=`字节数`*
+1 -1
View File
@@ -5,4 +5,4 @@ description: UUID 版本 4(中层 M6)。经 getrandom 安全随机。
## 版本4
**> host_uuid_v4**
*> host_uuid_v4*
+5 -5
View File
@@ -7,19 +7,19 @@ description: 正则表达式(中层 M1)。Unicode;无回溯引用。
+ `内容`
+ `模式`
**> host_re_is_match text=`内容` pattern=`模式`**
*> host_re_is_match text=`内容` pattern=`模式`*
## 查找
+ `内容`
+ `模式`
**> host_re_find text=`内容` pattern=`模式`**
*> host_re_find text=`内容` pattern=`模式`*
## 查找全部
+ `内容`
+ `模式`
**> host_re_find_all text=`内容` pattern=`模式`**
*> host_re_find_all text=`内容` pattern=`模式`*
## 替换
+ `内容`
@@ -29,10 +29,10 @@ description: 正则表达式(中层 M1)。Unicode;无回溯引用。
可选 `次数=` 限制替换次数(缺省 = 全部)。
**> host_re_replace text=`内容` pattern=`模式` with=`为` count=`次数`**
*> host_re_replace text=`内容` pattern=`模式` with=`为` count=`次数`*
## 拆分
+ `内容`
+ `模式`
**> host_re_split text=`内容` pattern=`模式`**
*> host_re_split text=`内容` pattern=`模式`*
+36 -36
View File
@@ -11,8 +11,8 @@ import table:lib/table.mq.md
构造 set_text 效应。
*`m` = > table.put in=None at=选择器 value=文本*
**> table.put in=None at="set_text" value=m**
**`m` = > table.put in=None at=选择器 value=文本**
*> table.put in=None at="set_text" value=m*
## 设HTML
+ `选择器`
@@ -20,8 +20,8 @@ import table:lib/table.mq.md
构造 set_html 效应。
*`m` = > table.put in=None at=选择器 value=html*
**> table.put in=None at="set_html" value=m**
**`m` = > table.put in=None at=选择器 value=html**
*> table.put in=None at="set_html" value=m*
## 设值
+ `选择器`
@@ -29,8 +29,8 @@ import table:lib/table.mq.md
构造 set_value 效应。
*`m` = > table.put in=None at=选择器 value=值*
**> table.put in=None at="set_value" value=m**
**`m` = > table.put in=None at=选择器 value=值**
*> table.put in=None at="set_value" value=m*
## 设类
+ `选择器`
@@ -38,8 +38,8 @@ import table:lib/table.mq.md
构造 set_class 效应。
*`m` = > table.put in=None at=选择器 value=类*
**> table.put in=None at="set_class" value=m**
**`m` = > table.put in=None at=选择器 value=类**
*> table.put in=None at="set_class" value=m*
## 设属性
+ `选择器`
@@ -47,8 +47,8 @@ import table:lib/table.mq.md
构造 set_attr 效应。
*`m` = > table.put in=None at=选择器 value=属性*
**> table.put in=None at="set_attr" value=m**
**`m` = > table.put in=None at=选择器 value=属性**
*> table.put in=None at="set_attr" value=m*
## 包装
+ `键`
@@ -56,7 +56,7 @@ import table:lib/table.mq.md
单键效应包装。
**> table.put in=None at=键 value=值**
*> table.put in=None at=键 value=值*
## 合并
+ `甲`
@@ -64,7 +64,7 @@ import table:lib/table.mq.md
合并两张效应表,右侧优先。
**> table.merge a=`甲` b=`乙`**
*> table.merge a=`甲` b=`乙`*
## 画布
+ `选择器`
@@ -79,7 +79,7 @@ import table:lib/table.mq.md
|-----|-------|----------|
| `选择器` | `清空` | `命令` |
**> table.put in=None at="canvas" value=spec**
*> table.put in=None at="canvas" value=spec*
## 音频
+ `操作`="play"
@@ -91,17 +91,17 @@ import table:lib/table.mq.md
构造 audio 效应。
*`spec` = > table.put in=None at="op" value=操作*
*`spec` = > table.put in=`spec` at="id" value=id*
**`spec` = > table.put in=None at="op" value=操作**
**`spec` = > table.put in=`spec` at="id" value=id**
1. `源` != ""
*`spec` = > table.put in=`spec` at="src" value=源*
**`spec` = > table.put in=`spec` at="src" value=源**
1. `频率` != None
*`spec` = > table.put in=`spec` at="freq" value=频率*
**`spec` = > table.put in=`spec` at="freq" value=频率**
1. `毫秒` != None
*`spec` = > table.put in=`spec` at="ms" value=毫秒*
**`spec` = > table.put in=`spec` at="ms" value=毫秒**
1. `选择器` != ""
*`spec` = > table.put in=`spec` at="sel" value=选择器*
**> table.put in=None at="audio" value=spec**
**`spec` = > table.put in=`spec` at="sel" value=选择器**
*> table.put in=None at="audio" value=spec*
## 读文件
+ `选择器`
@@ -116,26 +116,26 @@ import table:lib/table.mq.md
|-----|----|------|
| `选择器` | `格式` | `然后` |
**> table.put in=None at="read_file" value=spec**
*> table.put in=None at="read_file" value=spec*
## 观察
+ `规格`
构造 observe 效应。
**> table.put in=None at="observe" value=规格**
*> table.put in=None at="observe" value=规格*
## 取消观察
+ `规格`
构造 unobserve 效应。
**> table.put in=None at="unobserve" value=规格**
*> table.put in=None at="unobserve" value=规格*
## 聚焦
+ `选择器`
**> table.put in=None at="focus" value=选择器**
*> table.put in=None at="focus" value=选择器*
## 导航
+ `url`
@@ -147,12 +147,12 @@ import table:lib/table.mq.md
|-----|---------|
| `url` | `替换` |
**> table.put in=None at="navigate" value=spec**
*> table.put in=None at="navigate" value=spec*
## 存储
+ `规格`
**> table.put in=None at="storage" value=规格**
*> table.put in=None at="storage" value=规格*
## 定时
+ `毫秒`
@@ -165,13 +165,13 @@ import table:lib/table.mq.md
|----|------|----|
| `毫秒` | `然后` | `id` |
**> table.put in=None at="interval" value=spec**
*> table.put in=None at="interval" value=spec*
## 清定时
+ `id`="default"
*`spec` = > table.put in=None at="id" value=id*
**> table.put in=None at="clear_interval" value=spec**
**`spec` = > table.put in=None at="id" value=id**
*> table.put in=None at="clear_interval" value=spec*
## 拉取
+ `url`
@@ -184,7 +184,7 @@ import table:lib/table.mq.md
|-----|------|--------|
| `url` | `然后` | `方法` |
**> table.put in=None at="fetch" value=spec**
*> table.put in=None at="fetch" value=spec*
## 拉取全部
+ `请求`
@@ -196,7 +196,7 @@ import table:lib/table.mq.md
|----------|------|
| `请求` | `然后` |
**> table.put in=None at="fetch_all" value=spec**
*> table.put in=None at="fetch_all" value=spec*
## 延后
+ `毫秒`
@@ -208,18 +208,18 @@ import table:lib/table.mq.md
|----|------|
| `毫秒` | `然后` |
**> table.put in=None at="after" value=spec**
*> table.put in=None at="after" value=spec*
## 套接字
+ `规格`
**> table.put in=None at="ws" value=规格**
*> table.put in=None at="ws" value=规格*
## 剪贴板
+ `文本`
*`spec` = > table.put in=None at="text" value=文本*
**> table.put in=None at="clipboard" value=spec**
**`spec` = > table.put in=None at="text" value=文本**
*> table.put in=None at="clipboard" value=spec*
## 下载
+ `正文`
@@ -232,4 +232,4 @@ import table:lib/table.mq.md
|------|----------|------|
| `正文` | `文件名` | `mime` |
**> table.put in=None at="download" value=spec**
*> table.put in=None at="download" value=spec*
+9 -9
View File
@@ -6,33 +6,33 @@ description: 中文系统包装(加载环境 可选 路径=)
## 取环境
+ `名`
**> host_env_get name=`名`**
*> host_env_get name=`名`*
## 设环境
+ `名`
+ `值`
**> host_env_set name=`名` value=`值`**
*> host_env_set name=`名` value=`值`*
## 加载环境
+ `路径`=None
加载 `.env`(可选具名实参 `路径=`)。不覆盖已有进程环境变量。
**> host_dotenv_load path=`路径`**
*> host_dotenv_load path=`路径`*
## 参数表
**> host_args**
*> host_args*
## 工作目录
**> host_cwd**
*> host_cwd*
## 退出
+ `码`
**> host_exit code=`码`**
*> host_exit code=`码`*
## 执行
+ `命令`
@@ -43,13 +43,13 @@ description: 中文系统包装(加载环境 可选 路径=)
`捕获=True` 时返回映射 `{code, stdout, stderr}`(过大输出可能截断)。
在 `*…*` 内优先写裸变量 `参数=参数`;`` 参数=`参数` `` 亦可。
在 `**…**` 内优先写裸变量 `参数=参数`;`` 参数=`参数` `` 亦可。
**> host_exec cmd=`命令` args=`参数` capture=`捕获`**
*> host_exec cmd=`命令` args=`参数` capture=`捕获`*
## 发布流事件
+ `事件`
向进程内 EventBus 发布流事件(供 `marqdo view` SSE)。无订阅者时为空操作。
**> host_stream_publish event=`事件`**
*> host_stream_publish event=`事件`*
+3 -3
View File
@@ -6,16 +6,16 @@ description: 薄均值 / 中位数 / 样本标准差(中层 Mid2 M10)。非
## 均值
+ `列表`
**> host_stats_mean list=`列表`**
*> host_stats_mean list=`列表`*
## 中位数
+ `列表`
**> host_stats_median list=`列表`**
*> host_stats_median list=`列表`*
## 标准差
+ `列表`
样本标准差;至少两个值。
**> host_stats_stdev list=`列表`**
*> host_stats_stdev list=`列表`*
+6 -6
View File
@@ -6,29 +6,29 @@ description: Base64、十六进制与基32编解码(中层 M1 + Mid2 M8)。U
## 基64编码
+ `内容`
**> host_encoding_base64_encode text=`内容`**
*> host_encoding_base64_encode text=`内容`*
## 基64解码
+ `内容`
**> host_encoding_base64_decode text=`内容`**
*> host_encoding_base64_decode text=`内容`*
## 十六进制编码
+ `内容`
**> host_encoding_hex_encode text=`内容`**
*> host_encoding_hex_encode text=`内容`*
## 十六进制解码
+ `内容`
**> host_encoding_hex_decode text=`内容`**
*> host_encoding_hex_decode text=`内容`*
## 基32编码
+ `内容`
**> host_encoding_base32_encode text=`内容`**
*> host_encoding_base32_encode text=`内容`*
## 基32解码
+ `内容`
**> host_encoding_base32_decode text=`内容`**
*> host_encoding_base32_decode text=`内容`*
+9 -9
View File
@@ -9,7 +9,7 @@ description: 中文 HTTP(S) 包装。可选 headers / content_type 经宿主别
支持 HTTPS。可选具名实参 `headers=`(映射)。
**> host_http_get url=`地址` headers=`headers`**
*> host_http_get url=`地址` headers=`headers`*
## 提交
+ `地址`
@@ -19,7 +19,7 @@ description: 中文 HTTP(S) 包装。可选 headers / content_type 经宿主别
默认 Content-Type 为 JSON。可选 `content_type=` / `headers=`。
**> host_http_post url=`地址` body=`内容` content_type=`content_type` headers=`headers`**
*> host_http_post url=`地址` body=`内容` content_type=`content_type` headers=`headers`*
## 提交流式
+ `地址`
@@ -30,7 +30,7 @@ description: 中文 HTTP(S) 包装。可选 headers / content_type 经宿主别
POST 并消费 OpenAI 兼容 SSE。返回 `{status, events}`(`delta` / `done` / `error`)。`打印增量=真` 时边读边打印增量文本。
**> host_http_post_sse url=`地址` body=`内容` content_type=`content_type` headers=`headers` echo=`打印增量`**
*> host_http_post_sse url=`地址` body=`内容` content_type=`content_type` headers=`headers` echo=`打印增量`*
## 解析流式
+ `内容`
@@ -38,7 +38,7 @@ POST 并消费 OpenAI 兼容 SSE。返回 `{status, events}`(`delta` / `done`
离线解析 OpenAI 聊天 SSE 正文为事件列表(不联网)。
**> host_openai_sse_parse text=`内容` echo=`打印增量`**
*> host_openai_sse_parse text=`内容` echo=`打印增量`*
## 请求
+ `方法`
@@ -49,12 +49,12 @@ POST 并消费 OpenAI 兼容 SSE。返回 `{status, events}`(`delta` / `done`
可选 `body=` / `content_type=` / `headers=`。
**> host_http_request method=`方法` url=`地址` body=`body` content_type=`content_type` headers=`headers`**
*> host_http_request method=`方法` url=`地址` body=`body` content_type=`content_type` headers=`headers`*
## 编码地址
+ `内容`
**> host_url_encode text=`内容`**
*> host_url_encode text=`内容`*
## 解析Cookie
+ `内容`
@@ -62,7 +62,7 @@ POST 并消费 OpenAI 兼容 SSE。返回 `{status, events}`(`delta` / `done`
解析 `Cookie` 请求头(默认)或一个/多个 `Set-Cookie` 响应头(`是响应头=真`)为 `{name, value, path, domain, expires, max_age, secure, http_only, same_site}` 列表。
**> host_cookie_parse text=`内容` is_response=`是响应头`**
*> host_cookie_parse text=`内容` is_response=`是响应头`*
## 解析多部分
+ `正文`
@@ -70,11 +70,11 @@ POST 并消费 OpenAI 兼容 SSE。返回 `{status, events}`(`delta` / `done`
解析 `multipart/form-data` 请求体(给定 `boundary`)为 `{name, filename?, content_type?, value}` 部件列表。
**> host_multipart_parse body=`正文` boundary=`边界`**
*> host_multipart_parse body=`正文` boundary=`边界`*
## 解析Markdown
+ `文本`
将 Markdown / GFM 解析为 HTML(纯转换,无网络 I/O)。
**> host_markdown_parse text=`文本`**
*> host_markdown_parse text=`文本`*
+6 -6
View File
@@ -11,7 +11,7 @@ description: 将运行结果写回 .mq.md(Jupyter 式自写回)
在入口文件中写入 `<!-- marqdo-out … -->`。默认在调用行下方插入或替换;`末尾=true` 时替换无键末尾块。带 `键=`(如 `ok` / `error` / `成功` / `失败`)时只更新该命名槽,互不覆盖。可选 `行=` 锚定到指定源码行(子任务写回时需要)。
**> host_writeback_record value=`值` at_end=`末尾` key=`键` line=`行`**
*> host_writeback_record value=`值` at_end=`末尾` key=`键` line=`行`*
## 取
+ `末尾`=False
@@ -20,7 +20,7 @@ description: 将运行结果写回 .mq.md(Jupyter 式自写回)
读取当前调用处紧邻无键块、无键末尾块,或命名槽。
**> host_writeback_get at_end=`末尾` key=`键` line=`行`**
*> host_writeback_get at_end=`末尾` key=`键` line=`行`*
## 清除
+ `末尾`=False
@@ -29,7 +29,7 @@ description: 将运行结果写回 .mq.md(Jupyter 式自写回)
删除紧邻块、末尾块或命名槽。
**> host_writeback_clear at_end=`末尾` key=`键` line=`行`**
*> host_writeback_clear at_end=`末尾` key=`键` line=`行`*
## 确保
+ `键`
@@ -38,15 +38,15 @@ description: 将运行结果写回 .mq.md(Jupyter 式自写回)
若命名槽不存在则创建并写入占位;已存在则不改动。
**> host_writeback_ensure key=`键` placeholder=`占位` line=`行`**
*> host_writeback_ensure key=`键` placeholder=`占位` line=`行`*
## 列出
**> host_writeback_list**
*> host_writeback_list*
## 扫描路径
+ `路径`
扫描任意文件中的 `<!-- marqdo-out … -->` 槽(工作簿观察)。
**> host_writeback_scan_path path=`路径`**
*> host_writeback_scan_path path=`路径`*
+39 -39
View File
@@ -10,19 +10,19 @@ description: >-
+ `于`
+ `值`
直接改某一元。`于=` 为文本键、**1-based** 下标,或键/下标组成的路径列表(与脚注嵌套同构)。
直接改某一元。`于=` 为文本键、*1-based* 下标,或键/下标组成的路径列表(与脚注嵌套同构)。
**> host_collection_put in=`入` at=`于` value=`值`**
*> host_collection_put in=`入` at=`于` value=`值`*
## 长度
+ `xs`
**> len `xs`**
*> len `xs`*
## 行数
+ `xs`
**> len `xs`**
*> len `xs`*
## 取
+ `xs`
@@ -30,31 +30,31 @@ description: >-
下标从零起(与内置 `at` 相同)。越界 → `None`。
**> at value=`xs` index=`i`**
*> at value=`xs` index=`i`*
## 取行
+ `xs`
+ `i`
**> at value=`xs` index=`i`**
*> at value=`xs` index=`i`*
## 追加
+ `list`
+ `item`
**> host_list_append list=`list` item=`item`**
*> host_list_append list=`list` item=`item`*
## 前插
+ `list`
+ `item`
**> host_list_prepend list=`list` item=`item`**
*> host_list_prepend list=`list` item=`item`*
## 拼接
+ `a`
+ `b`
**> host_list_concat a=`a` b=`b`**
*> host_list_concat a=`a` b=`b`*
## 插入
+ `list`
@@ -63,7 +63,7 @@ description: >-
下标从零起。
**> host_list_insert list=`list` index=`index` item=`item`**
*> host_list_insert list=`list` index=`index` item=`item`*
## 改位
+ `list`
@@ -72,34 +72,34 @@ description: >-
从零起替换;日常嵌套改写请用「改」。
**> host_list_set_at list=`list` index=`index` item=`item`**
*> host_list_set_at list=`list` index=`index` item=`item`*
## 删位
+ `list`
+ `index`
**> host_list_remove_at list=`list` index=`index`**
*> host_list_remove_at list=`list` index=`index`*
## 弹出
+ `list`
去掉末项(空表报错)。需要末值时先「末」。
*`n` = > len `list`*
**`n` = > len `list`**
1. `n` > 0
**> host_list_remove_at list=`list` index=`n` - 1**
*> host_list_remove_at list=`list` index=`n` - 1*
2. *
**> host_list_remove_at list=`list` index=0**
*> host_list_remove_at list=`list` index=0*
## 首
+ `list`
**> host_list_first list=`list`**
*> host_list_first list=`list`*
## 末
+ `list`
**> host_list_last list=`list`**
*> host_list_last list=`list`*
## 切片
+ `list`
@@ -108,13 +108,13 @@ description: >-
从零起的半开区间,从 `start` 到 `end`。
**> host_list_slice list=`list` start=`start` end=`end`**
*> host_list_slice list=`list` start=`start` end=`end`*
## 含有
+ `list`
+ `item`
**> host_list_contains list=`list` item=`item`**
*> host_list_contains list=`list` item=`item`*
## 下标
+ `list`
@@ -122,19 +122,19 @@ description: >-
从零起的下标;没有 → `None`。
**> host_list_index_of list=`list` item=`item`**
*> host_list_index_of list=`list` item=`item`*
## 反转
+ `list`
**> host_list_reverse list=`list`**
*> host_list_reverse list=`list`*
## 排序
+ `list`
升序(优先 int/num/text)。
**> host_list_sort list=`list`**
*> host_list_sort list=`list`*
## 按键排序
+ `list`
@@ -142,20 +142,20 @@ description: >-
对 map 列表按键排序。
**> host_list_sort_by list=`list` key=`key`**
*> host_list_sort_by list=`list` key=`key`*
## 去重
+ `list`
保序去重(保留首次)。
**> host_list_unique list=`list`**
*> host_list_unique list=`list`*
## 分块
+ `list`
+ `size`
**> host_list_chunk list=`list` size=`size`**
*> host_list_chunk list=`list` size=`size`*
## 拉链
+ `a`
@@ -163,19 +163,19 @@ description: >-
取较短长度配对。
**> host_list_zip a=`a` b=`b`**
*> host_list_zip a=`a` b=`b`*
## 展平
+ `list`
一层展平。
**> host_list_flatten list=`list`**
*> host_list_flatten list=`list`*
## 清空
+ `value`
**> host_collection_clear value=`value`**
*> host_collection_clear value=`value`*
## 取键
+ `map`
@@ -183,7 +183,7 @@ description: >-
缺键 → `None`。
**> host_map_get map=`map` key=`key`**
*> host_map_get map=`map` key=`key`*
## 设
+ `map`
@@ -192,36 +192,36 @@ description: >-
浅层设键;嵌套请用「改」。
**> host_map_set map=`map` key=`key` value=`value`**
*> host_map_set map=`map` key=`key` value=`value`*
## 删键
+ `map`
+ `key`
**> host_map_delete map=`map` key=`key`**
*> host_map_delete map=`map` key=`key`*
## 有键
+ `map`
+ `key`
**> host_map_has map=`map` key=`key`**
*> host_map_has map=`map` key=`key`*
## 键表
+ `map`
**> host_map_keys map=`map`**
*> host_map_keys map=`map`*
## 值表
+ `map`
**> host_map_values map=`map`**
*> host_map_values map=`map`*
## 项表
+ `map`
键值对行表。
**> host_map_items map=`map`**
*> host_map_items map=`map`*
## 合并
+ `a`
@@ -229,17 +229,17 @@ description: >-
右侧覆盖左侧。
**> host_map_merge a=`a` b=`b`**
*> host_map_merge a=`a` b=`b`*
## 键数
+ `map`
**> host_map_size map=`map`**
*> host_map_size map=`map`*
## 空表
**> host_list_concat a=None b=None**
*> host_list_concat a=None b=None*
## 空字典
**> host_map_merge a=None b=None**
*> host_map_merge a=None b=None*
+2 -2
View File
@@ -6,9 +6,9 @@ description: HTML 转义 / 还原(中层 Mid2 M8)。拼装字符串时的 XS
## 转义
+ `内容`
**> host_html_escape text=`内容`**
*> host_html_escape text=`内容`*
## 还原
+ `内容`
**> host_html_unescape text=`内容`**
*> host_html_unescape text=`内容`*
+7 -7
View File
@@ -7,34 +7,34 @@ description: 路径代数(中层 M2)。无 I/O;分隔符随宿主 OS。
+ `甲`
+ `乙`
**> host_path_join a=`甲` b=`乙`**
*> host_path_join a=`甲` b=`乙`*
## 拆分
+ `路径`
**> host_path_split path=`路径`**
*> host_path_split path=`路径`*
## 文件名
+ `路径`
**> host_path_file_name path=`路径`**
*> host_path_file_name path=`路径`*
## 父目录
+ `路径`
**> host_path_parent path=`路径`**
*> host_path_parent path=`路径`*
## 扩展名
+ `路径`
**> host_path_extension path=`路径`**
*> host_path_extension path=`路径`*
## 规范化
+ `路径`
**> host_path_normalize path=`路径`**
*> host_path_normalize path=`路径`*
## 是绝对
+ `路径`
**> host_path_is_absolute path=`路径`**
*> host_path_is_absolute path=`路径`*
+2 -2
View File
@@ -6,9 +6,9 @@ description: CSV 解析/序列化(中层 M4)。首行为表头 → 映射列
## 解析
+ `内容`
**> host_csv_parse text=`内容`**
*> host_csv_parse text=`内容`*
## 序列化
+ `行集`
**> host_csv_stringify rows=`行集`**
*> host_csv_stringify rows=`行集`*
+1 -1
View File
@@ -6,4 +6,4 @@ description: 只读 TOML 子集解析(中层 Mid2 M8)。表 / 标量 / 数
## 解析
+ `内容`
**> host_toml_parse text=`内容`**
*> host_toml_parse text=`内容`*