feat: add execution history queries and preserve bounded JSON payloads

This commit is contained in:
2026-09-17 14:55:23 +08:00
parent da123bba69
commit 4d4b2e9f7d
32 changed files with 1461 additions and 28 deletions

18
sdk/go/json_wire.go Normal file
View File

@@ -0,0 +1,18 @@
package orbit
import (
"bytes"
"encoding/json"
)
// marshalWire 不做 HTML 转义,保持 RawMessage 精确数字及受控载荷大小。
// 这些文档只用于 JSON/WS 通道,不能直接嵌入 HTML。
func marshalWire(value any) ([]byte, error) {
var buffer bytes.Buffer
encoder := json.NewEncoder(&buffer)
encoder.SetEscapeHTML(false)
if err := encoder.Encode(value); err != nil {
return nil, err
}
return bytes.TrimSuffix(buffer.Bytes(), []byte{'\n'}), nil
}