@sema-agent/sdk 0.0.92 → 0.0.93
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.
|
@@ -18,7 +18,16 @@ export declare class LeaderResource {
|
|
|
18
18
|
* runLeader 实际无条件要求全部五个非空(`wire.ts:368`),同步 HTTP 门此前只查 `objective`,一个
|
|
19
19
|
* "看起来对"的最小请求会拿到 202 然后**必然**在后台异步失败,只能靠后续 GET 才发现。server 侧
|
|
20
20
|
* 同班车把这个校验前移到同步门(`main.ts` 的 `requiredFields` 参数);SDK 这边把类型收紧到诚实
|
|
21
|
-
* 反映真实约束,让编译期就能拦住这个坑,不用等真机复现才发现。
|
|
21
|
+
* 反映真实约束,让编译期就能拦住这个坑,不用等真机复现才发现。
|
|
22
|
+
*
|
|
23
|
+
* 🔴 facade 审计(2026-07-24,批次②-8):此前 opts 还有一个 `idempotencyKey` —— 纯装饰,两端都是假
|
|
24
|
+
* 的:SDK 这边没传 `submit:true` 给 `t.request()`(transport.ts:69/124 的 idempotency 挂 header +
|
|
25
|
+
* 自身 retry 判定都只认 `opts.submit`,不看 idempotencyKey 本身有没有值,所以这个 header 从来没上过
|
|
26
|
+
* wire);server 那边 `leader/endpoint.ts` 的 POST handler 从头到尾没有任何 idempotency-key 消费
|
|
27
|
+
* 逻辑——每次 POST 都无条件铸一个新 id、起一个新 leader run。继续暴露这个选项等于给调用方一个假的
|
|
28
|
+
* 「网络超时后重发是安全的」承诺,实际会真的多起一个 leader run(重复 provision E2B worker + 重复
|
|
29
|
+
* git push 尝试)。移除,不新增假线路——这条路径要真做需要 server 侧配一个 idempotency 存储层,
|
|
30
|
+
* 不是靠 SDK 单边挂个 header 就能兑现的承诺。 */
|
|
22
31
|
create(req: {
|
|
23
32
|
objective: string;
|
|
24
33
|
durableRemote: string;
|
|
@@ -27,7 +36,6 @@ export declare class LeaderResource {
|
|
|
27
36
|
baseSha: string;
|
|
28
37
|
[k: string]: unknown;
|
|
29
38
|
}, opts?: {
|
|
30
|
-
idempotencyKey?: string | null;
|
|
31
39
|
signal?: AbortSignal;
|
|
32
40
|
}): Promise<LeaderReceipt>;
|
|
33
41
|
/** GET /v1/leader/:id — leader run 记录(非 owner=404 无 oracle)。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leader.d.ts","sourceRoot":"","sources":["../../src/resources/leader.ts"],"names":[],"mappings":"AAAA;;;;;qGAKqG;AACrG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC
|
|
1
|
+
{"version":3,"file":"leader.d.ts","sourceRoot":"","sources":["../../src/resources/leader.ts"],"names":[],"mappings":"AAAA;;;;;qGAKqG;AACrG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC;;;;;;;;;;;;;;;;;;uCAkBmC;IAC7B,MAAM,CACV,GAAG,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,EAC1H,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC9B,OAAO,CAAC,aAAa,CAAC;IAIzB,gEAAgE;IAC1D,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CAGvF"}
|
package/dist/resources/leader.js
CHANGED
|
@@ -12,9 +12,18 @@ export class LeaderResource {
|
|
|
12
12
|
* runLeader 实际无条件要求全部五个非空(`wire.ts:368`),同步 HTTP 门此前只查 `objective`,一个
|
|
13
13
|
* "看起来对"的最小请求会拿到 202 然后**必然**在后台异步失败,只能靠后续 GET 才发现。server 侧
|
|
14
14
|
* 同班车把这个校验前移到同步门(`main.ts` 的 `requiredFields` 参数);SDK 这边把类型收紧到诚实
|
|
15
|
-
* 反映真实约束,让编译期就能拦住这个坑,不用等真机复现才发现。
|
|
15
|
+
* 反映真实约束,让编译期就能拦住这个坑,不用等真机复现才发现。
|
|
16
|
+
*
|
|
17
|
+
* 🔴 facade 审计(2026-07-24,批次②-8):此前 opts 还有一个 `idempotencyKey` —— 纯装饰,两端都是假
|
|
18
|
+
* 的:SDK 这边没传 `submit:true` 给 `t.request()`(transport.ts:69/124 的 idempotency 挂 header +
|
|
19
|
+
* 自身 retry 判定都只认 `opts.submit`,不看 idempotencyKey 本身有没有值,所以这个 header 从来没上过
|
|
20
|
+
* wire);server 那边 `leader/endpoint.ts` 的 POST handler 从头到尾没有任何 idempotency-key 消费
|
|
21
|
+
* 逻辑——每次 POST 都无条件铸一个新 id、起一个新 leader run。继续暴露这个选项等于给调用方一个假的
|
|
22
|
+
* 「网络超时后重发是安全的」承诺,实际会真的多起一个 leader run(重复 provision E2B worker + 重复
|
|
23
|
+
* git push 尝试)。移除,不新增假线路——这条路径要真做需要 server 侧配一个 idempotency 存储层,
|
|
24
|
+
* 不是靠 SDK 单边挂个 header 就能兑现的承诺。 */
|
|
16
25
|
async create(req, opts) {
|
|
17
|
-
return this.t.request({ method: "POST", path: "/v1/leader", body: req,
|
|
26
|
+
return this.t.request({ method: "POST", path: "/v1/leader", body: req, signal: opts?.signal });
|
|
18
27
|
}
|
|
19
28
|
/** GET /v1/leader/:id — leader run 记录(非 owner=404 无 oracle)。 */
|
|
20
29
|
async get(leaderRunId, opts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leader.js","sourceRoot":"","sources":["../../src/resources/leader.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C
|
|
1
|
+
{"version":3,"file":"leader.js","sourceRoot":"","sources":["../../src/resources/leader.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C;;;;;;;;;;;;;;;;;;uCAkBmC;IACnC,KAAK,CAAC,MAAM,CACV,GAA0H,EAC1H,IAA+B;QAE/B,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjG,CAAC;IAED,gEAAgE;IAChE,KAAK,CAAC,GAAG,CAAC,WAAmB,EAAE,IAA+B;QAC5D,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,kBAAkB,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACxH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
4
4
|
"description": "Typed, zero-runtime-dependency SDK for the Sema agent fleet usage plane. The shared substrate for all doors (CC/Codex MCP façade + web). Server-side only — tokens never enter the browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|