ionbase-ui 0.73.0 → 0.75.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAOnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAOnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAO/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQlD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAO3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAS5D,OAAO,EA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pB;;;;;GAKG;AACH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,gBAAgB,CAAC;AAWxB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { type AgentRunEvent, type AgentRunRecording, type AgentRunState, type ReplayAgentRunOptions } from './agent-run.js';
2
+ export interface UseAgentRunOptions {
3
+ /**
4
+ * Stop the real run. Resolve once it has stopped; the hook then records the
5
+ * run as stopped (unless your producer already sent `run-stopped`). Throw if
6
+ * it could not be stopped, and the stop control comes back.
7
+ *
8
+ * Not needed for a replay — stopping a replay cancels it.
9
+ */
10
+ onStop?: () => void | Promise<void>;
11
+ /**
12
+ * Send an approval decision. Resolve — optionally with the resolution text,
13
+ * e.g. "Approved by Ada at 14:02" — once it is recorded. Throw if it did not
14
+ * arrive: the approval stays pending and says so, because a decision the
15
+ * server never received must not look made.
16
+ *
17
+ * Without it the approval renders without buttons, as a record.
18
+ */
19
+ onDecision?: (stepId: string, decision: 'approved' | 'rejected') => void | string | Promise<void | string>;
20
+ }
21
+ /**
22
+ * useAgentRun — run state for AgentActivity, ApprovalGate, StreamingText and
23
+ * AgentStop, from events.
24
+ *
25
+ * Feed it events with `dispatch` from however the run reports progress, or
26
+ * play a recording with `replay`. It hands back the state and props ready to
27
+ * spread, and applies the AgentRun and HumanApproval patterns' rules on the
28
+ * way: one active step, a stopped run keeps what it did, an unanswered
29
+ * approval is not a yes, a failed decision is not a decision.
30
+ */
31
+ export declare function useAgentRun(options?: UseAgentRunOptions): {
32
+ state: AgentRunState;
33
+ dispatch: (event: AgentRunEvent) => void;
34
+ reset: () => void;
35
+ replay: (recording: AgentRunRecording, replayOptions?: ReplayAgentRunOptions) => void;
36
+ /** Steps that began — what AgentActivity lists. */
37
+ log: import("./agent-run.js").AgentRunStep[];
38
+ hasEnded: boolean;
39
+ /** Show AgentStop while this is true. */
40
+ isRunning: boolean;
41
+ stop: () => Promise<void>;
42
+ approve: () => undefined;
43
+ reject: () => undefined;
44
+ /** Spread onto AgentStop. */
45
+ stopProps: {
46
+ onStop: () => undefined;
47
+ isStopping: boolean;
48
+ };
49
+ /** Spread onto StreamingText. */
50
+ outputProps: {
51
+ isStreaming: boolean;
52
+ children: string;
53
+ };
54
+ /** Spread onto the ApprovalGate for `state.approval.stepId`, with your title. */
55
+ approvalProps: {
56
+ onApprove?: (() => undefined) | undefined;
57
+ onReject?: (() => undefined) | undefined;
58
+ status: "pending" | "approved" | "rejected" | "expired";
59
+ isSubmitting: boolean;
60
+ resolution: string | undefined;
61
+ } | null;
62
+ };
63
+ export type UseAgentRunResult = ReturnType<typeof useAgentRun>;
64
+ export type { AgentRunState };
65
+ //# sourceMappingURL=use-agent-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-agent-run.d.ts","sourceRoot":"","sources":["../../src/components/use-agent-run.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,CACX,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,UAAU,GAAG,UAAU,KAC9B,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CAC7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB;;cAkFhC,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI;;wBA/D1C,iBAAiB,kBAAkB,qBAAqB;IAkElE,mDAAmD;;;IAGnD,yCAAyC;;;;;IAKzC,6BAA6B;;;;;IAE7B,iCAAiC;;;;;IAKjC,iFAAiF;;;;;;;;EAsBtF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,127 @@
1
+ 'use client';
2
+ import { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
3
+ import { agentRunHasEnded, agentRunLog, agentRunReducer, initialAgentRunState, replayAgentRun, } from './agent-run.js';
4
+ /**
5
+ * useAgentRun — run state for AgentActivity, ApprovalGate, StreamingText and
6
+ * AgentStop, from events.
7
+ *
8
+ * Feed it events with `dispatch` from however the run reports progress, or
9
+ * play a recording with `replay`. It hands back the state and props ready to
10
+ * spread, and applies the AgentRun and HumanApproval patterns' rules on the
11
+ * way: one active step, a stopped run keeps what it did, an unanswered
12
+ * approval is not a yes, a failed decision is not a decision.
13
+ */
14
+ export function useAgentRun(options = {}) {
15
+ const [state, dispatch] = useReducer(agentRunReducer, initialAgentRunState);
16
+ // Async handlers read the latest state and options, not the render's.
17
+ const stateRef = useRef(state);
18
+ stateRef.current = state;
19
+ const optionsRef = useRef(options);
20
+ optionsRef.current = options;
21
+ const cancelReplay = useRef(null);
22
+ useEffect(() => () => cancelReplay.current?.(), []);
23
+ const reset = useCallback(() => {
24
+ cancelReplay.current?.();
25
+ cancelReplay.current = null;
26
+ dispatch({ type: 'reset' });
27
+ }, []);
28
+ const replay = useCallback((recording, replayOptions) => {
29
+ reset();
30
+ const cancel = replayAgentRun(recording, dispatch, replayOptions);
31
+ cancelReplay.current = () => {
32
+ cancel();
33
+ cancelReplay.current = null;
34
+ };
35
+ }, [reset]);
36
+ const stop = useCallback(async () => {
37
+ const s = stateRef.current;
38
+ if (agentRunHasEnded(s) || s.isStopping || s.phase === 'idle')
39
+ return;
40
+ dispatch({ type: 'stop-requested' });
41
+ if (cancelReplay.current) {
42
+ cancelReplay.current();
43
+ dispatch({ type: 'run-stopped' });
44
+ return;
45
+ }
46
+ try {
47
+ await optionsRef.current.onStop?.();
48
+ }
49
+ catch {
50
+ dispatch({ type: 'stop-failed' });
51
+ return;
52
+ }
53
+ dispatch({ type: 'run-stopped' });
54
+ }, []);
55
+ const decide = useCallback(async (decision) => {
56
+ const approval = stateRef.current.approval;
57
+ const send = optionsRef.current.onDecision;
58
+ if (!send || !approval || approval.status !== 'pending')
59
+ return;
60
+ if (approval.isSubmitting)
61
+ return;
62
+ const id = approval.stepId;
63
+ dispatch({ type: 'decision-submitted', id });
64
+ try {
65
+ const resolution = await send(id, decision);
66
+ dispatch({
67
+ type: 'approval-resolved',
68
+ id,
69
+ decision,
70
+ resolution: typeof resolution === 'string' ? resolution : undefined,
71
+ });
72
+ }
73
+ catch (e) {
74
+ dispatch({
75
+ type: 'decision-failed',
76
+ id,
77
+ error: e instanceof Error ? e.message : String(e),
78
+ });
79
+ }
80
+ }, []);
81
+ const approve = useCallback(() => void decide('approved'), [decide]);
82
+ const reject = useCallback(() => void decide('rejected'), [decide]);
83
+ const onStop = useCallback(() => void stop(), [stop]);
84
+ const hasEnded = agentRunHasEnded(state);
85
+ const interactive = options.onDecision !== undefined;
86
+ return useMemo(() => ({
87
+ state,
88
+ dispatch: dispatch,
89
+ reset,
90
+ replay,
91
+ /** Steps that began — what AgentActivity lists. */
92
+ log: agentRunLog(state),
93
+ hasEnded,
94
+ /** Show AgentStop while this is true. */
95
+ isRunning: state.phase === 'running' || state.phase === 'awaiting',
96
+ stop,
97
+ approve,
98
+ reject,
99
+ /** Spread onto AgentStop. */
100
+ stopProps: { onStop, isStopping: state.isStopping },
101
+ /** Spread onto StreamingText. */
102
+ outputProps: {
103
+ isStreaming: state.isStreaming,
104
+ children: state.output,
105
+ },
106
+ /** Spread onto the ApprovalGate for `state.approval.stepId`, with your title. */
107
+ approvalProps: state.approval && {
108
+ status: state.approval.status,
109
+ isSubmitting: state.approval.isSubmitting,
110
+ resolution: state.approval.resolution,
111
+ ...(interactive && state.approval.status === 'pending'
112
+ ? { onApprove: approve, onReject: reject }
113
+ : {}),
114
+ },
115
+ }), [
116
+ state,
117
+ reset,
118
+ replay,
119
+ hasEnded,
120
+ stop,
121
+ approve,
122
+ reject,
123
+ onStop,
124
+ interactive,
125
+ ]);
126
+ }
127
+ //# sourceMappingURL=use-agent-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-agent-run.js","sourceRoot":"","sources":["../../src/components/use-agent-run.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,cAAc,GAKf,MAAM,gBAAgB,CAAC;AAyBxB;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,UAA8B,EAAE;IAC1D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC;IAE5E,sEAAsE;IACtE,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAC7B,MAAM,YAAY,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IAEvD,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEpD,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;QACzB,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;QAC5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9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