diff --git a/suite-developer/AGENTS.md b/suite-developer/AGENTS.md index c1bb3a2..13a0b2e 100644 --- a/suite-developer/AGENTS.md +++ b/suite-developer/AGENTS.md @@ -6,14 +6,20 @@ ### 0. 理解执行环境 -你的脚本最终跑在**用户本地的 Docker 容器**里。数据流如下: +你的脚本可以跑在两种环境下: +1. **Linux Docker 容器**(默认):现有 gis-base 镜像 +2. **Windows 本机进程**(arcpy/python3):通过 agc.exe 直接 subprocess 执行 + +执行环境由 workflow.yaml 中步骤的 `runtime` 字段决定。 ``` -你的代码 → 打包为脚本包 → 发布到套件市场 +你的代码 → 打包为脚本包 → 发布到套件市场(标记 platform: linux/windows/all) ↓ -用户执行套件 → gis-actions 从市场下载脚本包 → docker run -→ 用户数据复制到容器内 → 脚本处理 → 结果写入 /tmp/output/ -→ 脚本包清理 → 结果留在用户机器 +用户执行套件 → agc 从市场下载脚本包 + ├─ runtime: docker → Docker 容器执行(Linux) + ├─ runtime: python3 → subprocess 执行(Linux + Windows) + └─ runtime: arcpy → subprocess 执行,调用系统 arcpy(Windows) +→ 结果写入工作目录 → 临时文件自动清理 ``` **用户不上传文件,永远提供本地路径。** @@ -42,9 +48,10 @@ curl -s "https://suites.mercator.cn/api/v1/suites" | python3 -m json.tool name: 我的套件 description: 套件功能描述 version: 1.0.0 -slug: my-suite-en-name # 可选 +platform: all # linux / windows / all +slug: my-suite-en-name # 可选 tags: [标签1] -base_image: gis-base:latest +base_image: gis-base:latest # 仅 Docker 模式需要 params: input_path: @@ -55,6 +62,7 @@ params: steps: - id: step1 name: 第一步 + runtime: python3 # docker / python3 / arcpy script_id: run params: input: $params.input_path @@ -63,9 +71,11 @@ steps: ### 5. 测试 ```bash -agc run /tmp/test-output \ - --suite-id \ - --input input_path=/path/to/test.shp +# Linux +agc run /tmp/test-output --suite-id --input input_path=/path/to/test.shp + +# Windows +agc run C:\test-output --suite-id --input input_path=C:\test.shp ``` ### 6. 发布