@sema-agent/client-core 0.20.1 → 0.22.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/README.md +1 -1
- package/dist/request/taskRequest.d.ts +11 -0
- package/dist/request/taskRequest.js +17 -0
- package/dist/seatContract.d.ts +29 -2
- package/dist/seatContract.js +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Renamed from **`@sema-agent/wire-cc-adapter`** (0.1.x, deprecated — see *Migra
|
|
|
23
23
|
|
|
24
24
|
## Scope
|
|
25
25
|
|
|
26
|
-
**Version:** 0.
|
|
26
|
+
**Version:** 0.22.0
|
|
27
27
|
|
|
28
28
|
- **Today** — the adapter seam, the whole `adapt()` pipeline (all 14 A-layer arms plus the
|
|
29
29
|
B/D/E tool-card layers), the notification/caps/model families, the adapter kernel (stream driver
|
|
@@ -88,6 +88,17 @@ export interface TaskRequestInput {
|
|
|
88
88
|
interactiveTools?: false;
|
|
89
89
|
/** rewind 三件(E18);端自己判空。 */
|
|
90
90
|
rewind?: Record<string, unknown>;
|
|
91
|
+
/** 仓库坐标串(scan/code-review 场景;今日唯一供给方 web 的 Repository 输入=url/`owner/name` 串。
|
|
92
|
+
* server 是权威校验方;若 server 侧扩结构形,这里随提货单扩,不预铸。 */
|
|
93
|
+
repo?: string;
|
|
94
|
+
/** council 形开关(server 读 `=== true`)。 */
|
|
95
|
+
council?: boolean;
|
|
96
|
+
/** debate 变体开关(server 读 `=== true`)。 */
|
|
97
|
+
debate?: boolean;
|
|
98
|
+
/** debate 轮数(server clamp [1,3])。 */
|
|
99
|
+
rounds?: number;
|
|
100
|
+
/** 镜头名集(code-review 场景;web 进阶项发镜头名列表。语义/合法词表归 server 场景定义)。 */
|
|
101
|
+
lenses?: readonly string[];
|
|
91
102
|
/** `settings` 的四个来源(端各自解析;本模块只负责合并序与「全空则不 stamp」)。 */
|
|
92
103
|
settings?: {
|
|
93
104
|
resolved?: Record<string, unknown>;
|
|
@@ -24,6 +24,16 @@ export const REQUEST_FIELD_MATRIX = [
|
|
|
24
24
|
{ field: 'mcpServers', lanes: ['interactive', 'print'], live: true, why: '本地 .mcp.json 投影;service 单用户门决定是否兑现' },
|
|
25
25
|
{ field: 'settings.webSearch', lanes: ['interactive', 'print'], live: true, why: 'SEMA_WEBSEARCH_* / settings.json;per-request 配置赢过部署 env' },
|
|
26
26
|
{ field: 'settings.hooks', lanes: ['interactive', 'print'], live: true, why: '[495]① 用户 settings 文件 hooks 逐字上 wire' },
|
|
27
|
+
// ── repo 场景五键([C135] 请托,2026-08-08):SDK TaskRequest 成文 passthrough 键(types doc
|
|
28
|
+
// 「scenario-specific fields like code-review's repo/council/debate/rounds ride here」),server
|
|
29
|
+
// resolve-spec 顶层直读(council/debate 按 `=== true`,rounds 进 clamp [1,3])。lanes 与
|
|
30
|
+
// scenario 同款(print 有 --scenario/SEMA_HEADLESS_SCENARIO,scan 场景无 repo 即 501/无意义,
|
|
31
|
+
// 值缺席不 stamp,登位为 -p 侧未来入口留座)。今天唯一供给方=web BFF lane 的 repo 字段入口。──
|
|
32
|
+
{ field: 'repo', lanes: ['interactive', 'print'], live: true, why: 'scan/code-review 场景的仓库坐标(passthrough;server 是权威校验方,本层不铸第二判官)' },
|
|
33
|
+
{ field: 'council', lanes: ['interactive', 'print'], live: true, why: 'code-review council 形开关(server 读 `=== true`;非 true 不 stamp=与缺席同义,发小的那个)' },
|
|
34
|
+
{ field: 'debate', lanes: ['interactive', 'print'], live: true, why: 'council 的 debate 变体开关(server 读 `=== true`)' },
|
|
35
|
+
{ field: 'rounds', lanes: ['interactive', 'print'], live: true, why: 'debate 轮数(server clamp [1,3],非有限数被 server 归 undefined——本层原样透传不预 clamp)' },
|
|
36
|
+
{ field: 'lenses', lanes: ['interactive', 'print'], live: true, why: 'code-review 镜头集(passthrough 同 repo;形状由 server 场景定义,本层不闭集)' },
|
|
27
37
|
// ── print 独有(§8-5 认定的**有理由**的差异)──────────────────────────────────────────────
|
|
28
38
|
{ field: 'finalVerification', lanes: ['print'], live: true, why: 'P1-1 终验:无人值守车道才需要引擎自证;交互 REPL 由人当场看结果。#106 裁 B(让位+告知)后交互面默认关' },
|
|
29
39
|
{ field: 'limits', lanes: ['print'], live: true, why: 'P2-3-b:`-p` 的预算护栏(--max-* flag 族),交互 REPL 由人随时 Esc' },
|
|
@@ -112,6 +122,13 @@ export function buildTaskRequest(input, lane) {
|
|
|
112
122
|
...(on('promptProfile', input.promptProfile) ? { promptProfile: input.promptProfile } : {}),
|
|
113
123
|
...(on('enableFork', input.enableFork) ? { enableFork: input.enableFork } : {}),
|
|
114
124
|
...(on('attachments', input.attachments) ? { attachments: input.attachments } : {}),
|
|
125
|
+
// repo 场景五键([C135]):值驱动 stamp;council/debate 非 true 不 stamp(与 server `=== true`
|
|
126
|
+
// 读法合拍——false 与缺席在 wire 上同义,发小的那个)。
|
|
127
|
+
...(on('repo', input.repo) ? { repo: input.repo } : {}),
|
|
128
|
+
...(on('council', input.council) && input.council === true ? { council: true } : {}),
|
|
129
|
+
...(on('debate', input.debate) && input.debate === true ? { debate: true } : {}),
|
|
130
|
+
...(on('rounds', input.rounds) ? { rounds: input.rounds } : {}),
|
|
131
|
+
...(on('lenses', input.lenses) ? { lenses: input.lenses } : {}),
|
|
115
132
|
// 空数组按 `images` 同款处理:没带附件与「带了 0 个附件」在 wire 上是同一件事,发小的那个。
|
|
116
133
|
...(on('attachmentIds', input.attachmentIds) && (input.attachmentIds?.length ?? 0) > 0
|
|
117
134
|
? { attachmentIds: [...(input.attachmentIds ?? [])] }
|
package/dist/seatContract.d.ts
CHANGED
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
import type { ReasoningEffort } from "./effortWire.js";
|
|
76
76
|
import type { LaneProof } from "./seam.js";
|
|
77
77
|
import type { QuestionAnswer } from "./liveQuestionStore.js";
|
|
78
|
+
import type { ToolApprovalDelegation } from "./hitl/toolApprovalWire.js";
|
|
78
79
|
/** 一次门校验的失败说明。 */
|
|
79
80
|
export interface SeatValidationFailure {
|
|
80
81
|
/** 人可读的失败原因,恒在场且非空(宿主日志里那一行的正文)。 */
|
|
@@ -222,6 +223,18 @@ export interface ToolPermissionRequest {
|
|
|
222
223
|
* 与转录里的引擎时间戳不可直接相减)。缺席 = wire 那一行没带时间(旧 server 的 durable 行)⇒
|
|
223
224
|
* 消费端渲「刚刚」或不渲时间,**绝不**回落成 0(那会渲成 1970)。 */
|
|
224
225
|
createdAtMs?: number;
|
|
226
|
+
/** 治理强制位([C130] 补键,2026-08-08;server ≥7.5.0,语义原样来自
|
|
227
|
+
* `ApprovalCardRequest.governanceForced`):此门来自部署治理层,「permission-mode overrides
|
|
228
|
+
* do not apply」。🔴 缺席 ≠ `false`:键**只在为真时在场**,缺席 = 无治理来源证据(真的非治理
|
|
229
|
+
* ask 与 server 判据够不着的形共用缺席)⇒ 渲染端绝不渲「可用表态绕开」,也绝不合成治理徽标。
|
|
230
|
+
* 唯一合法供给 = 宿主(session-host)从已过 hitl wire 门的 `ApprovalCardRequest` **透传**,
|
|
231
|
+
* 绝不自铸;为 `false` 的值不该出现在座位面上(条件 stamp 纪律与 wire 门同款)。 */
|
|
232
|
+
governanceForced?: true;
|
|
233
|
+
/** 委派出处链([C130] 补键;core 5.9.0 W1,原样来自 `ApprovalCardRequest.delegation`,形 =
|
|
234
|
+
* hitl 的命名类型,单一真源)。只读展示增强——卡说清这只 ask 从哪一层子代浮上来;`agentName`
|
|
235
|
+
* UNTRUSTED-for-display(纯文本渲染,零注入面)。缺席 = 非子代 ask 或 wire 没给 ⇒ 不渲委派行。
|
|
236
|
+
* 坏形处置与 hitl wire 门同款纪律:**读坏形降缺席**,绝不因展示键拒掉整条审批行。 */
|
|
237
|
+
delegation?: ToolApprovalDelegation;
|
|
225
238
|
}
|
|
226
239
|
/**
|
|
227
240
|
* 座位事件名的**闭集**(REF-CC-065):这是三端唯一的事件名真源。
|
|
@@ -451,6 +464,14 @@ export interface SendMessageRequest {
|
|
|
451
464
|
/** Per-turn settings sub-object → `TaskRequest.settings`. Closed shape (`SeatTurnSettings`);
|
|
452
465
|
* today's only member is the `ultracode` preset boolean. */
|
|
453
466
|
settings?: SeatTurnSettings;
|
|
467
|
+
/** 本轮 scenario 拨盘选择([C131] 补载体,2026-08-08)→ `TaskRequest.scenario`。**开集**(SDK
|
|
468
|
+
* `Scenario = KnownScenario | (string & {})` 同姿态——部署可注册自有场景,座位面不替它闭集)。
|
|
469
|
+
* 缺席 = 不 stamp,由部署解析默认场景(assignment 链)。错误面是响亮的 typed 400:名字不在
|
|
470
|
+
* 部署词表 ⇒ `scenario_unknown`(body 带 live 词表 `known`);在词表但不在本 principal
|
|
471
|
+
* allowlist ⇒ `scenario_not_allowed`(带 allowlist)——渲染端可据此渲有效选项,不猜不折叠。
|
|
472
|
+
* 此前的结构性缺席与 `reasoningEffort` 同款:闭集载体就是 lane 本身,不在集里 = 拨盘的选择
|
|
473
|
+
* 在座位 lane 上没有位置可放(web [C131]① 记账的九键无载体形)。 */
|
|
474
|
+
scenario?: string;
|
|
454
475
|
}
|
|
455
476
|
/** `uploadAttachment` 入参(REF-CC-074:此前是导出方法签名里的 3 成员内联匿名形,直接命中 B4)。 */
|
|
456
477
|
export interface AttachmentUploadRequest {
|
|
@@ -665,9 +686,9 @@ export declare const SEAT_STORE_PROPS: readonly ["sessionsStateStore", "focusedS
|
|
|
665
686
|
/** 事件式(main→renderer push)的 verb —— SPEC 里 `kind: "event"` 的那一撮,门里逐元素对账。 */
|
|
666
687
|
export declare const SEAT_EVENT_METHOD_NAMES: readonly ["onEvent", "onToolPermissionRequest"];
|
|
667
688
|
export declare const LOCAL_SESSION_EVENT_KEYS: readonly ["type", "sessionId", "message", "messages", "error", "errorCategory", "code", "request", "data", "sources", "permissionMode", "session", "userMessageUuid", "hasPreClearSession", "requestId", "outcome", "chrome"];
|
|
668
|
-
export declare const TOOL_PERMISSION_REQUEST_KEYS: readonly ["requestId", "sessionId", "toolName", "toolCallId", "input", "message", "toctouBinding", "createdAtMs"];
|
|
689
|
+
export declare const TOOL_PERMISSION_REQUEST_KEYS: readonly ["requestId", "sessionId", "toolName", "toolCallId", "input", "message", "toctouBinding", "createdAtMs", "governanceForced", "delegation"];
|
|
669
690
|
export declare const LOCAL_SESSION_RECORD_KEYS: readonly ["sessionId", "engineSessionId", "model", "title", "isRunning", "createdAt", "lastActivityAt", "queuedMessages", "parked"];
|
|
670
|
-
export declare const SEND_MESSAGE_REQUEST_KEYS: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "settings"];
|
|
691
|
+
export declare const SEND_MESSAGE_REQUEST_KEYS: readonly ["sessionId", "text", "model", "userMessageUuid", "permissionMode", "attachmentIds", "reasoningEffort", "retainBackgroundProcesses", "settings", "scenario"];
|
|
671
692
|
export declare const TOOL_PERMISSION_DECISION_KEYS: readonly ["sessionId", "requestId", "decision", "answer", "updatedInput", "remember"];
|
|
672
693
|
export declare const START_SESSION_OPTION_KEYS: readonly ["model", "title", "cwd", "excludeTools"];
|
|
673
694
|
/**
|
|
@@ -707,6 +728,12 @@ export declare const SEAT_VALIDATOR_KEY_COVERAGE: {
|
|
|
707
728
|
readonly unchecked: readonly [{
|
|
708
729
|
readonly key: "input";
|
|
709
730
|
readonly why: "UNTRUSTED service-redacted 工具参数 / 问题载荷:形状由工具自己定(CC request-args 姿态),渲染端只读不回喂;缺席/畸形的渲染义务写在字段注释里。";
|
|
731
|
+
}, {
|
|
732
|
+
readonly key: "governanceForced";
|
|
733
|
+
readonly why: "展示增强位,权威门在 hitl wire 卡口(条件 stamp,false 不上 wire);座位门再裁一次=配对机制前提不共享的雷,且拒整条 request 会为一个徽标键把安全 ask 丢给引擎 TTL deny。消费端按 `=== true` 读,其余一律当缺席。";
|
|
734
|
+
}, {
|
|
735
|
+
readonly key: "delegation";
|
|
736
|
+
readonly why: "展示增强位,权威结构门在 hitl wire 卡口(结构读+仅子代 ask 在场,坏形降缺席);座位门同款理由不设第二判官。消费端坏形降缺席,绝不拒行。";
|
|
710
737
|
}];
|
|
711
738
|
};
|
|
712
739
|
readonly LocalSessionEvent: {
|
package/dist/seatContract.js
CHANGED
|
@@ -657,6 +657,10 @@ export const TOOL_PERMISSION_REQUEST_KEYS = [
|
|
|
657
657
|
"message",
|
|
658
658
|
"toctouBinding",
|
|
659
659
|
"createdAtMs",
|
|
660
|
+
// [C130] 补键(2026-08-08):治理徽标+委派行的座位载体——desktop 座位 lane 此前无键可透传,
|
|
661
|
+
// 「治理徽标可开工」只在浏览器 lane 成立(半场口径,[C130] 修正)。
|
|
662
|
+
"governanceForced",
|
|
663
|
+
"delegation",
|
|
660
664
|
];
|
|
661
665
|
export const LOCAL_SESSION_RECORD_KEYS = [
|
|
662
666
|
"sessionId",
|
|
@@ -681,6 +685,8 @@ export const SEND_MESSAGE_REQUEST_KEYS = [
|
|
|
681
685
|
"reasoningEffort",
|
|
682
686
|
"retainBackgroundProcesses",
|
|
683
687
|
"settings",
|
|
688
|
+
// [C131] 补载体(2026-08-08):scenario 拨盘的座位 lane 席位(同上结构性缺席形)。
|
|
689
|
+
"scenario",
|
|
684
690
|
];
|
|
685
691
|
export const TOOL_PERMISSION_DECISION_KEYS = [
|
|
686
692
|
"sessionId",
|
|
@@ -730,6 +736,14 @@ export const SEAT_VALIDATOR_KEY_COVERAGE = {
|
|
|
730
736
|
key: "input",
|
|
731
737
|
why: "UNTRUSTED service-redacted 工具参数 / 问题载荷:形状由工具自己定(CC request-args 姿态),渲染端只读不回喂;缺席/畸形的渲染义务写在字段注释里。",
|
|
732
738
|
},
|
|
739
|
+
{
|
|
740
|
+
key: "governanceForced",
|
|
741
|
+
why: "展示增强位,权威门在 hitl wire 卡口(条件 stamp,false 不上 wire);座位门再裁一次=配对机制前提不共享的雷,且拒整条 request 会为一个徽标键把安全 ask 丢给引擎 TTL deny。消费端按 `=== true` 读,其余一律当缺席。",
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
key: "delegation",
|
|
745
|
+
why: "展示增强位,权威结构门在 hitl wire 卡口(结构读+仅子代 ask 在场,坏形降缺席);座位门同款理由不设第二判官。消费端坏形降缺席,绝不拒行。",
|
|
746
|
+
},
|
|
733
747
|
],
|
|
734
748
|
},
|
|
735
749
|
LocalSessionEvent: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Client-side session runtime shared by every sema human client (TUI / web / desktop): sema wire frames (AgentEvent) -> CC session vocabulary (SDKMessage) with dual-plane output (transcript/chrome), deterministic transcript ids, lane discipline as a type, and the notification/dedup ledgers. Every CC-skin shape is collected here so the wire itself stays neutral. Blackboard [1832] design axioms; [1651]/[1652]/[1653] signed seam design. Renamed from @sema-agent/wire-cc-adapter (0.1.x).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|