@cellarnode/ui 0.201.1 → 0.203.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.
Files changed (159) hide show
  1. package/dist/agent/composer.d.ts +6 -1
  2. package/dist/agent/composer.d.ts.map +1 -1
  3. package/dist/agent/composer.js +43 -9
  4. package/dist/agent/composer.js.map +1 -1
  5. package/dist/agent/conversation.d.ts +20 -2
  6. package/dist/agent/conversation.d.ts.map +1 -1
  7. package/dist/agent/conversation.js +39 -5
  8. package/dist/agent/conversation.js.map +1 -1
  9. package/dist/agent/copy.d.ts +7 -0
  10. package/dist/agent/copy.d.ts.map +1 -1
  11. package/dist/agent/copy.js +9 -0
  12. package/dist/agent/copy.js.map +1 -1
  13. package/dist/agent/fixtures.d.ts +34 -0
  14. package/dist/agent/fixtures.d.ts.map +1 -1
  15. package/dist/agent/fixtures.js +83 -0
  16. package/dist/agent/fixtures.js.map +1 -1
  17. package/dist/agent/index.d.ts +18 -1
  18. package/dist/agent/index.d.ts.map +1 -1
  19. package/dist/agent/index.js +18 -1
  20. package/dist/agent/index.js.map +1 -1
  21. package/dist/agent/markdown.d.ts +64 -0
  22. package/dist/agent/markdown.d.ts.map +1 -0
  23. package/dist/agent/markdown.js +338 -0
  24. package/dist/agent/markdown.js.map +1 -0
  25. package/dist/agent/masked-value.d.ts +1 -0
  26. package/dist/agent/masked-value.d.ts.map +1 -1
  27. package/dist/agent/masked-value.js +4 -1
  28. package/dist/agent/masked-value.js.map +1 -1
  29. package/dist/agent/message.d.ts +26 -6
  30. package/dist/agent/message.d.ts.map +1 -1
  31. package/dist/agent/message.js +47 -11
  32. package/dist/agent/message.js.map +1 -1
  33. package/dist/agent/panel-frame.js +1 -1
  34. package/dist/agent/panel-frame.js.map +1 -1
  35. package/dist/agent/role-cards/card-kit.d.ts +111 -0
  36. package/dist/agent/role-cards/card-kit.d.ts.map +1 -0
  37. package/dist/agent/role-cards/card-kit.js +68 -0
  38. package/dist/agent/role-cards/card-kit.js.map +1 -0
  39. package/dist/agent/role-cards/data-table-card.d.ts +80 -0
  40. package/dist/agent/role-cards/data-table-card.d.ts.map +1 -0
  41. package/dist/agent/role-cards/data-table-card.js +214 -0
  42. package/dist/agent/role-cards/data-table-card.js.map +1 -0
  43. package/dist/agent/role-cards/fixtures.d.ts +124 -0
  44. package/dist/agent/role-cards/fixtures.d.ts.map +1 -0
  45. package/dist/agent/role-cards/fixtures.js +401 -0
  46. package/dist/agent/role-cards/fixtures.js.map +1 -0
  47. package/dist/agent/role-cards/host-contract.d.ts +214 -0
  48. package/dist/agent/role-cards/host-contract.d.ts.map +1 -0
  49. package/dist/agent/role-cards/host-contract.js +348 -0
  50. package/dist/agent/role-cards/host-contract.js.map +1 -0
  51. package/dist/agent/role-cards/inspector-drawer.d.ts +42 -0
  52. package/dist/agent/role-cards/inspector-drawer.d.ts.map +1 -0
  53. package/dist/agent/role-cards/inspector-drawer.js +68 -0
  54. package/dist/agent/role-cards/inspector-drawer.js.map +1 -0
  55. package/dist/agent/role-cards/inspector-fixtures.d.ts +84 -0
  56. package/dist/agent/role-cards/inspector-fixtures.d.ts.map +1 -0
  57. package/dist/agent/role-cards/inspector-fixtures.js +162 -0
  58. package/dist/agent/role-cards/inspector-fixtures.js.map +1 -0
  59. package/dist/agent/role-cards/inspector-record.d.ts +109 -0
  60. package/dist/agent/role-cards/inspector-record.d.ts.map +1 -0
  61. package/dist/agent/role-cards/inspector-record.js +346 -0
  62. package/dist/agent/role-cards/inspector-record.js.map +1 -0
  63. package/dist/agent/role-cards/inspector-view.d.ts +137 -0
  64. package/dist/agent/role-cards/inspector-view.d.ts.map +1 -0
  65. package/dist/agent/role-cards/inspector-view.js +261 -0
  66. package/dist/agent/role-cards/inspector-view.js.map +1 -0
  67. package/dist/agent/role-cards/match-card.d.ts +21 -0
  68. package/dist/agent/role-cards/match-card.d.ts.map +1 -0
  69. package/dist/agent/role-cards/match-card.js +30 -0
  70. package/dist/agent/role-cards/match-card.js.map +1 -0
  71. package/dist/agent/role-cards/offer-card.d.ts +27 -0
  72. package/dist/agent/role-cards/offer-card.d.ts.map +1 -0
  73. package/dist/agent/role-cards/offer-card.js +68 -0
  74. package/dist/agent/role-cards/offer-card.js.map +1 -0
  75. package/dist/agent/role-cards/opportunity-card.d.ts +26 -0
  76. package/dist/agent/role-cards/opportunity-card.d.ts.map +1 -0
  77. package/dist/agent/role-cards/opportunity-card.js +50 -0
  78. package/dist/agent/role-cards/opportunity-card.js.map +1 -0
  79. package/dist/agent/role-cards/product-card.d.ts +32 -0
  80. package/dist/agent/role-cards/product-card.d.ts.map +1 -0
  81. package/dist/agent/role-cards/product-card.js +50 -0
  82. package/dist/agent/role-cards/product-card.js.map +1 -0
  83. package/dist/agent/role-cards/proposal-diff.d.ts +38 -0
  84. package/dist/agent/role-cards/proposal-diff.d.ts.map +1 -0
  85. package/dist/agent/role-cards/proposal-diff.js +74 -0
  86. package/dist/agent/role-cards/proposal-diff.js.map +1 -0
  87. package/dist/agent/role-cards/registry.d.ts +43 -0
  88. package/dist/agent/role-cards/registry.d.ts.map +1 -0
  89. package/dist/agent/role-cards/registry.js +46 -0
  90. package/dist/agent/role-cards/registry.js.map +1 -0
  91. package/dist/agent/role-cards/score-meter.d.ts +12 -0
  92. package/dist/agent/role-cards/score-meter.d.ts.map +1 -0
  93. package/dist/agent/role-cards/score-meter.js +17 -0
  94. package/dist/agent/role-cards/score-meter.js.map +1 -0
  95. package/dist/agent/role-cards/surface-links.d.ts +54 -0
  96. package/dist/agent/role-cards/surface-links.d.ts.map +1 -0
  97. package/dist/agent/role-cards/surface-links.js +149 -0
  98. package/dist/agent/role-cards/surface-links.js.map +1 -0
  99. package/dist/agent/role-cards/text-safety.d.ts +27 -0
  100. package/dist/agent/role-cards/text-safety.d.ts.map +1 -0
  101. package/dist/agent/role-cards/text-safety.js +77 -0
  102. package/dist/agent/role-cards/text-safety.js.map +1 -0
  103. package/dist/agent/schema.d.ts +10 -0
  104. package/dist/agent/schema.d.ts.map +1 -1
  105. package/dist/agent/schema.js +31 -3
  106. package/dist/agent/schema.js.map +1 -1
  107. package/dist/agent/states.d.ts +1 -0
  108. package/dist/agent/states.d.ts.map +1 -1
  109. package/dist/agent/states.js +1 -1
  110. package/dist/agent/states.js.map +1 -1
  111. package/dist/agent/thinking.d.ts +13 -4
  112. package/dist/agent/thinking.d.ts.map +1 -1
  113. package/dist/agent/thinking.js +15 -6
  114. package/dist/agent/thinking.js.map +1 -1
  115. package/dist/agent/thread-list.d.ts +45 -2
  116. package/dist/agent/thread-list.d.ts.map +1 -1
  117. package/dist/agent/thread-list.js +175 -8
  118. package/dist/agent/thread-list.js.map +1 -1
  119. package/dist/agent/thread-title.d.ts +46 -0
  120. package/dist/agent/thread-title.d.ts.map +1 -0
  121. package/dist/agent/thread-title.js +99 -0
  122. package/dist/agent/thread-title.js.map +1 -0
  123. package/dist/agent/tool-activity-model.d.ts +136 -0
  124. package/dist/agent/tool-activity-model.d.ts.map +1 -0
  125. package/dist/agent/tool-activity-model.js +288 -0
  126. package/dist/agent/tool-activity-model.js.map +1 -0
  127. package/dist/agent/tool-activity.d.ts +61 -0
  128. package/dist/agent/tool-activity.d.ts.map +1 -0
  129. package/dist/agent/tool-activity.js +199 -0
  130. package/dist/agent/tool-activity.js.map +1 -0
  131. package/dist/agent/tool-call-card.d.ts +11 -1
  132. package/dist/agent/tool-call-card.d.ts.map +1 -1
  133. package/dist/agent/tool-call-card.js +19 -4
  134. package/dist/agent/tool-call-card.js.map +1 -1
  135. package/dist/agent/ui.js +1 -1
  136. package/dist/agent/ui.js.map +1 -1
  137. package/dist/agent/use-motion.d.ts +15 -0
  138. package/dist/agent/use-motion.d.ts.map +1 -0
  139. package/dist/agent/use-motion.js +52 -0
  140. package/dist/agent/use-motion.js.map +1 -0
  141. package/dist/chat/use-stick-to-bottom.d.ts +5 -0
  142. package/dist/chat/use-stick-to-bottom.d.ts.map +1 -1
  143. package/dist/chat/use-stick-to-bottom.js +11 -1
  144. package/dist/chat/use-stick-to-bottom.js.map +1 -1
  145. package/dist/components/sheet.d.ts +3 -1
  146. package/dist/components/sheet.d.ts.map +1 -1
  147. package/dist/components/sheet.js +2 -2
  148. package/dist/components/sheet.js.map +1 -1
  149. package/dist/portfolio-import/import-job-panels.d.ts +6 -0
  150. package/dist/portfolio-import/import-job-panels.d.ts.map +1 -1
  151. package/dist/portfolio-import/import-job-panels.js +11 -4
  152. package/dist/portfolio-import/import-job-panels.js.map +1 -1
  153. package/dist/portfolio-import/job-error-copy.d.ts +62 -0
  154. package/dist/portfolio-import/job-error-copy.d.ts.map +1 -0
  155. package/dist/portfolio-import/job-error-copy.js +78 -0
  156. package/dist/portfolio-import/job-error-copy.js.map +1 -0
  157. package/dist/realtime/organisation-events/schemas.d.ts +2 -2
  158. package/package.json +4 -1
  159. package/src/theme/tokens.css +66 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * job-error-copy.ts: maps the extraction-job error strings the backend
3
+ * persists to copy keys, so `JobFailedPanel` can show friendly, translatable
4
+ * text instead of the raw (English, internal-vocabulary) error (CEL-2500).
5
+ *
6
+ * The backend strings are a contract in the other direction too: the backend's
7
+ * `restartUnstartedJob` matches the stored text, so these constants mirror it
8
+ * and are never rewritten here. The raw text stays visible to the user in a
9
+ * details disclosure; only the headline, body and action copy change. Only the
10
+ * two exact strings below are recognised: no backend path stores any other
11
+ * never-started or already-ran wording, so nothing is matched loosely.
12
+ *
13
+ * Internal to the package on purpose (not in the barrel): hosts pass the stored
14
+ * `error` straight to `JobFailedPanel` and only need the copy keys below.
15
+ */
16
+ /**
17
+ * Mirrors the backend constant `UNSTARTED_JOB_ERROR`
18
+ * (`cellarnode-backend-v2`, `features/beverage-extraction/service.ts`): the
19
+ * error stored on a job whose extraction never started (the start request
20
+ * failed, or the never-started sweep from backend #1161 closed it). Restartable.
21
+ */
22
+ export const UNSTARTED_JOB_ERROR = "Failed to start extraction workflow";
23
+ /**
24
+ * Mirrors the backend constant `ALREADY_RAN_JOB_ERROR` (backend #1161, CEL-2494,
25
+ * merged as `b20e4f797`, same file): the terminal error stored on a job whose
26
+ * start was refused because its run already happened and closed. Unlike
27
+ * `UNSTARTED_JOB_ERROR` it is not restartable, so the producer starts a new import.
28
+ */
29
+ export const ALREADY_RAN_JOB_ERROR = "This import already ran and cannot be started again. Start a new import.";
30
+ /**
31
+ * Classify a stored job error (trimmed, case-insensitive exact match). Returns
32
+ * `null` for an empty error and for any error that is not one of the two known
33
+ * constants (those keep rendering raw).
34
+ */
35
+ export function classifyJobError(error) {
36
+ const text = error?.trim().toLowerCase();
37
+ if (!text)
38
+ return null;
39
+ if (text === UNSTARTED_JOB_ERROR.toLowerCase())
40
+ return "unstarted";
41
+ if (text === ALREADY_RAN_JOB_ERROR.toLowerCase())
42
+ return "already_ran";
43
+ return null;
44
+ }
45
+ /** Per-kind copy (`detail.*` keys of the imports namespace). */
46
+ export const KNOWN_JOB_ERROR_COPY = {
47
+ unstarted: {
48
+ title: {
49
+ key: "detail.failed_unstarted_title",
50
+ fallback: "We couldn't start reading this document.",
51
+ },
52
+ body: {
53
+ key: "detail.failed_unstarted",
54
+ fallback: "Processing never started, so nothing from this document was read. Upload it again to try once more.",
55
+ },
56
+ },
57
+ already_ran: {
58
+ title: {
59
+ key: "detail.failed_already_ran_title",
60
+ fallback: "This import already ran.",
61
+ },
62
+ body: {
63
+ key: "detail.failed_already_ran",
64
+ fallback: "This import can't be restarted. Upload the document again to start a new one.",
65
+ },
66
+ },
67
+ };
68
+ /** The action label for every known kind: both ask for a fresh upload. */
69
+ export const KNOWN_JOB_ERROR_ACTION = {
70
+ key: "detail.failed_upload_again",
71
+ fallback: "Upload again",
72
+ };
73
+ /** Label of the disclosure that holds the raw backend text. */
74
+ export const KNOWN_JOB_ERROR_DETAILS = {
75
+ key: "detail.failed_details",
76
+ fallback: "Technical details",
77
+ };
78
+ //# sourceMappingURL=job-error-copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-error-copy.js","sourceRo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
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  export declare const OrganisationChangedResourceSchema: z.ZodEnum<{
3
3
  members: "members";
4
- requests: "requests";
5
4
  organisation: "organisation";
5
+ requests: "requests";
6
6
  invitations: "invitations";
7
7
  seats: "seats";
8
8
  access: "access";
@@ -16,8 +16,8 @@ export declare const OrganisationChangedSchema: z.ZodObject<{
16
16
  occurredAt: z.ZodString;
17
17
  resources: z.ZodArray<z.ZodEnum<{
18
18
  members: "members";
19
- requests: "requests";
20
19
  organisation: "organisation";
20
+ requests: "requests";
21
21
  invitations: "invitations";
22
22
  seats: "seats";
23
23
  access: "access";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellarnode/ui",
3
- "version": "0.201.1",
3
+ "version": "0.203.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
@@ -355,6 +355,7 @@
355
355
  }
356
356
  },
357
357
  "dependencies": {
358
+ "@cellarnode/agent-cards": "^0.2.1",
358
359
  "@headlessui/react": "^2.2.9",
359
360
  "@hookform/resolvers": "^5.2.2",
360
361
  "@tanstack/react-virtual": "^3.13.23",
@@ -368,6 +369,8 @@
368
369
  "qr-code-styling": "^1.9.2",
369
370
  "react-easy-crop": "^6.2.2",
370
371
  "react-hook-form": "^7.72.0",
372
+ "react-markdown": "10.1.0",
373
+ "remark-gfm": "4.0.1",
371
374
  "sonner": "^1.7.4",
372
375
  "tailwind-merge": "^2.6.1",
373
376
  "three-globe": "^2.45.1",
@@ -1493,3 +1493,69 @@
1493
1493
  }
1494
1494
  .imports-enter { animation: cn-imports-enter 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }
1495
1495
  }
1496
+
1497
+ /* ── Agent chat motion (CEL-2507) ─────────────────────────
1498
+ `@cellarnode/ui/agent`: message entrance, result-card fade, step status
1499
+ pop, title swap, the "Naming…" pulse, streaming caret.
1500
+
1501
+ Every animation lives inside `no-preference`, so under
1502
+ `prefers-reduced-motion: reduce` the classes do nothing and elements simply
1503
+ appear. One entrance per element: a message animates as a whole, and only
1504
+ parts appended later animate on their own (the component decides; see
1505
+ `message.tsx`). The fill mode is `backwards`, never `both`: once an entrance
1506
+ has finished the element is back to its own styles (a held `transform` would
1507
+ make it a containing block for fixed descendants). The streaming caret is
1508
+ static under reduced motion rather than gone, because it marks where the
1509
+ text is arriving. The pulse never drops below 85% opacity, so the text it
1510
+ sits on keeps its contrast in both themes. */
1511
+ .agent-md[data-streaming="true"] > :last-child:is(p, h1, h2, h3, h4, h5, h6)::after,
1512
+ .agent-md[data-streaming="true"] > :last-child:is(ul, ol) > li:last-child::after,
1513
+ .agent-md[data-streaming="true"] > blockquote:last-child > p:last-child::after {
1514
+ content: "";
1515
+ display: inline-block;
1516
+ width: 0.4em;
1517
+ height: 1em;
1518
+ margin-left: 0.15em;
1519
+ vertical-align: text-bottom;
1520
+ border-radius: 1px;
1521
+ background: var(--color-primary);
1522
+ }
1523
+
1524
+ @media (prefers-reduced-motion: no-preference) {
1525
+ @keyframes agent-enter {
1526
+ from { opacity: 0; transform: translateY(6px); }
1527
+ to { opacity: 1; transform: translateY(0); }
1528
+ }
1529
+ @keyframes agent-fade-in {
1530
+ from { opacity: 0; }
1531
+ to { opacity: 1; }
1532
+ }
1533
+ @keyframes agent-swap-in {
1534
+ from { opacity: 0; transform: translateY(2px); }
1535
+ to { opacity: 1; transform: translateY(0); }
1536
+ }
1537
+ @keyframes agent-pop {
1538
+ from { opacity: 0; transform: scale(0.6); }
1539
+ to { opacity: 1; transform: scale(1); }
1540
+ }
1541
+ @keyframes agent-caret {
1542
+ 0%, 49% { opacity: 1; }
1543
+ 50%, 100% { opacity: 0; }
1544
+ }
1545
+ @keyframes agent-pulse {
1546
+ 0%, 100% { opacity: 1; }
1547
+ 50% { opacity: 0.85; }
1548
+ }
1549
+
1550
+ .agent-enter { animation: agent-enter 180ms var(--ease-emphasized) backwards; }
1551
+ .agent-fade-in { animation: agent-fade-in 200ms var(--ease-decel) backwards; }
1552
+ .agent-swap-in { animation: agent-swap-in 180ms var(--ease-emphasized) backwards; }
1553
+ .agent-pop { animation: agent-pop 160ms var(--ease-emphasized-strong) backwards; }
1554
+ .agent-pulse { animation: agent-pulse 1.6s ease-in-out infinite; }
1555
+
1556
+ .agent-md[data-streaming="true"] > :last-child:is(p, h1, h2, h3, h4, h5, h6)::after,
1557
+ .agent-md[data-streaming="true"] > :last-child:is(ul, ol) > li:last-child::after,
1558
+ .agent-md[data-streaming="true"] > blockquote:last-child > p:last-child::after {
1559
+ animation: agent-caret 1s steps(1, end) infinite;
1560
+ }
1561
+ }