@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.
@@ -1,6 +1,7 @@
1
1
  /** A selection generation distinguishes A → B → A from uninterrupted ownership. */
2
2
  export type ChatOperationOwner = {
3
3
  generation: number;
4
+ client?: unknown;
4
5
  threadId: string | null;
5
6
  runId?: string | null;
6
7
  stream?: unknown;
@@ -14,6 +14,10 @@ export type Agents24ReactRuntime = {
14
14
  createId: () => string;
15
15
  storage?: AgentChatStorage;
16
16
  visibility?: VisibilitySource;
17
+ onHitlTiming?: (timing: {
18
+ stage: "preparation" | "acknowledgement" | "attachment" | "first_activity";
19
+ durationMs: number;
20
+ }) => void;
17
21
  };
18
22
  export type Agents24ProviderProps = {
19
23
  children: React.ReactNode;
@@ -22,7 +26,11 @@ export type Agents24ProviderProps = {
22
26
  createId?: () => string;
23
27
  storage?: AgentChatStorage;
24
28
  visibility?: VisibilitySource;
29
+ onHitlTiming?: (timing: {
30
+ stage: "preparation" | "acknowledgement" | "attachment" | "first_activity";
31
+ durationMs: number;
32
+ }) => void;
25
33
  };
26
- export declare function Agents24Provider({ children, client, createAbortController, createId, storage, visibility, }: Agents24ProviderProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function Agents24Provider({ children, client, createAbortController, createId, storage, visibility, onHitlTiming, }: Agents24ProviderProps): import("react/jsx-runtime").JSX.Element;
27
35
  export declare function useAgents24Runtime(): Agents24ReactRuntime;
28
36
  export declare function useAgentClient(): AgentClient;
@@ -0,0 +1,20 @@
1
+ import type { AgentClient, HitlResponse } from "@agents24/client";
2
+ import * as React from "react";
3
+ import type { ChatHitlPart } from "./model";
4
+ import type { AgentChatState } from "./state";
5
+ import type { Agents24ReactRuntime } from "./provider";
6
+ import { type HitlDecisionReceipt } from "./hitl-resolution";
7
+ import { type HitlSubmissionOptions, type HitlSubmissionState } from "./hitl-submission";
8
+ export declare function useAgentChatHitlSubmissions(options: {
9
+ client: AgentClient;
10
+ runtime: Agents24ReactRuntime;
11
+ pageSize: number;
12
+ stateRef: React.MutableRefObject<AgentChatState>;
13
+ selectionGeneration: React.MutableRefObject<number>;
14
+ ownOperation(): () => boolean;
15
+ accept(receipt: HitlDecisionReceipt): void;
16
+ attach(runId: string): void;
17
+ }): {
18
+ resumeHitl: (part: ChatHitlPart, response: HitlResponse, submission?: HitlSubmissionOptions) => Promise<void>;
19
+ getHitlSubmissionState: (part: ChatHitlPart) => HitlSubmissionState | undefined;
20
+ };
@@ -1,3 +1,4 @@
1
+ import type { HitlSubmissionOptions, HitlSubmissionState } from "./hitl-submission";
1
2
  import type { AgentClient, FeedbackReason, HitlResponse, PortableUpload, ThreadMessage, ThreadMessageQueueState } from "@agents24/client";
2
3
  import type { ChatAttachment, ChatHitlPart, ChatMessage, StoredChatThread } from "./model";
3
4
  import { type RetractedMessageDraft } from "./thread-message-queue";
@@ -46,7 +47,8 @@ export type AgentChatController = AgentChatState & {
46
47
  retractPendingMessage(message: ThreadMessage): Promise<RetractedMessageDraft>;
47
48
  resumeQueue(): Promise<void>;
48
49
  steer(text: string): Promise<void>;
49
- resumeHitl(part: ChatHitlPart, response: HitlResponse): Promise<void>;
50
+ resumeHitl(part: ChatHitlPart, response: HitlResponse, options?: HitlSubmissionOptions): Promise<void>;
51
+ getHitlSubmissionState(part: ChatHitlPart): HitlSubmissionState | undefined;
50
52
  setFeedback(message: ChatMessage, input: {
51
53
  rating: "like" | "dislike" | null;
52
54
  reason?: FeedbackReason | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents24/react",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "description": "DOM-free React state and hooks for Agents24 client applications.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,7 +40,7 @@
40
40
  "prepack": "pnpm run build && pnpm run check:boundaries"
41
41
  },
42
42
  "dependencies": {
43
- "@agents24/client": "0.2.18"
43
+ "@agents24/client": "0.2.20"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=19.0.0 <20.0.0"