@flamingo-stack/openframe-frontend-core 0.0.824 → 0.0.825

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 (77) hide show
  1. package/dist/build/export-map.json +1 -1
  2. package/dist/chat-protocol/events.d.ts +0 -3
  3. package/dist/chat-protocol/events.d.ts.map +1 -1
  4. package/dist/chat-protocol/frames.d.ts +10 -7
  5. package/dist/chat-protocol/frames.d.ts.map +1 -1
  6. package/dist/chat-protocol/index.cjs +238 -234
  7. package/dist/chat-protocol/leading-frames.d.ts.map +1 -1
  8. package/dist/chat-protocol/leading-frames.js +6 -3
  9. package/dist/chat-protocol/progress.d.ts +13 -20
  10. package/dist/chat-protocol/progress.d.ts.map +1 -1
  11. package/dist/chat-protocol/progress.js +13 -11
  12. package/dist/{chunk-TQ7TUEK2.cjs → chunk-2U7GXE3T.cjs} +2754 -2784
  13. package/dist/{chunk-A3SR6HHX.cjs → chunk-47SHKOCY.cjs} +53 -53
  14. package/dist/{chunk-WSBAIZXL.cjs → chunk-4IY5FKYL.cjs} +11 -11
  15. package/dist/{chunk-M7EBCYKN.cjs → chunk-5S2GW6YG.cjs} +2 -2
  16. package/dist/{chunk-SOSVC6HB.cjs → chunk-6LVJKPR3.cjs} +3 -3
  17. package/dist/{chunk-HDOU3AXV.cjs → chunk-7DJWIVQC.cjs} +19 -19
  18. package/dist/{chunk-C3RAE7RO.cjs → chunk-AO6YVNAH.cjs} +104 -104
  19. package/dist/{chunk-EZTCN43H.cjs → chunk-APTFXX2C.cjs} +39 -39
  20. package/dist/{chunk-WMTV6M5B.cjs → chunk-AUBR3FGY.cjs} +9 -9
  21. package/dist/{chunk-GXBIYPDM.cjs → chunk-BN7QENV7.cjs} +4 -4
  22. package/dist/{chunk-2M4E2V25.cjs → chunk-DNZCSPMU.cjs} +7 -7
  23. package/dist/{chunk-J5U3XHFJ.cjs → chunk-IMMTH3F3.cjs} +10 -10
  24. package/dist/{chunk-2IHGR57J.cjs → chunk-MALCUN2G.cjs} +6 -6
  25. package/dist/{chunk-MROW2JWE.cjs → chunk-MHR4C465.cjs} +3 -3
  26. package/dist/{chunk-5N26M6CK.cjs → chunk-N7IDLF2G.cjs} +32 -32
  27. package/dist/{chunk-B2VRNRTY.cjs → chunk-NL34HKLS.cjs} +47 -47
  28. package/dist/{chunk-XUMZMIHR.cjs → chunk-P25RVNGX.cjs} +16 -16
  29. package/dist/{chunk-TTMTNG3U.cjs → chunk-XJMLZ63Y.cjs} +4 -4
  30. package/dist/{cloud-tenants-VYXMNISG.cjs → cloud-tenants-M4VFFN33.cjs} +4 -4
  31. package/dist/components/case-studies/index.cjs +16 -16
  32. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  33. package/dist/components/chat/embeddable-chat.js +0 -3
  34. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  35. package/dist/components/chat/hooks/use-sse-chat-adapter.js +0 -2
  36. package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
  37. package/dist/components/chat/hooks/use-unified-chat.js +0 -1
  38. package/dist/components/chat/index.cjs +3 -3
  39. package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -1
  40. package/dist/components/chat/stream/chat-dialog-store.js +0 -1
  41. package/dist/components/chat/stream/chat-stream-reducer.d.ts +0 -4
  42. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
  43. package/dist/components/chat/stream/chat-stream-reducer.js +6 -13
  44. package/dist/components/chat/types/unified-chat-state.types.d.ts +0 -5
  45. package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
  46. package/dist/components/contact/index.cjs +5 -5
  47. package/dist/components/docs/index.cjs +8 -8
  48. package/dist/components/embeds/index.cjs +5 -5
  49. package/dist/components/faq/index.cjs +6 -6
  50. package/dist/components/features/index.cjs +4 -4
  51. package/dist/components/help-center-pages/index.cjs +61 -61
  52. package/dist/components/index.cjs +37 -37
  53. package/dist/components/meeting-scheduler/index.cjs +29 -29
  54. package/dist/components/navigation/index.cjs +7 -7
  55. package/dist/components/onboarding-guides/index.cjs +6 -6
  56. package/dist/components/product-demo/index.cjs +13 -13
  57. package/dist/components/tickets/index.cjs +9 -9
  58. package/dist/components/ui/index.cjs +4 -4
  59. package/dist/{devices-NTYNZEGJ.cjs → devices-DW5NDXMD.cjs} +5 -5
  60. package/dist/{embeddable-chat-JAUO4O2T.cjs → embeddable-chat-NBJMXEXB.cjs} +63 -66
  61. package/dist/index.cjs +8 -8
  62. package/dist/{knowledge-I2LW27EP.cjs → knowledge-EYJG2TNW.cjs} +5 -5
  63. package/dist/{logs-KLZHXSOU.cjs → logs-2LV7DTSL.cjs} +12 -12
  64. package/dist/{policies-SMDAHDKL.cjs → policies-HSDYIQBX.cjs} +8 -8
  65. package/dist/{scripts-OMBBPNTU.cjs → scripts-UI6V7ANQ.cjs} +9 -9
  66. package/dist/{software-update-ZIJYNJIC.cjs → software-update-WMLY7VHH.cjs} +7 -7
  67. package/package.json +1 -1
  68. package/src/chat-protocol/events.ts +0 -3
  69. package/src/chat-protocol/frames.ts +12 -8
  70. package/src/chat-protocol/leading-frames.ts +7 -4
  71. package/src/chat-protocol/progress.ts +31 -28
  72. package/src/components/chat/embeddable-chat.tsx +0 -5
  73. package/src/components/chat/hooks/use-sse-chat-adapter.ts +0 -2
  74. package/src/components/chat/hooks/use-unified-chat.ts +0 -1
  75. package/src/components/chat/stream/chat-dialog-store.ts +0 -1
  76. package/src/components/chat/stream/chat-stream-reducer.ts +6 -17
  77. package/src/components/chat/types/unified-chat-state.types.ts +0 -6
@@ -1,22 +1,16 @@
1
1
  /**
2
- * What a turn is doing before its first answer token: the named stages a server
3
- * reports while it works, and the line a client shows for each.
2
+ * What a turn is doing before its first answer token: the named stages a server reports while it works, and the line
3
+ * a client shows for each.
4
4
  *
5
- * A retrieval chat spends seconds before any text exists (reading the question,
6
- * searching, reading what it found). A generic spinner for that whole time says
7
- * nothing; a line naming the real step ("Searching 28 sources") does, and people
8
- * wait more willingly for it. The stage is a FIXED vocabulary on the wire (never
9
- * model text, a rewritten query or a source name), so it is safe on a public
10
- * chat and the wording stays the client's: `chatProgressLabel` is the one place
11
- * the copy lives.
12
- *
13
- * Wire: the existing `{ status: 'thinking' }` leading frame, with an optional
14
- * `stage` and `count`. A client that predates the stage reads the frame exactly
15
- * as before; a client that knows it shows the line. A stage it does not know is
16
- * dropped (the frame is still a plain "thinking").
5
+ * A retrieval chat spends seconds before any text exists (reading the question, searching, reading what it found). Each
6
+ * stage is reported as a step of the turn, in the chunk shape a NATS tool run has (`ToolExecutionFrame`), so the chat
7
+ * draws it as the row it draws for a tool run: working while the stage runs, done when it ends. The stage is a FIXED
8
+ * vocabulary (never model text, a rewritten query or a source name), so it is safe on a public chat, and its line lives
9
+ * here only (`chatProgressLabel`).
17
10
  *
18
11
  * Server-safe: no React, no browser APIs.
19
12
  */
13
+ import type { ToolExecutionFrame } from './frames';
20
14
  export declare const CHAT_PROGRESS_STAGES: readonly ["understanding", "searching", "searching_again", "reading"];
21
15
  export type ChatProgressStage = (typeof CHAT_PROGRESS_STAGES)[number];
22
16
  export interface ChatProgress {
@@ -24,12 +18,11 @@ export interface ChatProgress {
24
18
  /** How many of the thing the stage works on: sources searched, results read. */
25
19
  count?: number;
26
20
  }
27
- export declare function isChatProgressStage(value: unknown): value is ChatProgressStage;
28
- /** A parsed status frame's progress, or null when it carries no stage this client knows. */
29
- export declare function chatProgressOf(frame: {
30
- stage?: unknown;
31
- count?: unknown;
32
- }): ChatProgress | null;
33
21
  /** The one line shown for a stage. Specific when the server gave a real count, never an invented one. */
34
22
  export declare function chatProgressLabel(progress: ChatProgress): string;
23
+ /**
24
+ * The frame for a stage of one turn: `running` opens its row, `done` or `failed` closes it. `turnId` keeps the row's id
25
+ * unique to the turn, since a closing frame updates the open row of the same id anywhere in the thread.
26
+ */
27
+ export declare function chatProgressFrame(progress: ChatProgress, state: 'running' | 'done' | 'failed', turnId: string): ToolExecutionFrame;
35
28
  //# sourceMappingURL=progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,oBAAoB,uEAAwE,CAAC;AAE1G,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,iBAAiB,CAAC;IACzB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,GAAG,IAAI,CAO/F;AASD,yGAAyG;AACzG,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAEhE"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,eAAO,MAAM,oBAAoB,uEAAwE,CAAC;AAE1G,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,iBAAiB,CAAC;IACzB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,yGAAyG;AACzG,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAEhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,EACpC,MAAM,EAAE,MAAM,GACb,kBAAkB,CAYpB"}
@@ -1,12 +1,4 @@
1
1
  const CHAT_PROGRESS_STAGES = ["understanding", "searching", "searching_again", "reading"];
2
- function isChatProgressStage(value) {
3
- return typeof value === "string" && CHAT_PROGRESS_STAGES.includes(value);
4
- }
5
- function chatProgressOf(frame) {
6
- if (!isChatProgressStage(frame.stage)) return null;
7
- const count = typeof frame.count === "number" && Number.isFinite(frame.count) && frame.count > 0 ? Math.floor(frame.count) : void 0;
8
- return count === void 0 ? { stage: frame.stage } : { stage: frame.stage, count };
9
- }
10
2
  const PROGRESS_LABEL = {
11
3
  understanding: () => "Understanding your question",
12
4
  searching: (count) => count ? `Searching ${count} ${count === 1 ? "source" : "sources"}` : "Searching",
@@ -16,9 +8,19 @@ const PROGRESS_LABEL = {
16
8
  function chatProgressLabel(progress) {
17
9
  return PROGRESS_LABEL[progress.stage](progress.count);
18
10
  }
11
+ function chatProgressFrame(progress, state, turnId) {
12
+ const id = `${turnId}:${progress.stage}`;
13
+ const title = chatProgressLabel(progress);
14
+ return state === "running" ? { type: "EXECUTING_TOOL", toolFunction: progress.stage, title, toolExecutionRequestId: id } : {
15
+ type: "EXECUTED_TOOL",
16
+ toolFunction: progress.stage,
17
+ title,
18
+ toolExecutionRequestId: id,
19
+ success: state === "done"
20
+ };
21
+ }
19
22
  export {
20
23
  CHAT_PROGRESS_STAGES,
21
- chatProgressLabel,
22
- chatProgressOf,
23
- isChatProgressStage
24
+ chatProgressFrame,
25
+ chatProgressLabel
24
26
  };