onesvm-browser-server/server/internal/contract/session.go
chii 9b689b2476 feat: 落地节点指纹与 Cookie 罐,并按现网能力更新消费/接手文档
公开页抓取改为 Chrome 136 自洽身份 + 每节点 SQLite 养罐,Trafilatura 走 curl_cffi;MCP/README/接手说明与 09-02 现网复测对齐,避免消费方继续抄过期的站点三分表。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 17:04:25 +08:00

33 lines
904 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package contract
// AdapterClass 会话罐分轨:HTTP 档与 CDP 档身份不同,禁止混罐。
const (
AdapterHTTP = "http"
AdapterCDP = "cdp"
)
// Cookie 目标站一等 Cookie(内部流转;禁止进 MCP 信封)。
type Cookie struct {
Name string `json:"name"`
Value string `json:"value"`
Domain string `json:"domain,omitempty"`
Path string `json:"path,omitempty"`
Expires int64 `json:"expires,omitempty"` // unix 秒;0=用默认 TTL
}
// SessionAttach 调度器在 Execute 前注入,json:"-" 不进 jobs.payload。
type SessionAttach struct {
TemplateID string
Impersonate string
UserAgent string
Headers map[string]string
Cookies []Cookie
AdapterClass string
Egress string
ETLD string
}
// WithSession 给任务挂会话(不改已落库 payload)。
func (j *JobEnvelope) WithSession(s *SessionAttach) {
j.Session = s
}