@sema-agent/sdk 0.0.75 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +48 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +55 -2
- package/dist/client.js.map +1 -1
- package/dist/control-client.d.ts +21 -0
- package/dist/control-client.d.ts.map +1 -1
- package/dist/control-client.js +42 -1
- package/dist/control-client.js.map +1 -1
- package/dist/control-types.d.ts +108 -0
- package/dist/control-types.d.ts.map +1 -1
- package/dist/control-types.js +15 -0
- package/dist/control-types.js.map +1 -1
- package/dist/errors.d.ts +88 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +105 -8
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +154 -16
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +1 -0
- package/dist/events.js.map +1 -1
- package/dist/health.d.ts +44 -0
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +32 -0
- package/dist/health.js.map +1 -1
- package/dist/idempotency.d.ts +8 -0
- package/dist/idempotency.d.ts.map +1 -1
- package/dist/idempotency.js +8 -0
- package/dist/idempotency.js.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/approvals.d.ts +43 -0
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js +23 -3
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/assistant.d.ts +23 -0
- package/dist/resources/assistant.d.ts.map +1 -1
- package/dist/resources/assistant.js +22 -0
- package/dist/resources/assistant.js.map +1 -1
- package/dist/resources/control/auth-providers.d.ts +17 -0
- package/dist/resources/control/auth-providers.d.ts.map +1 -1
- package/dist/resources/control/auth-providers.js +6 -0
- package/dist/resources/control/auth-providers.js.map +1 -1
- package/dist/resources/control/config.d.ts +22 -0
- package/dist/resources/control/config.d.ts.map +1 -1
- package/dist/resources/control/config.js +12 -0
- package/dist/resources/control/config.js.map +1 -1
- package/dist/resources/control/fleet.d.ts +15 -0
- package/dist/resources/control/fleet.d.ts.map +1 -1
- package/dist/resources/control/fleet.js +8 -0
- package/dist/resources/control/fleet.js.map +1 -1
- package/dist/resources/control/images.d.ts +20 -0
- package/dist/resources/control/images.d.ts.map +1 -1
- package/dist/resources/control/images.js +10 -0
- package/dist/resources/control/images.js.map +1 -1
- package/dist/resources/control/lifecycle.d.ts +8 -0
- package/dist/resources/control/lifecycle.d.ts.map +1 -1
- package/dist/resources/control/lifecycle.js +3 -0
- package/dist/resources/control/lifecycle.js.map +1 -1
- package/dist/resources/control/publish.d.ts +12 -0
- package/dist/resources/control/publish.d.ts.map +1 -1
- package/dist/resources/control/publish.js +6 -0
- package/dist/resources/control/publish.js.map +1 -1
- package/dist/resources/control/secrets.d.ts +28 -0
- package/dist/resources/control/secrets.d.ts.map +1 -1
- package/dist/resources/control/secrets.js +16 -0
- package/dist/resources/control/secrets.js.map +1 -1
- package/dist/resources/control/users.d.ts +22 -0
- package/dist/resources/control/users.d.ts.map +1 -1
- package/dist/resources/control/users.js +12 -0
- package/dist/resources/control/users.js.map +1 -1
- package/dist/resources/control/versioning.d.ts +12 -0
- package/dist/resources/control/versioning.d.ts.map +1 -1
- package/dist/resources/control/versioning.js +6 -0
- package/dist/resources/control/versioning.js.map +1 -1
- package/dist/resources/control/workers.d.ts +14 -0
- package/dist/resources/control/workers.d.ts.map +1 -1
- package/dist/resources/control/workers.js +7 -0
- package/dist/resources/control/workers.js.map +1 -1
- package/dist/resources/elicitations.d.ts +43 -0
- package/dist/resources/elicitations.d.ts.map +1 -1
- package/dist/resources/elicitations.js +8 -0
- package/dist/resources/elicitations.js.map +1 -1
- package/dist/resources/fleet.d.ts +90 -0
- package/dist/resources/fleet.d.ts.map +1 -1
- package/dist/resources/fleet.js +27 -4
- package/dist/resources/fleet.js.map +1 -1
- package/dist/resources/images.d.ts +34 -0
- package/dist/resources/images.d.ts.map +1 -1
- package/dist/resources/images.js +29 -3
- package/dist/resources/images.js.map +1 -1
- package/dist/resources/leader.d.ts +10 -0
- package/dist/resources/leader.d.ts.map +1 -1
- package/dist/resources/leader.js +4 -0
- package/dist/resources/leader.js.map +1 -1
- package/dist/resources/memory.d.ts +37 -0
- package/dist/resources/memory.d.ts.map +1 -1
- package/dist/resources/memory.js +28 -0
- package/dist/resources/memory.js.map +1 -1
- package/dist/resources/models.d.ts +12 -0
- package/dist/resources/models.d.ts.map +1 -1
- package/dist/resources/models.js +4 -0
- package/dist/resources/models.js.map +1 -1
- package/dist/resources/ops.d.ts +16 -0
- package/dist/resources/ops.d.ts.map +1 -1
- package/dist/resources/ops.js +6 -0
- package/dist/resources/ops.js.map +1 -1
- package/dist/resources/policy.d.ts +8 -0
- package/dist/resources/policy.d.ts.map +1 -1
- package/dist/resources/policy.js +1 -0
- package/dist/resources/policy.js.map +1 -1
- package/dist/resources/questions.d.ts +57 -0
- package/dist/resources/questions.d.ts.map +1 -1
- package/dist/resources/questions.js +9 -0
- package/dist/resources/questions.js.map +1 -1
- package/dist/resources/runs.d.ts +143 -0
- package/dist/resources/runs.d.ts.map +1 -1
- package/dist/resources/runs.js +129 -2
- package/dist/resources/runs.js.map +1 -1
- package/dist/resources/session-sync.d.ts +61 -0
- package/dist/resources/session-sync.d.ts.map +1 -1
- package/dist/resources/session-sync.js +54 -1
- package/dist/resources/session-sync.js.map +1 -1
- package/dist/resources/sessions.d.ts +74 -0
- package/dist/resources/sessions.d.ts.map +1 -1
- package/dist/resources/sessions.js +64 -2
- package/dist/resources/sessions.js.map +1 -1
- package/dist/resources/side-query.d.ts +18 -0
- package/dist/resources/side-query.d.ts.map +1 -1
- package/dist/resources/side-query.js +1 -0
- package/dist/resources/side-query.js.map +1 -1
- package/dist/resources/tasks.d.ts +19 -0
- package/dist/resources/tasks.d.ts.map +1 -1
- package/dist/resources/tasks.js +21 -2
- package/dist/resources/tasks.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +53 -0
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js +10 -0
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/resources/trace.d.ts +23 -0
- package/dist/resources/trace.d.ts.map +1 -1
- package/dist/resources/trace.js +27 -2
- package/dist/resources/trace.js.map +1 -1
- package/dist/resources/usage.d.ts +21 -0
- package/dist/resources/usage.d.ts.map +1 -1
- package/dist/resources/usage.js +8 -0
- package/dist/resources/usage.js.map +1 -1
- package/dist/resources/workflows.d.ts +48 -0
- package/dist/resources/workflows.d.ts.map +1 -1
- package/dist/resources/workflows.js +40 -3
- package/dist/resources/workflows.js.map +1 -1
- package/dist/settings.d.ts +90 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +24 -0
- package/dist/settings.js.map +1 -1
- package/dist/sse.d.ts +36 -0
- package/dist/sse.d.ts.map +1 -1
- package/dist/sse.js +53 -8
- package/dist/sse.js.map +1 -1
- package/dist/sync.d.ts +56 -0
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +48 -4
- package/dist/sync.js.map +1 -1
- package/dist/transport.d.ts +32 -0
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +40 -8
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +691 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -18,15 +18,27 @@ import { PolicyResource } from "./resources/policy.js";
|
|
|
18
18
|
import { WorkflowsResource } from "./resources/workflows.js";
|
|
19
19
|
import { FleetResource } from "./resources/fleet.js";
|
|
20
20
|
import type { Principal, Capabilities, ScenarioDetail } from "./types.js";
|
|
21
|
+
/** Auth posture for the worker door.
|
|
22
|
+
* - `string` — the worker `SERVICE_AUTH_TOKEN` (the normal, fail-closed path).
|
|
23
|
+
* - `{ mode: "loopback-unauthed" }` — EXPLICIT unauthenticated posture for a loopback dev engine
|
|
24
|
+
* (a server started with `ALLOW_UNAUTHED_WRITES`). Honest alternative to passing a fake token:
|
|
25
|
+
* no `Authorization` header is ever sent, and construction REFUSES any non-loopback `baseUrl`
|
|
26
|
+
* (127.0.0.1/localhost/::1 only) so it can't be pointed at a remote worker by mistake. */
|
|
21
27
|
export type AgentAuthToken = string | {
|
|
22
28
|
mode: "loopback-unauthed";
|
|
23
29
|
};
|
|
24
30
|
export interface AgentClientConfig {
|
|
31
|
+
/** Worker base URL (e.g. `http://oa.a2.svc` or via Traefik `http://<node>/<routePrefix>`). */
|
|
25
32
|
baseUrl: string;
|
|
33
|
+
/** Worker `SERVICE_AUTH_TOKEN`. SERVER-SIDE ONLY (the browser guard enforces this).
|
|
34
|
+
* For a loopback dev engine, `{ mode: "loopback-unauthed" }` is the explicit no-token posture. */
|
|
26
35
|
authToken: AgentAuthToken;
|
|
36
|
+
/** Authenticated end-user identity — REQUIRED (principal-first). Anonymous must be explicit: `anon:<id>`. */
|
|
27
37
|
principal: Principal;
|
|
38
|
+
/** openai-node-style defaults. */
|
|
28
39
|
timeoutMs?: number;
|
|
29
40
|
maxRetries?: number;
|
|
41
|
+
/** Escape hatch for tests / a deliberate browser BFF that injects the token itself. Default false. */
|
|
30
42
|
allowBrowser?: boolean;
|
|
31
43
|
fetch?: typeof fetch;
|
|
32
44
|
}
|
|
@@ -35,32 +47,68 @@ export declare class AgentClient {
|
|
|
35
47
|
readonly runs: RunsResource;
|
|
36
48
|
readonly sessions: SessionsResource;
|
|
37
49
|
readonly approvals: ApprovalsResource;
|
|
50
|
+
/** §E23 inbound-MCP-elicitation HITL(service `MCP_ELICITATION_ENABLED`)— answer a mid-tool-call form prompt
|
|
51
|
+
* an opted-in MCP server pushed on the live stream (`POST /v1/elicitations/:id/respond`)。LIVE-ONLY + same-replica。 */
|
|
38
52
|
readonly elicitations: ElicitationsResource;
|
|
53
|
+
/** §4④ live-stream AskUserQuestion HITL (core `RunnerDeps.onQuestion` → service QuestionCoordinator — LIVE-only,
|
|
54
|
+
* same-replica). The agent's OWN structured multiple-choice ask to the end user; SIBLING of `elicitations`.
|
|
55
|
+
* Consume the `question`/`question_complete` frames off `tasks.streamRaw` (event: name), answer via
|
|
56
|
+
* `POST /v1/questions/:id/respond`. */
|
|
39
57
|
readonly questions: QuestionsResource;
|
|
58
|
+
/** [830]① live-stream TOOL-APPROVAL HITL (server `TOOL_APPROVAL_ENABLED`) — the engine's permission gate
|
|
59
|
+
* ("may I run this tool?") surfaced to a live human. THIRD sibling of `elicitations`/`questions`; the
|
|
60
|
+
* `steer()`-class LIVE decide面, NOT the durable checkpoint class (`approvals`). Consume the
|
|
61
|
+
* `tool_approval`/`tool_approval_complete` frames off `tasks.streamRaw`, decide via
|
|
62
|
+
* `POST /v1/tool-approvals/:id/respond`. Gate on `capabilities.toolApproval`. */
|
|
40
63
|
readonly toolApprovals: ToolApprovalsResource;
|
|
64
|
+
/** [1469] `POST /v1/side-query`(server 1.242/core 1.361)— 一次性 brain 路由问答,无 session 副作用/
|
|
65
|
+
* 无工具执行/无流式(v1)。壳侧 utility 传输层。探测 `capabilities.sideQuery`。 */
|
|
41
66
|
readonly sideQuery: SideQueryResource;
|
|
67
|
+
/** assistant-scheduler + HITL 决策面(inbox/tasks/resume/planReview/preempt; ASSISTANT-WIRE-CONTRACT, LIVE on worker)。 */
|
|
42
68
|
readonly assistant: AssistantResource;
|
|
43
69
|
readonly trace: TraceResource;
|
|
44
70
|
readonly leader: LeaderResource;
|
|
45
71
|
readonly memory: MemoryResource;
|
|
72
|
+
/** §sandbox-image catalog(IMAGE-API §7)— 门B「选沙箱模板」只读数据源(list/select 预览)。 */
|
|
46
73
|
readonly images: ImagesResource;
|
|
74
|
+
/** §model catalog(core 1.116 `@model` 线;service GET /v1/models)— `@model` 切换的只读模型名目录(picker/autocomplete)。 */
|
|
47
75
|
readonly models: ModelsResource;
|
|
76
|
+
/** §cost/usage(service GET /v1/usage)— per-principal 成本配额 + 单任务上限(CLI `/cost` 面板真数据)。 */
|
|
48
77
|
readonly usage: UsageResource;
|
|
78
|
+
/** §permissions(service GET /v1/policy)— 生效自治档/命令策略/上限快照(CLI `/permissions` 面板真数据)。 */
|
|
49
79
|
readonly policy: PolicyResource;
|
|
80
|
+
/** §workflow 可观测(core 1.116 design/97;service GET /v1/workflows*)— owner-scoped run 列表/详情(S8-off 时 501)。 */
|
|
50
81
|
readonly workflows: WorkflowsResource;
|
|
82
|
+
/** §MF-Fleet(shell-host data contract;service GET /v1/fleet/stream)— LIVE 多行舰队视图 SSE:snapshot + 逐行
|
|
83
|
+
* task/workflow upsert/remove 帧(FULL row,update-in-place)。owner-scoped、scope 已 wire 剥、不 resumable。
|
|
84
|
+
* 🔴 与 control-plane 的 `ControlClient.fleet`(config-center 控制面)是不同类、不同 backend,勿混。 */
|
|
51
85
|
readonly fleet: FleetResource;
|
|
86
|
+
/** 运维观测面(SDK 全覆盖批 2026-07-17):/metrics 三读面。 */
|
|
52
87
|
readonly metrics: MetricsResource;
|
|
88
|
+
/** GET /v1/outcomes — 任务结局台账(design/73 §7 只读底座)。 */
|
|
53
89
|
readonly outcomes: OutcomesResource;
|
|
90
|
+
/** GET /v1/sendfile-links — SendUserFile 分发链接台账。 */
|
|
54
91
|
readonly sendfileLinks: SendfileLinksResource;
|
|
92
|
+
/** sandbox 镜像烧制控制面(client.images 的 bake 半场;operator/runner 两主体)。 */
|
|
55
93
|
readonly bakes: BakesResource;
|
|
56
94
|
private readonly config;
|
|
57
95
|
private readonly transport;
|
|
96
|
+
/** GET /v1/capabilities — one call replaces probe-by-501 (LIVE, service 7aa0f3d).
|
|
97
|
+
* Open set; booleans share deps with the route gates. Render UI by capability, not by trial. */
|
|
58
98
|
capabilities(opts?: {
|
|
59
99
|
signal?: AbortSignal;
|
|
60
100
|
}): Promise<Capabilities>;
|
|
101
|
+
/** GET /v1/capabilities/scenarios/:name — one scenario's detail card (server 1.214 server.js:567-576;
|
|
102
|
+
* `capabilities().scenarios` lists the names, THIS resolves one to its {@link ScenarioDetail}: toolset/tools/
|
|
103
|
+
* prompt digest/enabled). Same family as {@link capabilities} — a worker-config read, not a resource.
|
|
104
|
+
* Unknown name → 404 with the OBJECT-shaped body `{error:{code:"scenario_not_found"}}` (surfaced as a typed
|
|
105
|
+
* APIError with `code === "scenario_not_found"`). */
|
|
61
106
|
scenarioCapabilities(name: string, opts?: {
|
|
62
107
|
signal?: AbortSignal;
|
|
63
108
|
}): Promise<ScenarioDetail>;
|
|
109
|
+
/** Per-request principal (pinned wire contract): the wire principal is a per-request header, so multi-tenant
|
|
110
|
+
* callers (façade/BFF) scope a cheap view per end-user instead of caching principal as ambient state.
|
|
111
|
+
* Principal stays REQUIRED and explicit — no default, no fallback (fail-closed structure unchanged). */
|
|
64
112
|
withPrincipal(principal: Principal): AgentClient;
|
|
65
113
|
constructor(config: AgentClientConfig);
|
|
66
114
|
}
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uB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GAAG,OAAO,CAAC,cAAc,CAAC;IAQ5F;;6GAEyG;IACzG,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW;gBAKpC,MAAM,EAAE,iBAAiB;CAkEtC"}
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentClient — config + resource roots. This file is where the体系铁律 become STRUCTURAL constraints (so the
|
|
3
|
+
* design can't drift into the SDK):
|
|
4
|
+
* - principal-first (DESIGN §2.4): `principal` is REQUIRED at the type level — no anonymous-by-default.
|
|
5
|
+
* - secret discipline (DESIGN §2.5): `authToken` is a server-side construct param. The browser guard refuses
|
|
6
|
+
* to construct a token-bearing client when `window` exists — the SDK gives NO sugar for browser→worker
|
|
7
|
+
* direct calls (a web frontend's browser talks to its own BFF, which holds the token).
|
|
8
|
+
*/
|
|
1
9
|
import { Transport } from "./transport.js";
|
|
2
10
|
import { TasksResource } from "./resources/tasks.js";
|
|
3
11
|
import { RunsResource } from "./resources/runs.js";
|
|
@@ -18,13 +26,14 @@ import { UsageResource } from "./resources/usage.js";
|
|
|
18
26
|
import { PolicyResource } from "./resources/policy.js";
|
|
19
27
|
import { WorkflowsResource } from "./resources/workflows.js";
|
|
20
28
|
import { FleetResource } from "./resources/fleet.js";
|
|
29
|
+
/** true iff the URL's host is a loopback address (localhost / 127.0.0.0/8 / ::1). */
|
|
21
30
|
function isLoopbackBaseUrl(baseUrl) {
|
|
22
31
|
let hostname;
|
|
23
32
|
try {
|
|
24
33
|
hostname = new URL(baseUrl).hostname;
|
|
25
34
|
}
|
|
26
35
|
catch {
|
|
27
|
-
return false;
|
|
36
|
+
return false; // unparseable baseUrl can't be proven loopback — fail closed
|
|
28
37
|
}
|
|
29
38
|
const h = hostname.toLowerCase();
|
|
30
39
|
return h === "localhost" || h === "[::1]" || h === "::1" || /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(h);
|
|
@@ -34,29 +43,62 @@ export class AgentClient {
|
|
|
34
43
|
runs;
|
|
35
44
|
sessions;
|
|
36
45
|
approvals;
|
|
46
|
+
/** §E23 inbound-MCP-elicitation HITL(service `MCP_ELICITATION_ENABLED`)— answer a mid-tool-call form prompt
|
|
47
|
+
* an opted-in MCP server pushed on the live stream (`POST /v1/elicitations/:id/respond`)。LIVE-ONLY + same-replica。 */
|
|
37
48
|
elicitations;
|
|
49
|
+
/** §4④ live-stream AskUserQuestion HITL (core `RunnerDeps.onQuestion` → service QuestionCoordinator — LIVE-only,
|
|
50
|
+
* same-replica). The agent's OWN structured multiple-choice ask to the end user; SIBLING of `elicitations`.
|
|
51
|
+
* Consume the `question`/`question_complete` frames off `tasks.streamRaw` (event: name), answer via
|
|
52
|
+
* `POST /v1/questions/:id/respond`. */
|
|
38
53
|
questions;
|
|
54
|
+
/** [830]① live-stream TOOL-APPROVAL HITL (server `TOOL_APPROVAL_ENABLED`) — the engine's permission gate
|
|
55
|
+
* ("may I run this tool?") surfaced to a live human. THIRD sibling of `elicitations`/`questions`; the
|
|
56
|
+
* `steer()`-class LIVE decide面, NOT the durable checkpoint class (`approvals`). Consume the
|
|
57
|
+
* `tool_approval`/`tool_approval_complete` frames off `tasks.streamRaw`, decide via
|
|
58
|
+
* `POST /v1/tool-approvals/:id/respond`. Gate on `capabilities.toolApproval`. */
|
|
39
59
|
toolApprovals;
|
|
60
|
+
/** [1469] `POST /v1/side-query`(server 1.242/core 1.361)— 一次性 brain 路由问答,无 session 副作用/
|
|
61
|
+
* 无工具执行/无流式(v1)。壳侧 utility 传输层。探测 `capabilities.sideQuery`。 */
|
|
40
62
|
sideQuery;
|
|
63
|
+
/** assistant-scheduler + HITL 决策面(inbox/tasks/resume/planReview/preempt; ASSISTANT-WIRE-CONTRACT, LIVE on worker)。 */
|
|
41
64
|
assistant;
|
|
42
65
|
trace;
|
|
43
66
|
leader;
|
|
44
67
|
memory;
|
|
68
|
+
/** §sandbox-image catalog(IMAGE-API §7)— 门B「选沙箱模板」只读数据源(list/select 预览)。 */
|
|
45
69
|
images;
|
|
70
|
+
/** §model catalog(core 1.116 `@model` 线;service GET /v1/models)— `@model` 切换的只读模型名目录(picker/autocomplete)。 */
|
|
46
71
|
models;
|
|
72
|
+
/** §cost/usage(service GET /v1/usage)— per-principal 成本配额 + 单任务上限(CLI `/cost` 面板真数据)。 */
|
|
47
73
|
usage;
|
|
74
|
+
/** §permissions(service GET /v1/policy)— 生效自治档/命令策略/上限快照(CLI `/permissions` 面板真数据)。 */
|
|
48
75
|
policy;
|
|
76
|
+
/** §workflow 可观测(core 1.116 design/97;service GET /v1/workflows*)— owner-scoped run 列表/详情(S8-off 时 501)。 */
|
|
49
77
|
workflows;
|
|
78
|
+
/** §MF-Fleet(shell-host data contract;service GET /v1/fleet/stream)— LIVE 多行舰队视图 SSE:snapshot + 逐行
|
|
79
|
+
* task/workflow upsert/remove 帧(FULL row,update-in-place)。owner-scoped、scope 已 wire 剥、不 resumable。
|
|
80
|
+
* 🔴 与 control-plane 的 `ControlClient.fleet`(config-center 控制面)是不同类、不同 backend,勿混。 */
|
|
50
81
|
fleet;
|
|
82
|
+
/** 运维观测面(SDK 全覆盖批 2026-07-17):/metrics 三读面。 */
|
|
51
83
|
metrics;
|
|
84
|
+
/** GET /v1/outcomes — 任务结局台账(design/73 §7 只读底座)。 */
|
|
52
85
|
outcomes;
|
|
86
|
+
/** GET /v1/sendfile-links — SendUserFile 分发链接台账。 */
|
|
53
87
|
sendfileLinks;
|
|
88
|
+
/** sandbox 镜像烧制控制面(client.images 的 bake 半场;operator/runner 两主体)。 */
|
|
54
89
|
bakes;
|
|
55
90
|
config;
|
|
56
91
|
transport;
|
|
92
|
+
/** GET /v1/capabilities — one call replaces probe-by-501 (LIVE, service 7aa0f3d).
|
|
93
|
+
* Open set; booleans share deps with the route gates. Render UI by capability, not by trial. */
|
|
57
94
|
capabilities(opts) {
|
|
58
95
|
return this.transport.request({ method: "GET", path: "/v1/capabilities", signal: opts?.signal });
|
|
59
96
|
}
|
|
97
|
+
/** GET /v1/capabilities/scenarios/:name — one scenario's detail card (server 1.214 server.js:567-576;
|
|
98
|
+
* `capabilities().scenarios` lists the names, THIS resolves one to its {@link ScenarioDetail}: toolset/tools/
|
|
99
|
+
* prompt digest/enabled). Same family as {@link capabilities} — a worker-config read, not a resource.
|
|
100
|
+
* Unknown name → 404 with the OBJECT-shaped body `{error:{code:"scenario_not_found"}}` (surfaced as a typed
|
|
101
|
+
* APIError with `code === "scenario_not_found"`). */
|
|
60
102
|
scenarioCapabilities(name, opts) {
|
|
61
103
|
return this.transport.request({
|
|
62
104
|
method: "GET",
|
|
@@ -64,15 +106,20 @@ export class AgentClient {
|
|
|
64
106
|
signal: opts?.signal,
|
|
65
107
|
});
|
|
66
108
|
}
|
|
109
|
+
/** Per-request principal (pinned wire contract): the wire principal is a per-request header, so multi-tenant
|
|
110
|
+
* callers (façade/BFF) scope a cheap view per end-user instead of caching principal as ambient state.
|
|
111
|
+
* Principal stays REQUIRED and explicit — no default, no fallback (fail-closed structure unchanged). */
|
|
67
112
|
withPrincipal(principal) {
|
|
68
113
|
if (!principal)
|
|
69
114
|
throw new Error("AgentClient.withPrincipal: principal is required (use 'anon:<id>' to be explicitly anonymous).");
|
|
70
115
|
return new AgentClient({ ...this.config, principal });
|
|
71
116
|
}
|
|
72
117
|
constructor(config) {
|
|
73
|
-
this.config = { ...config };
|
|
118
|
+
this.config = { ...config }; // own copy — later caller mutation must not leak into scoped views
|
|
74
119
|
if (!config.principal)
|
|
75
120
|
throw new Error("AgentClient: `principal` is required (principal-first). Use 'anon:<id>' to be explicitly anonymous.");
|
|
121
|
+
// loopback-unauthed (by design): the only way to construct without a token is to SAY SO, and it is
|
|
122
|
+
// structurally pinned to a loopback baseUrl — a remote worker always requires a real token.
|
|
76
123
|
const loopbackUnauthed = typeof config.authToken === "object" && config.authToken !== null;
|
|
77
124
|
if (loopbackUnauthed) {
|
|
78
125
|
if (config.authToken.mode !== "loopback-unauthed") {
|
|
@@ -85,9 +132,15 @@ export class AgentClient {
|
|
|
85
132
|
else if (!config.authToken) {
|
|
86
133
|
throw new Error("AgentClient: `authToken` is required (worker is fail-closed).");
|
|
87
134
|
}
|
|
135
|
+
// 🔴 secret discipline: a token must never live in a browser. If `window` exists and the caller didn't
|
|
136
|
+
// explicitly opt in (allowBrowser, for a BFF that injects per-request), refuse to construct.
|
|
88
137
|
if (!config.allowBrowser && typeof globalThis.window !== "undefined") {
|
|
89
138
|
throw new Error("AgentClient: refusing to construct a token-bearing client in a browser (secret discipline). A browser must call its own BFF; only the server holds SERVICE_AUTH_TOKEN.");
|
|
90
139
|
}
|
|
140
|
+
// 🔴 secret discipline: the worker token + principal are captured in this closure ONLY — never stored as
|
|
141
|
+
// a Transport field. The header shape (Bearer authToken + x-agent-principal) is byte-identical to before;
|
|
142
|
+
// it has just moved from Transport.headers() to here so worker + registry share one request/retry engine.
|
|
143
|
+
// loopback-unauthed sends NO Authorization header at all (no fake token on the wire).
|
|
91
144
|
const authToken = typeof config.authToken === "string" ? config.authToken : undefined;
|
|
92
145
|
const principal = config.principal;
|
|
93
146
|
const opts = {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA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G,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC;CACF"}
|
package/dist/control-client.d.ts
CHANGED
|
@@ -9,27 +9,48 @@ import { ControlSecretsResource } from "./resources/control/secrets.js";
|
|
|
9
9
|
import { ControlAuthProvidersResource } from "./resources/control/auth-providers.js";
|
|
10
10
|
import { ControlUsersResource } from "./resources/control/users.js";
|
|
11
11
|
export interface ControlClientConfig {
|
|
12
|
+
/** sema-registry base URL — your registry deployment host (NOT the worker endpoint). The caller
|
|
13
|
+
* resolves this from the env-NAME SEMA_REGISTRY_URL (legacy CONFIG_CENTER_URL) or a flag. */
|
|
12
14
|
baseUrl: string;
|
|
15
|
+
/** editor/admin Bearer. 🔴 SERVER-SIDE ONLY (the browser guard enforces it). The caller reads it from the
|
|
16
|
+
* env-NAME SEMA_REGISTRY_TOKEN (legacy CONFIG_CENTER_TOKEN) and passes the VALUE in — the SDK never reads
|
|
17
|
+
* env (env-agnostic, same as AgentClient.authToken). */
|
|
13
18
|
token: string;
|
|
19
|
+
/** Audit principal (OPTIONAL). Maps to the registry's x-agent-principal → audited as `ai:<principal>`.
|
|
20
|
+
* Omitted ⇒ the header is not sent ⇒ the registry records `unknown`. (Registry does NOT require principal-
|
|
21
|
+
* first, unlike the worker — so this is optional here.) */
|
|
14
22
|
principal?: string;
|
|
15
23
|
timeoutMs?: number;
|
|
16
24
|
maxRetries?: number;
|
|
25
|
+
/** Escape hatch for tests / a deliberate BFF that injects the token itself. Default false. */
|
|
17
26
|
allowBrowser?: boolean;
|
|
18
27
|
fetch?: typeof fetch;
|
|
19
28
|
}
|
|
20
29
|
export declare class ControlClient {
|
|
30
|
+
/** config domain CRUD + atomic batch + schema introspection + portable export (the CLI fleet.ts归宿). */
|
|
21
31
|
readonly config: ControlConfigResource;
|
|
32
|
+
/** audit trail: list changes / diff one change / rollback to a past snapshot. */
|
|
22
33
|
readonly versioning: ControlVersioningResource;
|
|
34
|
+
/** the draft→production publish gate + N-approver approval workflow. */
|
|
23
35
|
readonly publish: ControlPublishResource;
|
|
36
|
+
/** operations dashboard read + 多主机调度 (placement / rebalance / reschedule preview+apply). */
|
|
24
37
|
readonly fleet: ControlFleetResource;
|
|
38
|
+
/** per-worker ops: status read / image roll (full-auto CD) / rotate (force recreate). */
|
|
25
39
|
readonly workers: ControlWorkersResource;
|
|
40
|
+
/** fleet lifecycle: cascade-delete an owner's workers / run one sweep pass. */
|
|
26
41
|
readonly lifecycle: ControlLifecycleResource;
|
|
42
|
+
/** shared sandbox-image pool (BFF relay over the worker /v1/images): list / get / by-digest / resolve-preview. */
|
|
27
43
|
readonly images: ControlImagesResource;
|
|
44
|
+
/** worker app-secret write-through + inventory + batch-rotate + reclaim. 🔴 values go UP once, never read back. */
|
|
28
45
|
readonly secrets: ControlSecretsResource;
|
|
46
|
+
/** login auth-provider config (Gitea/OAuth2). 🔴 client_secret is an env-NAME, never a value. */
|
|
29
47
|
readonly authProviders: ControlAuthProvidersResource;
|
|
48
|
+
/** console user (RBAC) management + per-user scoped API tokens (minted plaintext shown once). */
|
|
30
49
|
readonly users: ControlUsersResource;
|
|
31
50
|
private readonly config_;
|
|
32
51
|
private readonly transport;
|
|
52
|
+
/** Per-request audit principal — a scoped view that stamps `x-agent-principal` for THIS caller's actions
|
|
53
|
+
* (a multi-tenant BFF scopes audit identity per operator without re-reading the token from env). */
|
|
33
54
|
withPrincipal(principal: string): ControlClient;
|
|
34
55
|
constructor(config: ControlClientConfig);
|
|
35
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-client.d.ts","sourceRoot":"","sources":["../src/control-client.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,oBAAoB,E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Q,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,yFAAyF;IACzF,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;IAC7C,kHAAkH;IAClH,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,mHAAmH;IACnH,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,iGAAiG;IACjG,QAAQ,CAAC,aAAa,EAAE,4BAA4B,CAAC;IACrD,iGAAiG;IACjG,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IAErC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IAEtC;yGACqG;IACrG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa;gBAInC,MAAM,EAAE,mBAAmB;CA0CxC"}
|
package/dist/control-client.js
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ControlClient — the TOB CONTROL PLANE client: sema-registry (config-center) `/api/config/*`. This is a
|
|
3
|
+
* peer to AgentClient, NOT a part of it: it talks to a DIFFERENT backend (SEMA_REGISTRY_URL — your
|
|
4
|
+
* registry deployment, NOT the worker endpoint) with a DIFFERENT secret (editor/admin Bearer
|
|
5
|
+
* SEMA_REGISTRY_TOKEN — NOT a worker session token).
|
|
6
|
+
*
|
|
7
|
+
* 🔴 WHY A SEPARATE CLIENT (structural, not stylistic):
|
|
8
|
+
* - Two同级 secrets must never share one object: a single client would force a "pick the token by path
|
|
9
|
+
* prefix" branch in header assembly — exactly the fail-open shape to avoid. Two clients = two header
|
|
10
|
+
* closures = two independently-captured secrets; it is structurally impossible to send the registry token
|
|
11
|
+
* to the worker (or vice-versa).
|
|
12
|
+
* - principal semantics differ: the worker REQUIRES principal-first; the registry's x-agent-principal is
|
|
13
|
+
* OPTIONAL (audit slug `ai:<principal>`, absent → `unknown`). Forcing it into AgentClient's REQUIRED
|
|
14
|
+
* principal would be a semantic mismatch.
|
|
15
|
+
*
|
|
16
|
+
* It REUSES Transport's request/retry/timeout/Retry-After/parseJson engine (token-agnostic) via two injection
|
|
17
|
+
* points: `buildHeaders` (registry Bearer + optional principal) and `mapError` (toControlError — the registry's
|
|
18
|
+
* `{error}` envelope, NOT the worker's errorCode envelope).
|
|
19
|
+
*
|
|
20
|
+
* 🔴 secret discipline (sema-cli/fleet.ts parity): the registry token is a server-side construct param. The
|
|
21
|
+
* SDK is env-AGNOSTIC — it does NOT read SEMA_REGISTRY_TOKEN/_URL itself; the CLI/BFF reads the env-NAME and
|
|
22
|
+
* passes the value in (so the SDK has no opinion about which env-NAME holds it). The browser guard refuses
|
|
23
|
+
* to hold the token when `window` exists. The token never appears in any return type, any error message
|
|
24
|
+
* (scrub), any log, and is never echoed back as an Authorization header.
|
|
25
|
+
*/
|
|
1
26
|
import { Transport } from "./transport.js";
|
|
2
27
|
import { toControlError } from "./errors.js";
|
|
3
28
|
import { ControlConfigResource } from "./resources/control/config.js";
|
|
@@ -11,30 +36,44 @@ import { ControlSecretsResource } from "./resources/control/secrets.js";
|
|
|
11
36
|
import { ControlAuthProvidersResource } from "./resources/control/auth-providers.js";
|
|
12
37
|
import { ControlUsersResource } from "./resources/control/users.js";
|
|
13
38
|
export class ControlClient {
|
|
39
|
+
/** config domain CRUD + atomic batch + schema introspection + portable export (the CLI fleet.ts归宿). */
|
|
14
40
|
config;
|
|
41
|
+
/** audit trail: list changes / diff one change / rollback to a past snapshot. */
|
|
15
42
|
versioning;
|
|
43
|
+
/** the draft→production publish gate + N-approver approval workflow. */
|
|
16
44
|
publish;
|
|
45
|
+
/** operations dashboard read + 多主机调度 (placement / rebalance / reschedule preview+apply). */
|
|
17
46
|
fleet;
|
|
47
|
+
/** per-worker ops: status read / image roll (full-auto CD) / rotate (force recreate). */
|
|
18
48
|
workers;
|
|
49
|
+
/** fleet lifecycle: cascade-delete an owner's workers / run one sweep pass. */
|
|
19
50
|
lifecycle;
|
|
51
|
+
/** shared sandbox-image pool (BFF relay over the worker /v1/images): list / get / by-digest / resolve-preview. */
|
|
20
52
|
images;
|
|
53
|
+
/** worker app-secret write-through + inventory + batch-rotate + reclaim. 🔴 values go UP once, never read back. */
|
|
21
54
|
secrets;
|
|
55
|
+
/** login auth-provider config (Gitea/OAuth2). 🔴 client_secret is an env-NAME, never a value. */
|
|
22
56
|
authProviders;
|
|
57
|
+
/** console user (RBAC) management + per-user scoped API tokens (minted plaintext shown once). */
|
|
23
58
|
users;
|
|
24
59
|
config_;
|
|
25
60
|
transport;
|
|
61
|
+
/** Per-request audit principal — a scoped view that stamps `x-agent-principal` for THIS caller's actions
|
|
62
|
+
* (a multi-tenant BFF scopes audit identity per operator without re-reading the token from env). */
|
|
26
63
|
withPrincipal(principal) {
|
|
27
64
|
return new ControlClient({ ...this.config_, principal });
|
|
28
65
|
}
|
|
29
66
|
constructor(config) {
|
|
30
|
-
this.config_ = { ...config };
|
|
67
|
+
this.config_ = { ...config }; // own copy — later caller mutation must not leak into scoped views
|
|
31
68
|
if (!config.baseUrl)
|
|
32
69
|
throw new Error("ControlClient: `baseUrl` is required (the sema-registry base URL).");
|
|
33
70
|
if (!config.token)
|
|
34
71
|
throw new Error("ControlClient: `token` is required (the registry is fail-closed). Read it from the env-NAME SEMA_REGISTRY_TOKEN (legacy CONFIG_CENTER_TOKEN) and pass the value in.");
|
|
72
|
+
// 🔴 secret discipline: an editor/admin Bearer must never live in a browser. Same guard as AgentClient.
|
|
35
73
|
if (!config.allowBrowser && typeof globalThis.window !== "undefined") {
|
|
36
74
|
throw new Error("ControlClient: refusing to construct a token-bearing control-plane client in a browser (secret discipline). The browser must call its own BFF; only the server holds SEMA_REGISTRY_TOKEN.");
|
|
37
75
|
}
|
|
76
|
+
// 🔴 token captured in the buildHeaders closure ONLY — never stored as a Transport field, never serializable.
|
|
38
77
|
const token = config.token;
|
|
39
78
|
const principal = config.principal;
|
|
40
79
|
const opts = {
|
|
@@ -42,6 +81,7 @@ export class ControlClient {
|
|
|
42
81
|
timeoutMs: config.timeoutMs ?? 60_000,
|
|
43
82
|
maxRetries: config.maxRetries ?? 2,
|
|
44
83
|
fetchImpl: config.fetch ?? fetch,
|
|
84
|
+
// registry header装配: editor/admin Bearer + content-type, and x-agent-principal ONLY when set.
|
|
45
85
|
buildHeaders: (idempotencyKey) => {
|
|
46
86
|
const h = {
|
|
47
87
|
authorization: `Bearer ${token}`,
|
|
@@ -53,6 +93,7 @@ export class ControlClient {
|
|
|
53
93
|
h["idempotency-key"] = idempotencyKey;
|
|
54
94
|
return h;
|
|
55
95
|
},
|
|
96
|
+
// registry error envelope is `{error, issues?, currentVersion?}` — NOT the worker errorCode envelope.
|
|
56
97
|
mapError: toControlError,
|
|
57
98
|
};
|
|
58
99
|
const t = new Transport(opts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-client.js","sourceRoot":"","sources":["../src/control-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"control-client.js","sourceRoot":"","sources":["../src/control-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACt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