@sema-agent/server 7.39.0-rc.1 → 7.39.0
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/question.d.ts +8 -0
- package/dist/question.js +5 -1
- package/dist/trace/project.d.ts +2 -7
- package/dist/trace/project.js +8 -8
- package/package.json +2 -2
package/dist/question.d.ts
CHANGED
|
@@ -14,6 +14,14 @@ export interface QuestionFrame {
|
|
|
14
14
|
/** Server-signed emit timestamp (additive, [2805]§五→[2806]). Server-minted side-frame ⇒ no core-stream
|
|
15
15
|
* `eventId` to carry (absence is honest); this is the frame's own time coordinate. */
|
|
16
16
|
serverNowMs?: number;
|
|
17
|
+
/** "question" only ([4851]③, additive, the `tool_approval` window-trio precedent from #288): the
|
|
18
|
+
* coordinator's OWN answer window (`QUESTION_TTL_MS`, default 5min) — at expiry the ask releases
|
|
19
|
+
* UNAVAILABLE ("unanswered") and core adjudicates park-vs-continue. Minted from the SAME `ttlMs` the
|
|
20
|
+
* `setTimeout` below actually arms (single source; a shell countdown rendered from these can never
|
|
21
|
+
* disagree with the release). Relative + absolute + `serverNowMs` above = clock-skew-proof trio. */
|
|
22
|
+
expiresInMs?: number;
|
|
23
|
+
/** "question" only: `serverNowMs + expiresInMs` — absolute deadline on the server's clock. */
|
|
24
|
+
expiresAtMs?: number;
|
|
17
25
|
}
|
|
18
26
|
/** The per-run context `onQuestion` recovers via ALS. `emit` delivers a frame to the run's live stream; `abortSignal`
|
|
19
27
|
* (the run's own cancel signal) releases a question parked awaiting a human when the run aborts. */
|
package/dist/question.js
CHANGED
|
@@ -180,7 +180,11 @@ export class QuestionCoordinator {
|
|
|
180
180
|
// (the settlement is still pending there, so the emit is still fully awaited).
|
|
181
181
|
// The loser of the race keeps its own handlers — an emit that rejects AFTER the race must not surface as an
|
|
182
182
|
// unhandled rejection.
|
|
183
|
-
const emitted = (async () =>
|
|
183
|
+
const emitted = (async () => {
|
|
184
|
+
// [4851]③ 窗三键与上面 setTimeout 用同一个 ttlMs 铸(单源;壳倒计时永不与真释放口径分歧)。
|
|
185
|
+
const now = Date.now();
|
|
186
|
+
return ctx.emit({ type: "question", questionId: id, questions, serverNowMs: now, expiresInMs: this.throttle.ttlMs, expiresAtMs: now + this.throttle.ttlMs });
|
|
187
|
+
})()
|
|
184
188
|
.then(() => "ok", () => "failed");
|
|
185
189
|
const delivery = await Promise.race([emitted, answerP.then(() => "stalled")]);
|
|
186
190
|
if (delivery === "ok") {
|
package/dist/trace/project.d.ts
CHANGED
|
@@ -12,13 +12,8 @@
|
|
|
12
12
|
* old session-join `toolOutput` hook is gone, there's a real source now); `eventId`/`parentToolCallId` (§E2) ride
|
|
13
13
|
* each content event, additive / tolerate-absent.
|
|
14
14
|
*/
|
|
15
|
-
import type { ApprovalSettledBy,
|
|
16
|
-
|
|
17
|
-
* 在 core tool-policy.d.ts 有声明但 5.51.0 均未入公面导出(已上板点名)——这里从已导出的
|
|
18
|
-
* `TaskEvent` tool_end 分支**结构性提取**(单源,不抄词表;core 补导出后换直接 import)。 */
|
|
19
|
-
type AskDenyResolution = NonNullable<Extract<TaskEvent, {
|
|
20
|
-
type: "tool_end";
|
|
21
|
-
}>["resolution"]>;
|
|
15
|
+
import type { ApprovalSettledBy, TaskResult } from "@sema-agent/core";
|
|
16
|
+
import { type AskDenyResolution } from "@sema-agent/core";
|
|
22
17
|
import type { RunEvent, RunRecord } from "../plugins/store-contracts.js";
|
|
23
18
|
import type { ModelUsageDelta, ModelUsageTracker, PromptManifestRecord } from "../budget.js";
|
|
24
19
|
import type { LedgerEventType } from "./ledger-events.js";
|
package/dist/trace/project.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// 值导入(非 `import type`):`settledBy` 的闭集判据必须**复用 core
|
|
2
|
-
//
|
|
3
|
-
|
|
1
|
+
// 值导入(非 `import type`):`settledBy`/`resolution` 的闭集判据必须**复用 core 的谓词**——本仓抄
|
|
2
|
+
// 一份词表就是值拷贝漂移源(上游加员时两处静默不同步)。settledBy=core 5.18.1 #187;
|
|
3
|
+
// resolution 三席=core 5.52.0 根导出([4819] 应诺兑现,[4820] 预挂的闭集换装即此)。
|
|
4
|
+
import { isApprovalSettledBy, isAskDenyResolution } from "@sema-agent/core";
|
|
4
5
|
import { redactSecrets, redactDeep } from "./redact.js";
|
|
5
6
|
/** E8 (shell-host): drain the per-task model-usage accumulator into an append-only `model_usage` DELTA event.
|
|
6
7
|
* Shared by BOTH durable-write legs (runInBackground + the resume leg) so the persisted shape never drifts; the
|
|
@@ -180,11 +181,10 @@ export function toolEndEventData(ev) {
|
|
|
180
181
|
// `AskDenyResolution`)——比 settledBy 更细(那个只说结算是什么种类,这个说拒绝走了哪条臂),
|
|
181
182
|
// 铸点在 resolveAsk 的组臂处、经引擎结算 sideband 逐字携带,**不可由 tool/policy 自declare**——
|
|
182
183
|
// core 契约逐字:「an out-of-vocabulary or self-declared word is dropped at the screens」,即
|
|
183
|
-
// **筛点单点在 core
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
...(typeof ev.resolution === "string" && ev.resolution.length > 0 && ev.resolution.length <= 64 ? { resolution: ev.resolution } : {}),
|
|
184
|
+
// **筛点单点在 core**。判据=闭集谓词 `isAskDenyResolution`(core 5.52.0 三席根导出到货,
|
|
185
|
+
// [4819]/[4820] 过渡形〔string 非空+≤64〕退役,单一属主纪律不抄词表)。
|
|
186
|
+
// 缺席不是语义(执行了的调用/policy 直拒/durable 腿都不带)。
|
|
187
|
+
...(isAskDenyResolution(ev.resolution) ? { resolution: ev.resolution } : {}),
|
|
188
188
|
// core 5.35.0 design/252 G-7(#263 提货批,[4022] G3):`approver` = 这次结算**是谁的**——审批通道
|
|
189
189
|
// 自报的结算方标识串,core `screenApproverAttribution` 筛形后逐字转录在 `settledBy` 旁,两键**合读**
|
|
190
190
|
// (`settledBy:"timeout"` + approver = 超时的那条队列名,不是拒绝的人)。与 settledBy 同族三条纪律:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.39.0
|
|
3
|
+
"version": "7.39.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@sema-agent/core": "^5.
|
|
57
|
+
"@sema-agent/core": "^5.52.0",
|
|
58
58
|
"@sema-agent/registry-core": "^0.19.0",
|
|
59
59
|
"e2b": "^2.28.0",
|
|
60
60
|
"libsodium-wrappers": "^0.8.4",
|