Releases: Jack-Liang/sap-for-agents
Release list
v0.4.11
Feature / 新功能
-
新增 ADT REST 通用代理
ANY /api/adt/{path}:把 SAP ICF 上的 ADT REST API(/sap/bc/adt/**,Eclipse ADT 用的同一套)1:1 透传到网关,用于 dump 正文、ABAP 类源码读写等开发对象操作。
New generic ADT REST proxyANY /api/adt/{path}: transparently forwards to the SAP ADT REST API (/sap/bc/adt/**— the same API Eclipse ADT uses), for short-dump inspection, ABAP class source read/write and other development-object operations.- 读操作(GET)直接透传;典型用法:
/api/adt/runtime/dumps(ST22 dump 列表)、/api/adt/runtime/dump/<key>/formatted(dump 全文)、/api/adt/oo/classes/<name>/source/main(类源码)。
GETs are forwarded as-is; e.g./api/adt/runtime/dumps(dump list),/api/adt/runtime/dump/<key>/formatted(full ST22 text),/api/adt/oo/classes/<name>/source/main(class source). - 写方法(POST/PUT/DELETE/PATCH)自动获取并携带
X-CSRF-Token+ 会话 Cookie,遇 403 自动刷新重试一次;凭据由网关统一持有。
Write methods automatically fetch and attach theX-CSRF-Token+ session cookie (one automatic retry on 403); credentials are held by the gateway. ETag/Last-Modified/If-Match/If-None-Match双向透传,支持乐观锁写流程(如类源码更新)。
ETag/Last-Modified/If-Match/If-None-Matchare passed through both ways, enabling optimistic-locking write flows (e.g. class source updates).- 路径按原始 percent-encoded 形式转发(保留
%2F/%20等编码意图),解码仅用于安全校验(拒绝..段与控制字符)。
Paths are forwarded with their original percent-encoding; decoding is only used for safety checks (rejecting..segments and control characters). - ADT 自身的 HTTP 状态码与响应体原样透传;网关侧故障才走 JSON 错误契约:
400 ADT_PATH_INVALID/502 ADT_UNREACHABLE/503 ADT_DISABLED/504 ADT_TIMEOUT。
ADT's own status codes and bodies pass through verbatim; only gateway-side failures use the JSON error contract:400 ADT_PATH_INVALID/502 ADT_UNREACHABLE/503 ADT_DISABLED/504 ADT_TIMEOUT.
- 读操作(GET)直接透传;典型用法:
Configuration / 配置
SAP_ADT_BASE_URL:ADT 基地址,默认http://<SAP_ASHOST>:50000;显式设为空串可禁用代理(503 ADT_DISABLED)。
SAP_ADT_BASE_URL: ADT base URL, defaults tohttp://<SAP_ASHOST>:50000; set to an empty string to disable the proxy (503 ADT_DISABLED).SAP_ADT_USER/SAP_ADT_PASSWD:代理认证,默认沿用SAP_USER/SAP_PASSWD。
SAP_ADT_USER/SAP_ADT_PASSWD: proxy credentials, default toSAP_USER/SAP_PASSWD.- 需要目标系统启用 ADT ICF 服务(SICF)。
Requires the ADT ICF service to be active in the target system (SICF).
Docs / 文档
- AGENTS.md / AGENTS.zh-CN.md、
.env.example同步新增端点与配置说明。
AGENTS.md / AGENTS.zh-CN.md and.env.exampledocument the new endpoint and configuration.
Full Changelog: v0.4.10...v0.4.11
v0.4.10
Fix / 修复
-
支持 SAP 命名空间函数
/NS/NAME(如/SDF/EWA_GET_ABAP_DUMPS、/BOBF/R_FRUIT):func_name校验放行命名空间前缀形态——斜杠只允许成对出现在/NS/前缀处,两段均须为合法标识符;畸形形态(FOO/BAR、/SDF、//X、多余/尾斜杠等)仍被拒绝。/api/functions/{name}、/doc、/source路由改为通配捕获 + 尾部分发,路径自带斜杠的命名空间函数名现在可以正常访问(原始斜杠与%2F编码两种 URL 形式均支持)。
Namespaced function modules
/NS/NAME(e.g./SDF/EWA_GET_ABAP_DUMPS,/BOBF/R_FRUIT) are now accepted: validation allows an optional/NS/prefix (slashes only there, both segments valid identifiers; malformed forms still rejected), and the/api/functions/{name}[/doc|/source]routes use wildcard capture + suffix dispatch so names containing slashes resolve correctly (both raw-slash and%2F-encoded URLs work).
Docs / 文档
- AGENTS.md / AGENTS.zh-CN.md 同步上述行为。
AGENTS.md / AGENTS.zh-CN.md updated accordingly.
Full Changelog: v0.4.9...v0.4.10
v0.4.9
Fixes / 修复
- RFC_RC 常量值与 NWRFC SDK 头文件对齐(
RFC_NOT_FOUND18→17):此前部分错误码会被误判。
RFC_RC constant values aligned with the NWRFC SDK headers (RFC_NOT_FOUND18→17); some return codes were previously misclassified. table_outputs/struct_outputs小写字段名静默返回空值:字段名现在统一按大写匹配(实测修复BAPI_USER_GETLIST小写username读不到值的问题)。
Lowercase field names in table/struct outputs silently returned empty values; field names are now normalized to uppercase.- 非 BMP 字符截断:写入字符串参数的长度改用 UTF-16 码元计数,emoji 等 4 字节 UTF-8 字符不再被截断。
String input length is now measured in UTF-16 code units, so non-BMP characters (emoji, rare CJK) are no longer truncated. function_doc的short_text不再用首个参数的描述冒充函数说明。
short_textno longer falls back to the first parameter's description.
Hardening / 加固
table_outputs/read_return增加输出行数上限(MAX_OUTPUT_ROWS = 10000),防止大结果集 OOM/DoS。
Output rows fromtable_outputs/read_returnare capped at 10,000 rows to prevent OOM/DoS from huge result sets.timeout_secs钳制到[1, 1800]秒,防止恶意长超时长期占用连接池。
Per-requesttimeout_secsis clamped to [1, 1800] seconds to prevent connections being held by abusive timeouts.- 超时与限流 fallback 路径补充告警日志,提升可观测性。
Warning logs added on timeout / rate-limit fallback paths for better observability.
Improvements / 改进
write_outputs按 DDIC 真实类型分派 setter(INT / INT8 / FLOAT / XSTRING)。
write_outputsnow dispatches typed setters by DDIC type (INT / INT8 / FLOAT / XSTRING).auto标量读取使用 metadata 中的真实长度,替代硬编码 255。
autoscalar reads use the metadata length instead of a hardcoded 255..gitignore忽略servers.toml,防止 server 凭据误提交。
servers.tomlis now git-ignored to avoid committing credentials.
Docs / 文档
- 文档与欢迎页中英双语化。
Docs and the welcome page are now bilingual (EN / 简体中文). - 欢迎页补充
/api/table/read端点说明(补 v0.4.8 遗漏)。
Welcome page now documents the/api/table/readendpoint.
Full Changelog: v0.4.8...v0.4.9
v0.4.8
Full Changelog: v0.4.7...v0.4.8
Full Changelog: v0.4.7...v0.4.8
Full Changelog: v0.4.7...v0.4.8
Full Changelog: v0.4.7...v0.4.8
Full Changelog: v0.4.7...v0.4.8
v0.4.7
Full Changelog: v0.4.6...v0.4.7
Full Changelog: v0.4.6...v0.4.7
Full Changelog: v0.4.6...v0.4.7
Full Changelog: v0.4.6...v0.4.7
Full Changelog: v0.4.6...v0.4.7
v0.4.6
Full Changelog: v0.4.5...v0.4.6
Full Changelog: v0.4.5...v0.4.6
Full Changelog: v0.4.5...v0.4.6
Full Changelog: v0.4.5...v0.4.6
Full Changelog: v0.4.5...v0.4.6
v0.4.5
Full Changelog: v0.4.4...v0.4.5
Full Changelog: v0.4.4...v0.4.5
Full Changelog: v0.4.4...v0.4.5
Full Changelog: v0.4.4...v0.4.5
Full Changelog: v0.4.4...v0.4.5
v0.4.4
Full Changelog: v0.4.3...v0.4.4
Full Changelog: v0.4.3...v0.4.4
Full Changelog: v0.4.3...v0.4.4
Full Changelog: v0.4.3...v0.4.4
Full Changelog: v0.4.3...v0.4.4
v0.4.3
Full Changelog: v0.4.2...v0.4.3
Full Changelog: v0.4.2...v0.4.3
Full Changelog: v0.4.2...v0.4.3
Full Changelog: v0.4.2...v0.4.3