@octaviaflow/core 3.1.0-beta.118 → 3.1.0-beta.120

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 (35) hide show
  1. package/dist/chunk-FM34SY5X.js +3691 -0
  2. package/dist/chunk-FM34SY5X.js.map +1 -0
  3. package/dist/chunk-JHIV4QHZ.js +3707 -0
  4. package/dist/chunk-JHIV4QHZ.js.map +1 -0
  5. package/dist/chunk-OQAB7DBO.js +3715 -0
  6. package/dist/chunk-OQAB7DBO.js.map +1 -0
  7. package/dist/chunk-ZHTMPKJN.js +3704 -0
  8. package/dist/chunk-ZHTMPKJN.js.map +1 -0
  9. package/dist/components/AssistantConversation/AssistantConversation.d.ts +7 -1
  10. package/dist/components/AssistantConversation/AssistantConversation.d.ts.map +1 -1
  11. package/dist/components/AssistantConversation/assistant.fixtures.d.ts +2 -0
  12. package/dist/components/AssistantConversation/assistant.fixtures.d.ts.map +1 -1
  13. package/dist/components/AssistantConversation/citations.d.ts +3 -0
  14. package/dist/components/AssistantConversation/citations.d.ts.map +1 -0
  15. package/dist/components/AssistantConversation/index.d.ts +2 -1
  16. package/dist/components/AssistantConversation/index.d.ts.map +1 -1
  17. package/dist/components/AssistantDock/AssistantDock.d.ts +6 -2
  18. package/dist/components/AssistantDock/AssistantDock.d.ts.map +1 -1
  19. package/dist/components/AssistantHistory/AssistantHistory.d.ts +26 -0
  20. package/dist/components/AssistantHistory/AssistantHistory.d.ts.map +1 -0
  21. package/dist/components/AssistantHistory/index.d.ts +2 -0
  22. package/dist/components/AssistantHistory/index.d.ts.map +1 -0
  23. package/dist/components/ChatToolTrace/ChatToolTrace.d.ts +3 -0
  24. package/dist/components/ChatToolTrace/ChatToolTrace.d.ts.map +1 -1
  25. package/dist/index.cjs +3968 -3858
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.ts +3 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +3547 -3463
  30. package/dist/index.js.map +1 -1
  31. package/dist/marketing.cjs +58 -34
  32. package/dist/marketing.cjs.map +1 -1
  33. package/dist/marketing.js +1 -1
  34. package/dist/styles.css +1 -1
  35. package/package.json +1 -1
@@ -3832,10 +3832,10 @@ function NodeGlyph({ status }) {
3832
3832
  }
3833
3833
  }
3834
3834
  var ChatToolTrace = (0, import_react36.forwardRef)(
3835
- function ChatToolTrace2({ calls, summary, defaultOpen = false, className, ...rest }, ref) {
3835
+ function ChatToolTrace2({ calls, summary, defaultOpen = false, autoOpen = true, className, ...rest }, ref) {
3836
3836
  const count = calls?.length ?? 0;
3837
3837
  const running = (calls ?? []).some((c) => c.status === "running" || c.status === "pending");
3838
- const [open, setOpen] = (0, import_react36.useState)(defaultOpen || running);
3838
+ const [open, setOpen] = (0, import_react36.useState)(defaultOpen || autoOpen && running);
3839
3839
  const defaultSummary = running ? "Working\u2026" : `Used ${count} ${count === 1 ? "tool" : "tools"}`;
3840
3840
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3841
3841
  "details",
@@ -4168,6 +4168,36 @@ function AssistantHeaderButton({
4168
4168
  }
4169
4169
  );
4170
4170
  }
4171
+ function stepSummary(steps) {
4172
+ const running = steps.find((s) => s.status === "running" || s.status === "pending");
4173
+ if (running) return running.name;
4174
+ const only = steps.length === 1 ? steps[0] : void 0;
4175
+ if (!only) return void 0;
4176
+ return only.result == null ? only.name : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
4177
+ only.name,
4178
+ " \xB7 ",
4179
+ only.result
4180
+ ] });
4181
+ }
4182
+ function ReplyText({ message }) {
4183
+ return typeof message.content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4184
+ "span",
4185
+ {
4186
+ className: cn("ods-assistant__text", message.streaming && "ods-assistant__text--streaming"),
4187
+ children: message.content
4188
+ }
4189
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4190
+ "div",
4191
+ {
4192
+ className: cn(
4193
+ "ods-assistant__text",
4194
+ "ods-assistant__text--rich",
4195
+ message.streaming && "ods-assistant__text--streaming"
4196
+ ),
4197
+ children: message.content
4198
+ }
4199
+ );
4200
+ }
4171
4201
  function Block({
4172
4202
  block,
4173
4203
  busy,
@@ -4217,6 +4247,7 @@ function AssistantConversation({
4217
4247
  context,
4218
4248
  aura = "normal",
4219
4249
  hideHeader = false,
4250
+ layout = "comfortable",
4220
4251
  state: stateProp,
4221
4252
  greeting,
4222
4253
  suggestions,
@@ -4241,8 +4272,10 @@ function AssistantConversation({
4241
4272
  const state = stateProp ?? assistantStateOf(messages, busy, typing, { error: Boolean(error) });
4242
4273
  const statusLine = STATE_LINE[state] || subtitle;
4243
4274
  const tone = STATUS_TONE[state];
4275
+ const compact = layout === "compact";
4276
+ const said = (body) => compact ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ods-assistant__answer", children: body }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatBubble, { variant: "bot", hideAvatar: true, children: body });
4244
4277
  const header = hideHeader ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ods-assistant__header", children: [
4245
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AssistantOrb, { state, size: "md", children: avatar }),
4278
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AssistantOrb, { state, size: compact ? "sm" : "md", children: avatar }),
4246
4279
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ods-assistant__heading", children: [
4247
4280
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { id: nameId, className: "ods-assistant__name", children: name }),
4248
4281
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
@@ -4257,35 +4290,15 @@ function AssistantConversation({
4257
4290
  actions && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ods-assistant__actions", children: actions })
4258
4291
  ] });
4259
4292
  const thread = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
4260
- greeting && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatBubble, { variant: "bot", hideAvatar: true, children: greeting }),
4293
+ greeting && said(greeting),
4261
4294
  messages.map(
4262
- (m) => m.role === "user" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatBubble, { variant: "user", hideAvatar: true, children: m.content }, m.id) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ods-assistant__reply", children: [
4263
- m.steps && m.steps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatToolTrace, { calls: m.steps }),
4264
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatBubble, { variant: "bot", hideAvatar: true, children: m.content ? (
4265
- // Plain text keeps its line breaks; rendered content (markdown,
4266
- // lists) is block content and lays out its own lines.
4267
- typeof m.content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4268
- "span",
4269
- {
4270
- className: cn(
4271
- "ods-assistant__text",
4272
- m.streaming && "ods-assistant__text--streaming"
4273
- ),
4274
- children: m.content
4275
- }
4276
- ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4277
- "div",
4278
- {
4279
- className: cn(
4280
- "ods-assistant__text",
4281
- "ods-assistant__text--rich",
4282
- m.streaming && "ods-assistant__text--streaming"
4283
- ),
4284
- children: m.content
4285
- }
4286
- )
4287
- ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatThinking, { variant: "shimmer", label: m.status || "Thinking\u2026", size: "sm" }) }),
4288
- m.blocks && m.blocks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ods-assistant__blocks", children: m.blocks.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4295
+ (m, i) => m.role === "user" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatBubble, { variant: "user", hideAvatar: true, children: m.content }, m.id) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ods-assistant__reply", children: [
4296
+ m.steps && m.steps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatToolTrace, { calls: m.steps, summary: stepSummary(m.steps), autoOpen: false }),
4297
+ m.content ? said(/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ReplyText, { message: m })) : (
4298
+ // While a step runs, its line already says what is happening.
4299
+ !m.steps?.some((st) => st.status === "running") && said(/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatThinking, { variant: "shimmer", label: m.status || "Thinking\u2026", size: "sm" }))
4300
+ ),
4301
+ m.blocks && m.blocks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ods-assistant__blocks", children: m.blocks.map((b, i2) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4289
4302
  Block,
4290
4303
  {
4291
4304
  block: b,
@@ -4293,7 +4306,7 @@ function AssistantConversation({
4293
4306
  onAnswer,
4294
4307
  onSkipAsk
4295
4308
  },
4296
- b.type === "ask" ? b.askId : `${b.type}:${b.url}:${i}`
4309
+ b.type === "ask" ? b.askId : `${b.type}:${b.url}:${i2}`
4297
4310
  )) }),
4298
4311
  m.sources && m.sources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4299
4312
  ChatSources,
@@ -4314,7 +4327,18 @@ function AssistantConversation({
4314
4327
  onRate: (r) => onRate(m.id, r)
4315
4328
  }
4316
4329
  )
4317
- ] })
4330
+ ] }),
4331
+ i === messages.length - 1 && !busy && !m.streaming && onSend && (m.followUps?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4332
+ ChatSuggestions,
4333
+ {
4334
+ className: "ods-assistant__follow-ups",
4335
+ items: m.followUps ?? [],
4336
+ onSelect: (v) => onSend(v),
4337
+ size: "sm",
4338
+ layout: "wrap",
4339
+ "aria-label": "Ask next"
4340
+ }
4341
+ )
4318
4342
  ] }, m.id)
4319
4343
  )
4320
4344
  ] });
@@ -4325,7 +4349,7 @@ function AssistantConversation({
4325
4349
  ...rest,
4326
4350
  state,
4327
4351
  intensity: aura,
4328
- className: cn("ods-assistant", className),
4352
+ className: cn("ods-assistant", compact && "ods-assistant--compact", className),
4329
4353
  children: replacement ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ods-assistant__replacement", children: [
4330
4354
  header,
4331
4355
  context && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ods-assistant__context", children: context }),