@opencx/widget-react-headless 5.0.0-beta.0 → 5.0.0-beta.10

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.
Files changed (85) hide show
  1. package/README.md +61 -0
  2. package/dist/index.cjs +20 -20
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +3221 -2572
  5. package/dist/index.js.map +1 -1
  6. package/dist/package.json.d.ts +4 -3
  7. package/dist/src/ComponentRegistry.d.ts.map +1 -1
  8. package/dist/src/ConversationWorkspace.d.ts +61 -0
  9. package/dist/src/ConversationWorkspace.d.ts.map +1 -0
  10. package/dist/src/WidgetProvider.d.ts.map +1 -1
  11. package/dist/src/agent-chat/AgentChatContext.d.ts +28 -2
  12. package/dist/src/agent-chat/AgentChatContext.d.ts.map +1 -1
  13. package/dist/src/agent-chat/agent-chat-stream.d.ts +24 -0
  14. package/dist/src/agent-chat/agent-chat-stream.d.ts.map +1 -1
  15. package/dist/src/agent-chat/agent-turn-sources.d.ts +3 -1
  16. package/dist/src/agent-chat/agent-turn-sources.d.ts.map +1 -1
  17. package/dist/src/agent-chat/apply-presentation.d.ts +5 -0
  18. package/dist/src/agent-chat/apply-presentation.d.ts.map +1 -0
  19. package/dist/src/agent-chat/session-plan.d.ts +10 -0
  20. package/dist/src/agent-chat/session-plan.d.ts.map +1 -0
  21. package/dist/src/agent-chat/useAgentChat.d.ts +37 -11
  22. package/dist/src/agent-chat/useAgentChat.d.ts.map +1 -1
  23. package/dist/src/agent-chat/useConnection.d.ts +39 -0
  24. package/dist/src/agent-chat/useConnection.d.ts.map +1 -0
  25. package/dist/src/hooks/useComposerDraft.d.ts +11 -0
  26. package/dist/src/hooks/useComposerDraft.d.ts.map +1 -0
  27. package/dist/src/hooks/useIsAwaitingBotReply.d.ts.map +1 -1
  28. package/dist/src/hooks/useMessages.d.ts +1 -0
  29. package/dist/src/hooks/useMessages.d.ts.map +1 -1
  30. package/dist/src/hooks/useSessions.d.ts +4 -0
  31. package/dist/src/hooks/useSessions.d.ts.map +1 -1
  32. package/dist/src/hooks/useUploadFiles.d.ts +6 -14
  33. package/dist/src/hooks/useUploadFiles.d.ts.map +1 -1
  34. package/dist/src/hooks/useWidgetRouter.d.ts +1 -1
  35. package/dist/src/index.d.ts +7 -0
  36. package/dist/src/index.d.ts.map +1 -1
  37. package/dist/src/widget-user-identity.d.ts +8 -0
  38. package/dist/src/widget-user-identity.d.ts.map +1 -0
  39. package/package.json +5 -5
  40. package/dist/src/__tests__/WidgetProvider.initialization.spec.d.ts +0 -2
  41. package/dist/src/__tests__/WidgetProvider.initialization.spec.d.ts.map +0 -1
  42. package/dist/src/agent-chat/__tests__/WidgetProvider.agent-chat.spec.d.ts +0 -2
  43. package/dist/src/agent-chat/__tests__/WidgetProvider.agent-chat.spec.d.ts.map +0 -1
  44. package/dist/src/agent-chat/__tests__/agent-chat-queue.spec.d.ts +0 -2
  45. package/dist/src/agent-chat/__tests__/agent-chat-queue.spec.d.ts.map +0 -1
  46. package/dist/src/agent-chat/__tests__/agent-chat-stream.spec.d.ts +0 -2
  47. package/dist/src/agent-chat/__tests__/agent-chat-stream.spec.d.ts.map +0 -1
  48. package/dist/src/agent-chat/__tests__/agent-chat-transport.spec.d.ts +0 -2
  49. package/dist/src/agent-chat/__tests__/agent-chat-transport.spec.d.ts.map +0 -1
  50. package/dist/src/agent-chat/__tests__/agent-turn-sources.spec.d.ts +0 -2
  51. package/dist/src/agent-chat/__tests__/agent-turn-sources.spec.d.ts.map +0 -1
  52. package/dist/src/agent-chat/__tests__/ask-questions.spec.d.ts +0 -2
  53. package/dist/src/agent-chat/__tests__/ask-questions.spec.d.ts.map +0 -1
  54. package/dist/src/agent-chat/__tests__/pending-clarification.spec.d.ts +0 -2
  55. package/dist/src/agent-chat/__tests__/pending-clarification.spec.d.ts.map +0 -1
  56. package/dist/src/agent-chat/__tests__/stop-agent-chat-turn.spec.d.ts +0 -2
  57. package/dist/src/agent-chat/__tests__/stop-agent-chat-turn.spec.d.ts.map +0 -1
  58. package/dist/src/agent-chat/__tests__/use-agent-chat.client-context.spec.d.ts +0 -2
  59. package/dist/src/agent-chat/__tests__/use-agent-chat.client-context.spec.d.ts.map +0 -1
  60. package/dist/src/agent-chat/__tests__/use-agent-chat.drain-order.spec.d.ts +0 -2
  61. package/dist/src/agent-chat/__tests__/use-agent-chat.drain-order.spec.d.ts.map +0 -1
  62. package/dist/src/agent-chat/__tests__/use-agent-chat.failed-turn.spec.d.ts +0 -2
  63. package/dist/src/agent-chat/__tests__/use-agent-chat.failed-turn.spec.d.ts.map +0 -1
  64. package/dist/src/agent-chat/__tests__/use-agent-chat.feature-narrowing.spec.d.ts +0 -2
  65. package/dist/src/agent-chat/__tests__/use-agent-chat.feature-narrowing.spec.d.ts.map +0 -1
  66. package/dist/src/agent-chat/__tests__/use-agent-chat.send-features.spec.d.ts +0 -2
  67. package/dist/src/agent-chat/__tests__/use-agent-chat.send-features.spec.d.ts.map +0 -1
  68. package/dist/src/agent-chat/__tests__/use-agent-chat.steer.spec.d.ts +0 -2
  69. package/dist/src/agent-chat/__tests__/use-agent-chat.steer.spec.d.ts.map +0 -1
  70. package/dist/src/agent-chat/__tests__/use-agent-chat.stop-partial.spec.d.ts +0 -2
  71. package/dist/src/agent-chat/__tests__/use-agent-chat.stop-partial.spec.d.ts.map +0 -1
  72. package/dist/src/agent-chat/__tests__/use-agent-chat.stream-handoff.spec.d.ts +0 -2
  73. package/dist/src/agent-chat/__tests__/use-agent-chat.stream-handoff.spec.d.ts.map +0 -1
  74. package/dist/src/agent-chat/__tests__/use-agent-chat.turn-retention.spec.d.ts +0 -2
  75. package/dist/src/agent-chat/__tests__/use-agent-chat.turn-retention.spec.d.ts.map +0 -1
  76. package/dist/src/agent-chat/__tests__/use-chat-post-finish-data-part.spec.d.ts +0 -2
  77. package/dist/src/agent-chat/__tests__/use-chat-post-finish-data-part.spec.d.ts.map +0 -1
  78. package/dist/src/agent-chat/steer-into-live-turn.d.ts +0 -35
  79. package/dist/src/agent-chat/steer-into-live-turn.d.ts.map +0 -1
  80. package/dist/src/hooks/__tests__/use-display-mode.spec.d.ts +0 -2
  81. package/dist/src/hooks/__tests__/use-display-mode.spec.d.ts.map +0 -1
  82. package/dist/src/hooks/__tests__/use-widget-layout.spec.d.ts +0 -2
  83. package/dist/src/hooks/__tests__/use-widget-layout.spec.d.ts.map +0 -1
  84. package/dist/src/hooks/__tests__/useHostLocation.spec.d.ts +0 -2
  85. package/dist/src/hooks/__tests__/useHostLocation.spec.d.ts.map +0 -1
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=agent-chat-transport.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-chat-transport.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/agent-chat-transport.spec.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=agent-turn-sources.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-turn-sources.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/agent-turn-sources.spec.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ask-questions.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ask-questions.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/ask-questions.spec.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=pending-clarification.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pending-clarification.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/pending-clarification.spec.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=stop-agent-chat-turn.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stop-agent-chat-turn.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/stop-agent-chat-turn.spec.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.client-context.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.client-context.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.client-context.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.drain-order.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.drain-order.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.drain-order.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.failed-turn.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.failed-turn.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.failed-turn.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.feature-narrowing.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.feature-narrowing.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.feature-narrowing.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.send-features.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.send-features.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.send-features.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.steer.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.steer.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.steer.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.stop-partial.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.stop-partial.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.stop-partial.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.stream-handoff.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.stream-handoff.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.stream-handoff.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.turn-retention.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.turn-retention.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.turn-retention.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-chat-post-finish-data-part.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-chat-post-finish-data-part.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-chat-post-finish-data-part.spec.tsx"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- import { UIMessageChunk } from 'ai';
2
- /**
3
- * What the v5 stream endpoint did with a message POSTed while the session
4
- * already had a live turn. Decided by the FIRST chunk of the request's own
5
- * stream:
6
- * - `steered`: the message joined the live turn (`data-turn-steered` is the
7
- * only chunk); the live turn's stream — already rendering — answers it.
8
- * - `turn`: the live turn did not take it, so the backend superseded that
9
- * turn and opened a new one for this message on THIS stream. The caller
10
- * drops this copy and replays the new turn through the engine's own
11
- * stream (the session's resume pointer moved to it).
12
- * - `failed`: the turn errored before producing anything.
13
- * - `silent`: the stream ended with no chunk at all — the reply was withheld
14
- * (assist draft, handoff); the transcript rows say what happened.
15
- */
16
- export type SteerOutcome = {
17
- kind: 'steered';
18
- } | {
19
- kind: 'turn';
20
- } | {
21
- kind: 'failed';
22
- errorText: string;
23
- } | {
24
- kind: 'silent';
25
- };
26
- /**
27
- * Classify a steer attempt from its stream's first DECISIVE chunk, then
28
- * release the stream. The backend heartbeats (`data-keepalive`) while the
29
- * request waits to be steered or for a fallback turn's first chunk — those
30
- * decide nothing and are skipped. Releasing never cancels the server turn
31
- * (resumable streams treat a client drop as a disconnect), so the `turn`
32
- * case can be replayed.
33
- */
34
- export declare function readSteerOutcome(stream: ReadableStream<UIMessageChunk>): Promise<SteerOutcome>;
35
- //# sourceMappingURL=steer-into-live-turn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"steer-into-live-turn.d.ts","sourceRoot":"","sources":["../../../src/agent-chat/steer-into-live-turn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,CAAC,cAAc,CAAC,GACrC,OAAO,CAAC,YAAY,CAAC,CAgBvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-display-mode.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-display-mode.spec.d.ts","sourceRoot":"","sources":["../../../../src/hooks/__tests__/use-display-mode.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-widget-layout.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-widget-layout.spec.d.ts","sourceRoot":"","sources":["../../../../src/hooks/__tests__/use-widget-layout.spec.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=useHostLocation.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useHostLocation.spec.d.ts","sourceRoot":"","sources":["../../../../src/hooks/__tests__/useHostLocation.spec.tsx"],"names":[],"mappings":""}