@opengeni/react 3.7.0-canary.0 → 3.7.0-canary.1
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/dist/artifacts.js +24 -5
- package/dist/artifacts.js.map +1 -1
- package/dist/{browser-viewer-E5DDEFQ4.js → browser-viewer-NTD6UIPR.js} +3 -3
- package/dist/{chunk-W2RGYBCV.js → chunk-24M4YBCL.js} +4 -4
- package/dist/{chunk-DOK4KZF2.js → chunk-5IXTJTK3.js} +1322 -392
- package/dist/chunk-5IXTJTK3.js.map +1 -0
- package/dist/chunk-5PQJOCX5.js +902 -0
- package/dist/chunk-5PQJOCX5.js.map +1 -0
- package/dist/{chunk-R55HFTT3.js → chunk-INGB2N5R.js} +4305 -4019
- package/dist/chunk-INGB2N5R.js.map +1 -0
- package/dist/{chunk-FJBOU2TH.js → chunk-MOWYEBCQ.js} +1728 -12
- package/dist/chunk-MOWYEBCQ.js.map +1 -0
- package/dist/chunk-PAJU5KKL.js +331 -0
- package/dist/chunk-PAJU5KKL.js.map +1 -0
- package/dist/{chunk-VTOREEXF.js → chunk-PLYRL5ER.js} +24 -2
- package/dist/{chunk-VTOREEXF.js.map → chunk-PLYRL5ER.js.map} +1 -1
- package/dist/{chunk-YVCHAQZY.js → chunk-ZFOFY5ST.js} +27 -349
- package/dist/chunk-ZFOFY5ST.js.map +1 -0
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +3 -2
- package/dist/components/session-chrome.d.ts +37 -4
- package/dist/components/session-commands-panel.d.ts +6 -0
- package/dist/components/session-conversation.d.ts +14 -0
- package/dist/components/timeline-anchor.d.ts +21 -0
- package/dist/composer.js +2 -3
- package/dist/conversation-timeline.d.ts +5 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +716 -914
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +2 -2
- package/dist/lib/format.d.ts +5 -0
- package/dist/machines.js +3 -2
- package/dist/session-ui.d.ts +3 -0
- package/dist/session-ui.js +14 -4
- package/dist/session.js +19 -19
- package/dist/timeline/types.d.ts +3 -1
- package/package.json +2 -2
- package/src/components/artifacts/published-html-artifact-frame.tsx +27 -4
- package/src/components/machine-input-display.ts +6 -0
- package/src/components/message-timeline.tsx +320 -197
- package/src/components/session-chrome.tsx +498 -125
- package/src/components/session-commands-panel.tsx +113 -0
- package/src/components/session-conversation.tsx +141 -0
- package/src/components/timeline-anchor.tsx +91 -0
- package/src/conversation-timeline.ts +83 -0
- package/src/hooks/use-session-background-commands.ts +21 -10
- package/src/hooks/use-session-events.ts +36 -14
- package/src/hooks/use-session.ts +23 -2
- package/src/index.ts +4 -0
- package/src/lib/format.ts +32 -0
- package/src/session-ui.ts +3 -0
- package/src/timeline/projection.ts +6 -12
- package/src/timeline/types.ts +4 -0
- package/styles/compiled.css +495 -411
- package/styles/index.css +23 -0
- package/dist/chunk-7EAFGICR.js +0 -302
- package/dist/chunk-7EAFGICR.js.map +0 -1
- package/dist/chunk-C6WDLHBA.js +0 -2590
- package/dist/chunk-C6WDLHBA.js.map +0 -1
- package/dist/chunk-DOK4KZF2.js.map +0 -1
- package/dist/chunk-FJBOU2TH.js.map +0 -1
- package/dist/chunk-R55HFTT3.js.map +0 -1
- package/dist/chunk-YVCHAQZY.js.map +0 -1
- /package/dist/{browser-viewer-E5DDEFQ4.js.map → browser-viewer-NTD6UIPR.js.map} +0 -0
- /package/dist/{chunk-W2RGYBCV.js.map → chunk-24M4YBCL.js.map} +0 -0
package/dist/interaction.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useBrowserSession,
|
|
8
8
|
useBrowserSessions,
|
|
9
9
|
useSiteAuthConnections
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-24M4YBCL.js";
|
|
11
11
|
import {
|
|
12
12
|
ComputerViewer,
|
|
13
13
|
useComputerFrameStream,
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
import "./chunk-4MDLEHXL.js";
|
|
22
22
|
import "./chunk-5YK2ZDIG.js";
|
|
23
23
|
import "./chunk-JVYQRRC4.js";
|
|
24
|
+
import "./chunk-PLYRL5ER.js";
|
|
24
25
|
import "./chunk-KZ73RL76.js";
|
|
25
26
|
import {
|
|
26
27
|
useEmbeddedBrowserInteraction,
|
|
@@ -28,7 +29,6 @@ import {
|
|
|
28
29
|
useEmbeddedInteraction,
|
|
29
30
|
useEmbeddedInterventions
|
|
30
31
|
} from "./chunk-NEXLLTP4.js";
|
|
31
|
-
import "./chunk-VTOREEXF.js";
|
|
32
32
|
import "./chunk-22KP6LR5.js";
|
|
33
33
|
|
|
34
34
|
// src/hooks/use-network-routes.ts
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -48,3 +48,8 @@ export declare function isCreditExhaustion(input: {
|
|
|
48
48
|
* debug surfaces.
|
|
49
49
|
*/
|
|
50
50
|
export declare function humanizeFailureReason(reason: string | null): string | null;
|
|
51
|
+
/** Project failure diagnostics without changing the stored event, including legacy retry wrappers. */
|
|
52
|
+
export declare function presentFailure(payload: Record<string, unknown>): {
|
|
53
|
+
reason: string | null;
|
|
54
|
+
safetyRefusal: boolean;
|
|
55
|
+
};
|
package/dist/machines.js
CHANGED
|
@@ -28,10 +28,11 @@ import {
|
|
|
28
28
|
healthPulses,
|
|
29
29
|
pointsFor,
|
|
30
30
|
useMachines
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZFOFY5ST.js";
|
|
32
|
+
import "./chunk-PAJU5KKL.js";
|
|
33
|
+
import "./chunk-PLYRL5ER.js";
|
|
32
34
|
import "./chunk-KZ73RL76.js";
|
|
33
35
|
import "./chunk-NEXLLTP4.js";
|
|
34
|
-
import "./chunk-VTOREEXF.js";
|
|
35
36
|
import "./chunk-22KP6LR5.js";
|
|
36
37
|
export {
|
|
37
38
|
CONNECTION_STATUS_META,
|
package/dist/session-ui.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export type { UserMessageBodyProps } from "./components/user-message-body.js";
|
|
|
11
11
|
export { BUILT_IN_TURN_SUMMARY_FACET_IDS } from "./timeline/turn-summary.js";
|
|
12
12
|
export type { BuiltInTurnSummaryFacetId, TurnSummaryContext, TurnSummaryFacet, TurnSummaryFacetConfiguration, TurnSummaryFacetResult, TurnSummaryOptions, } from "./timeline/turn-summary.js";
|
|
13
13
|
export { QueueSurface } from "./components/queue-surface.js";
|
|
14
|
+
export { SessionConversation } from "./components/session-conversation.js";
|
|
15
|
+
export type { SessionConversationProps } from "./components/session-conversation.js";
|
|
14
16
|
export type { QueueSurfaceProps } from "./components/queue-surface.js";
|
|
15
17
|
export { SessionChrome, sessionChromeGoalPillExplanation, sessionChromeGoalPillLabel, sessionChromeGoalPillState, } from "./components/session-chrome.js";
|
|
16
18
|
export type { SessionChromeAgentsSignal, SessionChromeProps, SessionChromeSignalId, SessionChromeSignalTone, } from "./components/session-chrome.js";
|
|
19
|
+
export { SessionCommandsPanel } from "./components/session-commands-panel.js";
|
package/dist/session-ui.js
CHANGED
|
@@ -5,21 +5,29 @@ import {
|
|
|
5
5
|
MessageTimeline,
|
|
6
6
|
QueueSurface,
|
|
7
7
|
SessionChrome,
|
|
8
|
+
SessionCommandsPanel,
|
|
9
|
+
SessionConversation,
|
|
8
10
|
TimelineRow,
|
|
9
11
|
UserMessageBody,
|
|
10
12
|
sessionChromeGoalPillExplanation,
|
|
11
13
|
sessionChromeGoalPillLabel,
|
|
12
14
|
sessionChromeGoalPillState,
|
|
13
15
|
userMessageLikelyNeedsDisclosure
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5IXTJTK3.js";
|
|
15
17
|
import "./chunk-W3OUAH6M.js";
|
|
18
|
+
import "./chunk-PAJU5KKL.js";
|
|
16
19
|
import "./chunk-JVYQRRC4.js";
|
|
17
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-INGB2N5R.js";
|
|
21
|
+
import "./chunk-4JFUT22W.js";
|
|
18
22
|
import "./chunk-VZTQ73XT.js";
|
|
19
23
|
import {
|
|
20
24
|
createOlderHistoryLoadReceipt
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-MOWYEBCQ.js";
|
|
26
|
+
import "./chunk-IOLVN74D.js";
|
|
27
|
+
import "./chunk-PLYRL5ER.js";
|
|
28
|
+
import "./chunk-KZ73RL76.js";
|
|
29
|
+
import "./chunk-NEXLLTP4.js";
|
|
30
|
+
import "./chunk-WMGF4Z7X.js";
|
|
23
31
|
import "./chunk-22KP6LR5.js";
|
|
24
32
|
export {
|
|
25
33
|
BUILT_IN_TURN_SUMMARY_FACET_IDS,
|
|
@@ -28,6 +36,8 @@ export {
|
|
|
28
36
|
MessageTimeline,
|
|
29
37
|
QueueSurface,
|
|
30
38
|
SessionChrome,
|
|
39
|
+
SessionCommandsPanel,
|
|
40
|
+
SessionConversation,
|
|
31
41
|
TimelineRow,
|
|
32
42
|
UserMessageBody,
|
|
33
43
|
createOlderHistoryLoadReceipt,
|
package/dist/session.js
CHANGED
|
@@ -2,22 +2,33 @@ import {
|
|
|
2
2
|
approvalsFromRequiresAction,
|
|
3
3
|
createEmbeddedSessionClient,
|
|
4
4
|
isGoalEvent,
|
|
5
|
-
isHumanInputEvent,
|
|
6
5
|
isLineageRefreshEvent,
|
|
7
6
|
isSessionMcpApprovalPolicyEvent,
|
|
8
|
-
isTitleEvent,
|
|
9
|
-
isTurnQueueEvent,
|
|
10
7
|
projectPendingApprovals,
|
|
11
8
|
useFileAttachments,
|
|
12
9
|
useGoal,
|
|
10
|
+
useSessionControl,
|
|
11
|
+
useSessionLineage,
|
|
12
|
+
useSessionMcpApprovalPolicy
|
|
13
|
+
} from "./chunk-5PQJOCX5.js";
|
|
14
|
+
import {
|
|
15
|
+
buildTimeline,
|
|
16
|
+
createOlderHistoryLoadReceipt,
|
|
17
|
+
creditExhaustedFromEvents,
|
|
18
|
+
extractSessionRef,
|
|
19
|
+
groupTimeline,
|
|
20
|
+
humanInputRequestFromEvent,
|
|
21
|
+
isHumanInputEvent,
|
|
22
|
+
isTitleEvent,
|
|
23
|
+
isTurnQueueEvent,
|
|
24
|
+
projectPendingHumanInputRequests,
|
|
25
|
+
sessionStatusFromEvents,
|
|
26
|
+
toolDisplayName,
|
|
13
27
|
useHumanInputRequests,
|
|
14
28
|
useSession,
|
|
15
|
-
useSessionControl,
|
|
16
29
|
useSessionEvents,
|
|
17
|
-
useSessionLineage,
|
|
18
|
-
useSessionMcpApprovalPolicy,
|
|
19
30
|
useTurnQueue
|
|
20
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MOWYEBCQ.js";
|
|
21
32
|
import {
|
|
22
33
|
FILE_ONLY_MESSAGE_TEXT,
|
|
23
34
|
composeSendInput,
|
|
@@ -25,20 +36,9 @@ import {
|
|
|
25
36
|
shouldSubmitOnKey,
|
|
26
37
|
useComposer
|
|
27
38
|
} from "./chunk-IOLVN74D.js";
|
|
39
|
+
import "./chunk-PLYRL5ER.js";
|
|
28
40
|
import "./chunk-KZ73RL76.js";
|
|
29
41
|
import "./chunk-NEXLLTP4.js";
|
|
30
|
-
import {
|
|
31
|
-
buildTimeline,
|
|
32
|
-
createOlderHistoryLoadReceipt,
|
|
33
|
-
creditExhaustedFromEvents,
|
|
34
|
-
extractSessionRef,
|
|
35
|
-
groupTimeline,
|
|
36
|
-
humanInputRequestFromEvent,
|
|
37
|
-
projectPendingHumanInputRequests,
|
|
38
|
-
sessionStatusFromEvents,
|
|
39
|
-
toolDisplayName
|
|
40
|
-
} from "./chunk-FJBOU2TH.js";
|
|
41
|
-
import "./chunk-VTOREEXF.js";
|
|
42
42
|
export {
|
|
43
43
|
FILE_ONLY_MESSAGE_TEXT,
|
|
44
44
|
approvalsFromRequiresAction,
|
package/dist/timeline/types.d.ts
CHANGED
|
@@ -263,6 +263,8 @@ export type NoticeItem = {
|
|
|
263
263
|
id: string;
|
|
264
264
|
tone: "waiting" | "cancelled" | "failed" | "input";
|
|
265
265
|
text: string;
|
|
266
|
+
/** A preserved turn-end outcome, not a claim about current session state. */
|
|
267
|
+
recordedOutcome?: true;
|
|
266
268
|
/** Optional evidence kept inspectable without overwhelming the main rail. */
|
|
267
269
|
details?: {
|
|
268
270
|
label: string;
|
|
@@ -293,7 +295,7 @@ export type ContextCompactionItem = {
|
|
|
293
295
|
};
|
|
294
296
|
export type MachineInputMember = {
|
|
295
297
|
id: string;
|
|
296
|
-
kind: "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "child_terminal_result" | "media_generation_result" | "child_requires_action" | "child_requires_action_resolved" | "child_paused" | "child_waiting_capacity" | "child_progress";
|
|
298
|
+
kind: "scheduled_occurrence" | "goal_continuation" | "background_command_result" | "session_wait_timeout" | "agent_message" | "agent_steer_instruction" | "child_terminal_result" | "media_generation_result" | "child_requires_action" | "child_requires_action_resolved" | "child_paused" | "child_waiting_capacity" | "child_progress";
|
|
297
299
|
classification: "success" | "failure" | "action_required" | "info";
|
|
298
300
|
sourceId: string;
|
|
299
301
|
summary: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/react",
|
|
3
|
-
"version": "3.7.0-canary.
|
|
3
|
+
"version": "3.7.0-canary.1",
|
|
4
4
|
"description": "React hooks and styled components for OpenGeni: live session streaming, chat composer, message timeline, session status, and fleet views — token-themed (CSS variables), dark-first, built on Tailwind v4 + Radix + Motion.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@dnd-kit/utilities": "3.2.2",
|
|
121
121
|
"@fontsource-variable/noto-sans-arabic": "5.2.10",
|
|
122
122
|
"@fontsource-variable/noto-sans-jp": "5.2.10",
|
|
123
|
-
"@opengeni/sdk": "^3.7.0-canary.
|
|
123
|
+
"@opengeni/sdk": "^3.7.0-canary.1",
|
|
124
124
|
"clsx": "^2.1.1",
|
|
125
125
|
"dequal": "2.0.3",
|
|
126
126
|
"lucide-react": "^1.8.0",
|
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
isOpenGeniSiteBridgeConnectMessage,
|
|
8
8
|
isOpenGeniSiteBridgeRequestMessage,
|
|
9
9
|
sanitizeOpenGeniSiteToolCallRequest,
|
|
10
|
+
isSiteHttpRequest,
|
|
11
|
+
serveSiteHttp,
|
|
12
|
+
type SiteHttpRequest,
|
|
10
13
|
type OpenGeniSiteBridgeResponseMessage,
|
|
11
14
|
type OpenGeniSiteToolCatalog,
|
|
12
15
|
} from "@opengeni/sdk/site";
|
|
@@ -38,6 +41,7 @@ export type PublishedHtmlArtifactFrameProps = {
|
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
export type PublishedHtmlArtifactToolBridge = {
|
|
44
|
+
fetch?: (request: SiteHttpRequest, signal: AbortSignal) => Promise<Response>;
|
|
41
45
|
catalog: (options: { signal: AbortSignal }) => Promise<OpenGeniSiteToolCatalog>;
|
|
42
46
|
call: (
|
|
43
47
|
request: ToolGatewayCallRequest,
|
|
@@ -96,13 +100,31 @@ export function PublishedHtmlArtifactFrame(props: PublishedHtmlArtifactFrameProp
|
|
|
96
100
|
const attachToolPort = (data: unknown, ports: readonly MessagePort[]) => {
|
|
97
101
|
const port = openGeniSiteBridgePortFromBootstrap(data, ports);
|
|
98
102
|
if (!port) return;
|
|
99
|
-
requests.
|
|
103
|
+
requests.addPort(port);
|
|
100
104
|
port.addEventListener("message", (portEvent: MessageEvent<unknown>) => {
|
|
101
105
|
const message = portEvent.data;
|
|
102
106
|
if (isOpenGeniSiteBridgeCancelMessage(message)) {
|
|
103
107
|
requests.cancel(port, message.requestId);
|
|
104
108
|
return;
|
|
105
109
|
}
|
|
110
|
+
if (isSiteHttpRequest(message) && portEvent.ports.length === 1) {
|
|
111
|
+
const controller = requests.start(port, message.requestId);
|
|
112
|
+
if (!controller) {
|
|
113
|
+
portEvent.ports[0]!.close();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
void serveSiteHttp(
|
|
117
|
+
message,
|
|
118
|
+
portEvent.ports[0]!,
|
|
119
|
+
async (request, signal) => {
|
|
120
|
+
const fetch = bridgeRef.current?.fetch;
|
|
121
|
+
if (!fetch) throw new Error("This Site host does not support the session SDK");
|
|
122
|
+
return fetch(request, signal);
|
|
123
|
+
},
|
|
124
|
+
controller.signal,
|
|
125
|
+
).finally(() => requests.complete(port, message.requestId, controller));
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
106
128
|
if (!isOpenGeniSiteBridgeRequestMessage(message)) return;
|
|
107
129
|
const controller = requests.start(port, message.requestId);
|
|
108
130
|
if (!controller) {
|
|
@@ -188,9 +210,10 @@ export function PublishedHtmlArtifactFrame(props: PublishedHtmlArtifactFrameProp
|
|
|
188
210
|
export class SiteBridgeRequestRegistry {
|
|
189
211
|
private readonly controllersByPort = new Map<MessagePort, Map<string, AbortController>>();
|
|
190
212
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
213
|
+
addPort(port: MessagePort): void {
|
|
214
|
+
// Several SDK clients may share one document bootstrap. Document teardown,
|
|
215
|
+
// not another client connecting, revokes all of that document's ports.
|
|
216
|
+
if (!this.controllersByPort.has(port)) this.controllersByPort.set(port, new Map());
|
|
194
217
|
}
|
|
195
218
|
|
|
196
219
|
start(port: MessagePort, requestId: string): AbortController | null {
|
|
@@ -3,6 +3,8 @@ import type { MachineInputMember } from "../timeline/types";
|
|
|
3
3
|
export const MACHINE_INPUT_META: Record<MachineInputMember["kind"], string> = {
|
|
4
4
|
scheduled_occurrence: "Scheduled update",
|
|
5
5
|
goal_continuation: "Goal continued",
|
|
6
|
+
background_command_result: "Command result received",
|
|
7
|
+
session_wait_timeout: "Wait ended",
|
|
6
8
|
agent_message: "Agent update",
|
|
7
9
|
agent_steer_instruction: "Agent direction",
|
|
8
10
|
child_terminal_result: "Agent finished",
|
|
@@ -28,6 +30,10 @@ export function machineInputBatchLabel(members: readonly MachineInputMember[]):
|
|
|
28
30
|
const kind = members[0]!.kind;
|
|
29
31
|
const n = members.length;
|
|
30
32
|
switch (kind) {
|
|
33
|
+
case "background_command_result":
|
|
34
|
+
return n === 1 ? "Command result received" : `${n} command results received`;
|
|
35
|
+
case "session_wait_timeout":
|
|
36
|
+
return n === 1 ? "Wait ended" : `${n} waits ended`;
|
|
31
37
|
case "child_terminal_result":
|
|
32
38
|
return n === 1 ? "Agent finished" : `${n} agents finished`;
|
|
33
39
|
case "goal_continuation":
|