@agents24/react 0.2.23 → 0.2.25
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/compatibility.json +5 -5
- package/dist/hitl-resolution.d.ts +10 -0
- package/dist/hitl-submission.d.ts +36 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +389 -127
- package/dist/index.js.map +1 -1
- package/dist/operation-ownership.d.ts +1 -0
- package/dist/provider.d.ts +9 -1
- package/dist/use-agent-chat-hitl-submissions.d.ts +20 -0
- package/dist/use-agent-chat.d.ts +3 -1
- package/package.json +2 -2
package/compatibility.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"contractHash": "
|
|
2
|
+
"contractHash": "6d6ceb78b4285f987a5635b4d4d0b407732bf5e61abd1aca1369a97a7d6336e6",
|
|
3
3
|
"contractVersion": "0.3.0",
|
|
4
4
|
"corpus": "conformance/v1/corpus.json",
|
|
5
5
|
"generatedBy": "@agents24/sdk-contract",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"reactDom": ">=19 <20"
|
|
16
16
|
},
|
|
17
17
|
"@agents24/client": {
|
|
18
|
-
"contract": "
|
|
18
|
+
"contract": "6d6ceb78b4285f987a5635b4d4d0b407732bf5e61abd1aca1369a97a7d6336e6",
|
|
19
19
|
"runtime": "run-stream.v3"
|
|
20
20
|
},
|
|
21
21
|
"@agents24/node": {
|
|
22
|
-
"contract": "
|
|
22
|
+
"contract": "6d6ceb78b4285f987a5635b4d4d0b407732bf5e61abd1aca1369a97a7d6336e6",
|
|
23
23
|
"node": "^22.0.0 || ^24.0.0"
|
|
24
24
|
},
|
|
25
25
|
"@agents24/react": {
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"react": ">=19 <20"
|
|
28
28
|
},
|
|
29
29
|
"@talmudpedia/runtime-sdk": {
|
|
30
|
-
"contract": "
|
|
30
|
+
"contract": "6d6ceb78b4285f987a5635b4d4d0b407732bf5e61abd1aca1369a97a7d6336e6",
|
|
31
31
|
"protocolOwner": "@agents24/client"
|
|
32
32
|
},
|
|
33
33
|
"agents24": {
|
|
34
|
-
"contract": "
|
|
34
|
+
"contract": "6d6ceb78b4285f987a5635b4d4d0b407732bf5e61abd1aca1369a97a7d6336e6",
|
|
35
35
|
"python": ">=3.10"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HitlResumeResult } from "@agents24/client";
|
|
2
|
+
import type { ChatHitlPart, ChatMessage, ChatPart } from "./model";
|
|
3
|
+
export type HitlDecisionReceipt = Pick<HitlResumeResult, "run_id" | "thread_id" | "interrupt_id" | "resolution"> & {
|
|
4
|
+
run_status?: string;
|
|
5
|
+
};
|
|
6
|
+
/** Apply a durable receipt without moving the delivery cursor or changing run execution. */
|
|
7
|
+
export declare function applyHitlResolution<T extends Pick<ChatMessage, "runId" | "parts">>(messages: T[], receipt: HitlDecisionReceipt): T[];
|
|
8
|
+
export declare function findHitlResolution(messages: readonly ChatMessage[], runId: string, interruptId: string): ChatHitlPart | undefined;
|
|
9
|
+
/** Terminal decisions are monotonic even when delivery replays an older pending snapshot. */
|
|
10
|
+
export declare function preserveResolvedHitlParts(current: readonly ChatPart[], incoming: ChatPart[]): ChatPart[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AbortSignalLike, HitlResponse, HitlResumeResult } from "@agents24/client";
|
|
2
|
+
import type { HitlDecisionReceipt } from "./hitl-resolution";
|
|
3
|
+
import type { AbortControllerFactory } from "./lifecycle";
|
|
4
|
+
export type HitlSubmissionOptions = {
|
|
5
|
+
/** Host-owned prerequisite. Runs inside the submission lock and decision deadline. */
|
|
6
|
+
prepare?: (input: {
|
|
7
|
+
signal: AbortSignalLike;
|
|
8
|
+
}) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export type HitlSubmissionState = {
|
|
11
|
+
action: string;
|
|
12
|
+
status: "submitting" | "checking" | "uncertain" | "accepted" | "error";
|
|
13
|
+
error?: string | null;
|
|
14
|
+
retry?: () => Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
/** A separate deadline for decisions and reconciliation, never for continuation streams. */
|
|
17
|
+
export declare function withHitlDeadline<T>(factory: AbortControllerFactory, work: (signal: AbortSignalLike) => Promise<T>, ms?: number): Promise<T>;
|
|
18
|
+
export declare function isDefinitiveHitlRejection(error: unknown): boolean;
|
|
19
|
+
/** One immutable decision; retry is the very same operation and idempotency identity. */
|
|
20
|
+
export declare function createHitlSubmission(options: {
|
|
21
|
+
response: HitlResponse;
|
|
22
|
+
idempotencyKey: string;
|
|
23
|
+
prepare?: HitlSubmissionOptions["prepare"];
|
|
24
|
+
createAbortController: AbortControllerFactory;
|
|
25
|
+
isCurrent(): boolean;
|
|
26
|
+
send(response: HitlResponse, key: string, signal: AbortSignalLike): Promise<HitlResumeResult>;
|
|
27
|
+
reconcile(signal: AbortSignalLike): Promise<HitlDecisionReceipt | null>;
|
|
28
|
+
accept(receipt: HitlDecisionReceipt): void;
|
|
29
|
+
changed(state: HitlSubmissionState): void;
|
|
30
|
+
now?: () => number;
|
|
31
|
+
timing?: (stage: "preparation" | "acknowledgement", durationMs: number) => void;
|
|
32
|
+
}): {
|
|
33
|
+
retry: () => Promise<void>;
|
|
34
|
+
readonly failed: boolean;
|
|
35
|
+
readonly uncertain: boolean;
|
|
36
|
+
};
|
package/dist/index.d.ts
CHANGED