📝 docs(tsl): restructure agent-facing reference

Rework TSL syntax, catalog, modules, and routing docs around deterministic agent lookup and generation.

Split large catalog pages into focused function fact pages, remove obsolete pending/verified/unavailable paths, and update consistency tests for the new structure.
This commit is contained in:
csh
2026-06-09 17:24:30 +08:00
parent 9c194170a1
commit 540b3c0a1b
192 changed files with 32929 additions and 13533 deletions
+74 -21
View File
@@ -1,31 +1,84 @@
# 压缩和解压函数
这一页只负责函数定位:先按主题找到模块,再在页内搜索函数名。
文档类型:函数事实页
是否可直接用于生成代码:是;本页函数条目均包含参数表
遇到不确定时:回到 [../index.md](../index.md)、[../../syntax/index.md](../../syntax/index.md)
## 候选函数索引说明
- 本页是候选函数索引,只说明函数名被归入当前模块。
- 候选名没有进入 verified 函数页前不能当成可调用事实。
- 生成代码前必须先查 [../verified/index.md](../verified/index.md);只从 verified 函数页读取参数类型。
## 使用方式
- 返回总目录:[catalog/index.md](index.md)
- 需要基础语法时回到 [../../syntax/index.md](../../syntax/index.md)
- 需要金融任务组织方式时回到 [../../finance/index.md](../../finance/index.md)
这一页描述压缩、解压与归档能力。生成函数调用时,只按函数条目中的参数表传参。
## 模块范围
- 说明:压缩、解压与归档能力
- 主题数:
- 函数数:5
- 函数事实数:5
## 主题目录
## 函数事实
### 直接函数
### `zipCompress(zip_alias, zip_filename, file_alias, filename, path)`
- `ZipCompress`
- `ZipExtract`
- `RarExtract`
- `unicompress`
- `uniuncompress`
用途:函数事实相关函数。
参数个数:5
返回值:处理结果
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | -------------- | ---- | -------- | ---------------------------------------------------- |
| 1 | `zip_alias` | 是 | 字符串 | ZIP 文件所在目录别名;不用别名时传空字符串 |
| 2 | `zip_filename` | 是 | 字符串 | ZIP 文件路径;不存在时会创建 |
| 3 | `file_alias` | 是 | 字符串 | 被压缩文件或目录的目录别名;不用别名时传空字符串 |
| 4 | `filename` | 是 | 字符串 | 要压缩的文件或目录路径 |
| 5 | `path` | 是 | 字符串 | 压缩后在 ZIP 内部保存的路径;空字符串表示 ZIP 根目录 |
### `zipExtract(zip_alias, zip_filename, output_alias, output_dir[, password])`
用途:函数事实相关函数。
参数个数:4 到 5
返回值:处理结果
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | -------------- | ---- | -------- | ------------------------------------------ |
| 1 | `zip_alias` | 是 | 字符串 | ZIP 文件所在目录别名;不用别名时传空字符串 |
| 2 | `zip_filename` | 是 | 字符串 | ZIP 文件路径 |
| 3 | `output_alias` | 是 | 字符串 | 解压目标目录别名;不用别名时传空字符串 |
| 4 | `output_dir` | 是 | 字符串 | 解压目标目录 |
| 5 | `password` | 否 | 字符串 | ZIP 密码;普通 ZIP 可省略或传空字符串 |
### `rarExtract(rar_alias, rar_filename, alias, path[, password])`
用途:将 RAR 文件解压到指定目录。
参数个数:4 到 5
返回值:是否成功(1/0
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | -------------- | ---- | -------- | ------------------------------------------ |
| 1 | `rar_alias` | 是 | 字符串 | RAR 文件所在目录别名;不用别名时传空字符串 |
| 2 | `rar_filename` | 是 | 字符串 | RAR 文件名称或路径 |
| 3 | `alias` | 是 | 字符串 | 文件解压目录别名;不用别名时传空字符串 |
| 4 | `path` | 是 | 字符串 | 文件解压路径 |
| 5 | `password` | 否 | 字符串 | RAR 加密密码;普通 RAR 可省略 |
### `unicompress(method, data)`
用途:函数事实相关函数。
参数个数:2
返回值:处理结果
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | -------- | ---- | -------- | --------------------------------- |
| 1 | `method` | 是 | 字符串 | 压缩算法名;源文档示例使用 `zstd` |
| 2 | `data` | 是 | 字符串 | 要压缩的数据 |
### `uniuncompress(method, data[, length])`
用途:函数事实相关函数。
参数个数:2 到 3
返回值:处理结果
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | -------- | ---- | ---------- | ------------------------------------------------------ |
| 1 | `method` | 是 | 字符串 | 解压算法名;源文档示例使用 `zstd` |
| 2 | `data` | 是 | 二进制数据 | `unicompress` 返回的压缩数据 |
| 3 | `length` | 否 | 整数 | 原始数据长度;省略时也可解压源文档示例中的 `zstd` 数据 |