@sema-agent/client-core 0.10.0 → 0.11.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.
|
@@ -47,7 +47,9 @@ export interface ApprovalsFeedClientLike {
|
|
|
47
47
|
approvals: {
|
|
48
48
|
list(opts?: {
|
|
49
49
|
signal?: AbortSignal;
|
|
50
|
-
}): Promise<
|
|
50
|
+
}): Promise<{
|
|
51
|
+
pending: PendingCheckpoint[];
|
|
52
|
+
}>;
|
|
51
53
|
stream?(opts?: {
|
|
52
54
|
signal?: AbortSignal;
|
|
53
55
|
}): AsyncGenerator<{
|
|
@@ -46,7 +46,7 @@ export function startApprovalsFeed(client, onSnapshot, opts) {
|
|
|
46
46
|
return;
|
|
47
47
|
let rows;
|
|
48
48
|
try {
|
|
49
|
-
rows = await client.approvals.list({ signal: ac.signal });
|
|
49
|
+
rows = (await client.approvals.list({ signal: ac.signal })).pending;
|
|
50
50
|
}
|
|
51
51
|
catch (e) {
|
|
52
52
|
stats.listErrors++;
|
package/dist/hitl/askGateWire.js
CHANGED
|
@@ -165,7 +165,7 @@ async function surfaceGateAndDecide(deps, taskId, askArgsByCall, signal) {
|
|
|
165
165
|
// pending 行 = 问题 payload 的权威源 + D-1 绑定的唯一 surface(PendingCheckpoint.input)。
|
|
166
166
|
let pending;
|
|
167
167
|
try {
|
|
168
|
-
const rows = await deps.client.approvals.list(signal ? { signal } : undefined);
|
|
168
|
+
const rows = (await deps.client.approvals.list(signal ? { signal } : undefined)).pending;
|
|
169
169
|
pending =
|
|
170
170
|
rows.find(r => r.taskId === taskId && isAskTool(r.toolName ?? undefined)) ??
|
|
171
171
|
rows.find(r => r.taskId === taskId);
|
|
@@ -83,10 +83,13 @@ export type HitlCanUseToolFn<D extends HitlPermissionDecisionLike = HitlPermissi
|
|
|
83
83
|
name: string;
|
|
84
84
|
}, input: Record<string, unknown>, toolUseContext: never, assistantMessage: never, toolUseID: string, forceDecision?: D) => Promise<D>;
|
|
85
85
|
export interface ApprovalsResourceLike {
|
|
86
|
-
/** GET /v1/approvals — the rich decide-ready queue (approvals.ts:45). NEVER carries a capability token.
|
|
86
|
+
/** GET /v1/approvals — the rich decide-ready queue (approvals.ts:45). NEVER carries a capability token.
|
|
87
|
+
* SDK ≥0.1.0([1908] 信封归一):wire 信封原样 `{ pending }`。 */
|
|
87
88
|
list(opts?: {
|
|
88
89
|
signal?: AbortSignal;
|
|
89
|
-
}): Promise<
|
|
90
|
+
}): Promise<{
|
|
91
|
+
pending: PendingCheckpoint[];
|
|
92
|
+
}>;
|
|
90
93
|
/** POST /v1/approvals/:sessionId/decide — resolve THAT checkpoint; the resumed run continues its stream
|
|
91
94
|
* (approvals.ts:52). NOT a submit → no retry (a decide must never double-act). */
|
|
92
95
|
decide(sessionId: string, decision: ApprovalDecision, opts?: {
|
package/dist/hitl/hitlBridge.js
CHANGED
|
@@ -61,7 +61,7 @@ export class HitlBridge {
|
|
|
61
61
|
* the queue is empty (e.g. resolved/expired under the human → the caller must refetch + re-present).
|
|
62
62
|
*/
|
|
63
63
|
async findPending(toolUseID, opts) {
|
|
64
|
-
const pending = await this.client.approvals.list(opts);
|
|
64
|
+
const { pending } = await this.client.approvals.list(opts);
|
|
65
65
|
if (pending.length === 0)
|
|
66
66
|
return null;
|
|
67
67
|
if (toolUseID) {
|
|
@@ -91,7 +91,7 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
|
|
|
91
91
|
// pending 行 = gate 的权威源 + D-1 绑定 surface(与 ask 桥同姿势)。
|
|
92
92
|
let pending;
|
|
93
93
|
try {
|
|
94
|
-
const rows = await deps.client.approvals.list(signal ? { signal } : undefined);
|
|
94
|
+
const rows = (await deps.client.approvals.list(signal ? { signal } : undefined)).pending;
|
|
95
95
|
pending =
|
|
96
96
|
rows.find(r => r.taskId === taskId && typeof r.toolName === 'string' && toolNameIsFsWrite(r.toolName)) ??
|
|
97
97
|
rows.find(r => r.taskId === taskId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.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",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@sema-agent/agent-types": ">=0.2.0",
|
|
24
|
-
"@sema-agent/sdk": ">=0.0
|
|
24
|
+
"@sema-agent/sdk": ">=0.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@sema-agent/agent-types": "^0.2.0",
|
|
28
|
-
"@sema-agent/sdk": "^0.0
|
|
28
|
+
"@sema-agent/sdk": "^0.1.0",
|
|
29
29
|
"esbuild": "^0.27.4",
|
|
30
30
|
"typescript": "^6.0.2"
|
|
31
31
|
}
|