Add host stdlib modules and unify view/run capabilities.
Ship fs/time/sys/json/net L1 libs (plus existing text/table), default-on host caps with soft exit under view, bilingual public/stdlib docs, and design notes for deferred math/foreign. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a5d30c00b3
commit
a53ebb65ee
66 files changed
+2703
-45
No files matched your search
@@ -0,0 +1,41 @@
|
||||
---
|
||||
title: lib/fs
|
||||
description: English filesystem wrappers
|
||||
---
|
||||
|
||||
# read_text
|
||||
- path
|
||||
|
||||
**> host_read_text path=`path`**
|
||||
|
||||
# write_text
|
||||
- path
|
||||
- text
|
||||
|
||||
**> host_write_text path=`path` text=`text`**
|
||||
|
||||
# append_text
|
||||
- path
|
||||
- text
|
||||
|
||||
**> host_append_text path=`path` text=`text`**
|
||||
|
||||
# exists
|
||||
- path
|
||||
|
||||
**> host_exists path=`path`**
|
||||
|
||||
# list_dir
|
||||
- path
|
||||
|
||||
**> host_list_dir path=`path`**
|
||||
|
||||
# make_dir
|
||||
- path
|
||||
|
||||
**> host_make_dir path=`path`**
|
||||
|
||||
# remove
|
||||
- path
|
||||
|
||||
**> host_remove path=`path`**
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: lib/json
|
||||
description: JSON parse/stringify (shared EN/ZH import)
|
||||
---
|
||||
|
||||
# parse
|
||||
- text
|
||||
|
||||
**> host_json_parse text=`text`**
|
||||
|
||||
# stringify
|
||||
- value
|
||||
|
||||
**> host_json_stringify value=`value`**
|
||||
|
||||
# get
|
||||
- value
|
||||
- key
|
||||
|
||||
**> host_json_get value=`value` key=`key`**
|
||||
|
||||
# keys
|
||||
- value
|
||||
|
||||
**> host_json_keys value=`value`**
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: lib/net
|
||||
description: English minimal HTTP wrappers
|
||||
---
|
||||
|
||||
# http_get
|
||||
- url
|
||||
|
||||
**> host_http_get url=`url`**
|
||||
|
||||
# http_post
|
||||
- url
|
||||
- body
|
||||
|
||||
**> host_http_post url=`url` body=`body`**
|
||||
|
||||
# url_encode
|
||||
- text
|
||||
|
||||
**> host_url_encode text=`text`**
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: lib/sys
|
||||
description: English system wrappers
|
||||
---
|
||||
|
||||
# env_get
|
||||
- name
|
||||
|
||||
**> host_env_get name=`name`**
|
||||
|
||||
# env_set
|
||||
- name
|
||||
- value
|
||||
|
||||
**> host_env_set name=`name` value=`value`**
|
||||
|
||||
# args
|
||||
|
||||
**> host_args**
|
||||
|
||||
# cwd
|
||||
|
||||
**> host_cwd**
|
||||
|
||||
# exit
|
||||
- code
|
||||
|
||||
**> host_exit code=`code`**
|
||||
|
||||
# exec
|
||||
- cmd
|
||||
|
||||
**> host_exec cmd=`cmd`**
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: lib/time
|
||||
description: English time wrappers
|
||||
---
|
||||
|
||||
# now_unix
|
||||
|
||||
**> host_now_unix**
|
||||
|
||||
# now_ms
|
||||
|
||||
**> host_now_ms**
|
||||
|
||||
# format
|
||||
- unix
|
||||
- pattern
|
||||
|
||||
**> host_format_time unix=`unix` pattern=`pattern`**
|
||||
|
||||
# sleep_ms
|
||||
- ms
|
||||
|
||||
**> host_sleep_ms ms=`ms`**
|
||||
|
||||
# parse
|
||||
- text
|
||||
- pattern
|
||||
|
||||
**> host_parse_time text=`text` pattern=`pattern`**
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
title: lib/文件
|
||||
description: 中文文件系统包装
|
||||
---
|
||||
|
||||
# 读文本
|
||||
- 路径
|
||||
|
||||
**> host_read_text path=`路径`**
|
||||
|
||||
# 写文本
|
||||
- 路径
|
||||
- 内容
|
||||
|
||||
**> host_write_text path=`路径` text=`内容`**
|
||||
|
||||
# 追加文本
|
||||
- 路径
|
||||
- 内容
|
||||
|
||||
**> host_append_text path=`路径` text=`内容`**
|
||||
|
||||
# 存在
|
||||
- 路径
|
||||
|
||||
**> host_exists path=`路径`**
|
||||
|
||||
# 列目录
|
||||
- 路径
|
||||
|
||||
**> host_list_dir path=`路径`**
|
||||
|
||||
# 建目录
|
||||
- 路径
|
||||
|
||||
**> host_make_dir path=`路径`**
|
||||
|
||||
# 删除
|
||||
- 路径
|
||||
|
||||
**> host_remove path=`路径`**
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: lib/时间
|
||||
description: 中文时间包装
|
||||
---
|
||||
|
||||
# 此刻秒
|
||||
|
||||
**> host_now_unix**
|
||||
|
||||
# 此刻毫秒
|
||||
|
||||
**> host_now_ms**
|
||||
|
||||
# 格式化
|
||||
- 秒
|
||||
- 格式
|
||||
|
||||
**> host_format_time unix=`秒` pattern=`格式`**
|
||||
|
||||
# 睡眠毫秒
|
||||
- 毫秒
|
||||
|
||||
**> host_sleep_ms ms=`毫秒`**
|
||||
|
||||
# 解析时间
|
||||
- 内容
|
||||
- 格式
|
||||
|
||||
**> host_parse_time text=`内容` pattern=`格式`**
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: lib/系统
|
||||
description: 中文系统包装
|
||||
---
|
||||
|
||||
# 取环境
|
||||
- 名
|
||||
|
||||
**> host_env_get name=`名`**
|
||||
|
||||
# 设环境
|
||||
- 名
|
||||
- 值
|
||||
|
||||
**> host_env_set name=`名` value=`值`**
|
||||
|
||||
# 参数表
|
||||
|
||||
**> host_args**
|
||||
|
||||
# 工作目录
|
||||
|
||||
**> host_cwd**
|
||||
|
||||
# 退出
|
||||
- 码
|
||||
|
||||
**> host_exit code=`码`**
|
||||
|
||||
# 执行
|
||||
- 命令
|
||||
|
||||
**> host_exec cmd=`命令`**
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: lib/网络
|
||||
description: 中文简易网络包装
|
||||
---
|
||||
|
||||
# 获取
|
||||
- 地址
|
||||
|
||||
**> host_http_get url=`地址`**
|
||||
|
||||
# 提交
|
||||
- 地址
|
||||
- 内容
|
||||
|
||||
**> host_http_post url=`地址` body=`内容`**
|
||||
|
||||
# 编码地址
|
||||
- 内容
|
||||
|
||||
**> host_url_encode text=`内容`**
|
||||
Reference in new issue
Block a user