@sema-agent/client-core 0.11.2 → 0.11.4

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.
Binary file
@@ -88,6 +88,12 @@ export interface ToolApprovalFrame {
88
88
  type: 'tool_approval' | 'tool_approval_complete';
89
89
  approvalId: string;
90
90
  toolName?: string;
91
+ /** server ≥1.307([1940] 兑现 [1939],ADDITIVE):引擎 tool-call id——与 assistant 消息
92
+ * `tool_use` block 的 `call_…` 同一枚。**审批卡锚这个**,不锚 approvalId(现铸 uuidv7,流上
93
+ * 再无人提起 ⇒ 按它键的卡永不被回收)也不锚「最近一次 tool_start」(审批帧先于 tool_start
94
+ * 到达,契约 §4a-bis 实测 4020ms vs 4142ms)。`tool_approval_complete` 上刻意不带(免多锚
95
+ * 歧义)。旧 server 缺席 ⇒ 消费方保留 approvalId 兜底但必须能被真 id 收敛。 */
96
+ toolCallId?: string;
91
97
  message?: string;
92
98
  args?: unknown;
93
99
  argsOmitted?: boolean;
@@ -102,6 +108,12 @@ export interface ToolApprovalFrame {
102
108
  /** core 1.378 RB-39②:展示身份(UNTRUSTED-for-display,server redact 后上帧)——徽章名一手源。 */
103
109
  sourceAgentName?: string;
104
110
  }
111
+ /**
112
+ * 本地值拷贝的**运行时键集镜像**([1950]② 建议形):对账测试拿它与 SDK 0.1.6+ 的同源锚
113
+ * `TOOL_APPROVAL_FRAME_KEYS` 比对——SDK additive 增键时对账当天红,不再人肉追平。
114
+ * 下面两个类型钉保证镜像与 interface 本身不可能漂移(少键/多键都是编译错)。
115
+ */
116
+ export declare const TOOL_APPROVAL_FRAME_KEYS_MIRROR: readonly ["type", "approvalId", "toolCallId", "toolName", "sourceTaskId", "fromSubagent", "sourceAgentName", "message", "args", "argsOmitted", "outcome"];
105
117
  /** 子代帧判别:显式键 fromSubagent(core 1.378 RB-39②)优先;缺席退 sourceTaskId 在场性权宜式
106
118
  * (server 1.258 [1549]①3,旧代际兼容)。 */
107
119
  export declare function isFromSubagent(frame: ToolApprovalFrame): boolean;
@@ -158,6 +158,26 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
158
158
  }
159
159
  }
160
160
  }
161
+ /**
162
+ * 本地值拷贝的**运行时键集镜像**([1950]② 建议形):对账测试拿它与 SDK 0.1.6+ 的同源锚
163
+ * `TOOL_APPROVAL_FRAME_KEYS` 比对——SDK additive 增键时对账当天红,不再人肉追平。
164
+ * 下面两个类型钉保证镜像与 interface 本身不可能漂移(少键/多键都是编译错)。
165
+ */
166
+ export const TOOL_APPROVAL_FRAME_KEYS_MIRROR = [
167
+ 'type',
168
+ 'approvalId',
169
+ 'toolCallId',
170
+ 'toolName',
171
+ 'sourceTaskId',
172
+ 'fromSubagent',
173
+ 'sourceAgentName',
174
+ 'message',
175
+ 'args',
176
+ 'argsOmitted',
177
+ 'outcome',
178
+ ];
179
+ const _mirrorPin = [true, true];
180
+ void _mirrorPin;
161
181
  /** 子代帧判别:显式键 fromSubagent(core 1.378 RB-39②)优先;缺席退 sourceTaskId 在场性权宜式
162
182
  * (server 1.258 [1549]①3,旧代际兼容)。 */
163
183
  export function isFromSubagent(frame) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/client-core",
3
- "version": "0.11.2",
3
+ "version": "0.11.4",
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",
@@ -14,7 +14,7 @@
14
14
  "sideEffects": false,
15
15
  "scripts": {
16
16
  "build": "tsc -p tsconfig.json",
17
- "test": "node scripts/run-client-core-pure-test.mjs && node scripts/run-client-core-portability-test.mjs && node scripts/run-client-core-diff-test.mjs && node scripts/run-print-bash-iserror-test.mjs"
17
+ "test": "node scripts/run-client-core-pure-test.mjs && node scripts/run-client-core-portability-test.mjs && node scripts/run-client-core-diff-test.mjs && node scripts/run-print-bash-iserror-test.mjs && node scripts/run-approval-frame-keys-test.mjs"
18
18
  },
19
19
  "dependencies": {
20
20
  "diff": "^9.0.0"
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@sema-agent/agent-types": "^0.2.0",
28
- "@sema-agent/sdk": "^0.1.0",
28
+ "@sema-agent/sdk": "^0.1.7",
29
29
  "esbuild": "^0.27.4",
30
30
  "typescript": "^6.0.2"
31
31
  }