fix: 清除 suite-developer 文件中的平台内部引用
This commit is contained in:
+21
-59
@@ -1,12 +1,11 @@
|
|||||||
# MEMORY.md — 套件开发者长期记忆
|
# MEMORY.md — 套件开发者长期记忆
|
||||||
|
|
||||||
## 平台关键信息
|
## 平台入口
|
||||||
|
|
||||||
- **套件市场:** https://suites.mercator.cn(浏览和发现套件)
|
- **API:** https://suites.mercator.cn
|
||||||
- **API 基础地址:** https://suites.mercator.cn
|
- **API Key 获取:** https://auth.mercator.cn
|
||||||
- **认证中心:** https://auth.mercator.cn(获取 API Key)
|
|
||||||
- **基础镜像:** `registry.mercator.cn/agentgis/gis-base:latest`
|
|
||||||
- **API 文档:** https://suites.mercator.cn/docs
|
- **API 文档:** https://suites.mercator.cn/docs
|
||||||
|
- **基础镜像:** `registry.mercator.cn/agentgis/gis-base:latest`
|
||||||
|
|
||||||
## Workflow.yaml 核心规则
|
## Workflow.yaml 核心规则
|
||||||
|
|
||||||
@@ -14,70 +13,33 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- id: my-step # 步骤 ID
|
- id: my-step
|
||||||
name: 我的步骤 # 步骤名称
|
name: 我的步骤
|
||||||
script_id: run # ✅ 正确:script_id: run
|
script_id: run # ✅ script_id: run,不是 script: run.py
|
||||||
# ❌ 错误:script: run.py
|
|
||||||
params:
|
params:
|
||||||
input_path: "${{inputs.input_path}}" # ✅ 双花括号
|
input: "${{inputs.input_path}}" # ✅ 双花括号
|
||||||
# ❌ $inputs.input_path
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 参数引用
|
### 常见错误
|
||||||
|
|
||||||
| 语法 | 说明 |
|
| ❌ 错误 | ✅ 正确 |
|
||||||
|------|------|
|
|---------|--------|
|
||||||
| `${{inputs.xxx}}` | 引用套件输入参数 |
|
| `script: run.py` | `script_id: run` |
|
||||||
| `${{steps.step_id.output_key}}` | 引用前序步骤的输出 |
|
| `params_mapping: {...}` | `params: {...}` |
|
||||||
|
| `$inputs.xxx` | `${{inputs.xxx}}` |
|
||||||
|
|
||||||
### resovled_params
|
### 跨步骤文件共享
|
||||||
|
|
||||||
必须在 `resolved_params` 中提供参数默认值:
|
所有步骤共享 `/tmp/output` 目录。Step 1 写入的文件,Step 2 可以直接读取。
|
||||||
|
|
||||||
```yaml
|
## 发布流程
|
||||||
resolved_params:
|
|
||||||
- step_index: 0
|
|
||||||
step_name: 我的步骤
|
|
||||||
params:
|
|
||||||
input_path: "/data/input.shp"
|
|
||||||
```
|
|
||||||
|
|
||||||
### 文件共享
|
`agc publish` 一键完成:打包 → 上传 → 注册 Skill → 注册 Suite。
|
||||||
|
|
||||||
所有 steps 共享 `/tmp/output` 目录。Step 1 写入的文件 Step 2 可以直接读取。
|
|
||||||
每个步骤也有独立的 `/tmp/step_output` 目录。
|
|
||||||
|
|
||||||
### 输出规范
|
|
||||||
|
|
||||||
脚本通过 stdout 输出 JSON,格式如下:
|
|
||||||
|
|
||||||
```python
|
|
||||||
result = {"status": "ok", "output_path": "/tmp/output/result.geojson"}
|
|
||||||
print(json.dumps(result))
|
|
||||||
```
|
|
||||||
|
|
||||||
## 执行环境
|
## 执行环境
|
||||||
|
|
||||||
- 每个任务跑在独立 Docker 容器中,用完即销毁
|
- 每个任务跑在独立 Docker 容器中,用完即销毁
|
||||||
- 容器使用 gis-base 镜像(含 GDAL / Shapely / GeoPandas)
|
- 容器使用 gis-base 镜像
|
||||||
- 脚本目录挂载到 `/tmp/scripts`(只读)
|
- 脚本目录挂载到 `/tmp/scripts`(只读)
|
||||||
- 工作目录挂载到 `/tmp/output`(读写,步骤间共享)
|
- 工作目录 `/tmp/output`(步骤间共享)
|
||||||
- 参数通过 `/tmp/params.json` 文件传入
|
- 参数通过 `/tmp/params.json` 传入
|
||||||
|
|
||||||
## 发布流程
|
|
||||||
|
|
||||||
推荐使用 `agc publish` 一键发布。内部流程:
|
|
||||||
1. 打包 workflow.yaml + scripts/ 为 tar.gz
|
|
||||||
2. 上传到平台包存储
|
|
||||||
3. 注册 Skill(可供执行)
|
|
||||||
4. (可选)注册 Suite(在市场中展示)
|
|
||||||
|
|
||||||
## 合规检测
|
|
||||||
|
|
||||||
发布时会自动检测:
|
|
||||||
- workflow.yaml 格式是否正确
|
|
||||||
- 引用的脚本是否存在
|
|
||||||
- 参数类型是否匹配
|
|
||||||
- 是否有循环依赖
|
|
||||||
|
|
||||||
不通过则发布失败,返回具体错误信息。
|
|
||||||
|
|||||||
Reference in New Issue
Block a user