@athenaintel/react 0.10.31 → 0.10.32

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/index.d.ts CHANGED
@@ -1188,8 +1188,12 @@ export declare const Toolkits: {
1188
1188
  readonly NOTEBOOK: "notebook_toolkit";
1189
1189
  /** Presentation slide editing. */
1190
1190
  readonly PRESENTATION: "presentation_toolkit";
1191
+ /** Presentation slide editing (OnlyOffice, deprecated). */
1192
+ readonly PRESENTATION_ONLYOFFICE: "presentation_onlyoffice_toolkit";
1191
1193
  /** PowerPoint presentation creation from templates. */
1192
1194
  readonly POWERPOINT: "powerpoint_deck_toolkit";
1195
+ /** PowerPoint presentation creation from templates (pptx-studio). */
1196
+ readonly PRESENTATION_PPTX_STUDIO: "presentation_pptx_studio_toolkit";
1193
1197
  /** Workspace file management (Olympus Drive). */
1194
1198
  readonly DRIVE: "olympus_drive_toolkit";
1195
1199
  /** Python code execution. */
package/dist/index.js CHANGED
@@ -1137,15 +1137,27 @@ const createConfigUtils = (config2) => ({
1137
1137
  cache: createLruCache(config2.cacheSize),
1138
1138
  parseClassName: createParseClassName(config2),
1139
1139
  sortModifiers: createSortModifiers(config2),
1140
+ postfixLookupClassGroupIds: createPostfixLookupClassGroupIds(config2),
1140
1141
  ...createClassGroupUtils(config2)
1141
1142
  });
1143
+ const createPostfixLookupClassGroupIds = (config2) => {
1144
+ const lookup = /* @__PURE__ */ Object.create(null);
1145
+ const classGroupIds = config2.postfixLookupClassGroups;
1146
+ if (classGroupIds) {
1147
+ for (let i = 0; i < classGroupIds.length; i++) {
1148
+ lookup[classGroupIds[i]] = true;
1149
+ }
1150
+ }
1151
+ return lookup;
1152
+ };
1142
1153
  const SPLIT_CLASSES_REGEX = /\s+/;
1143
1154
  const mergeClassList = (classList, configUtils) => {
1144
1155
  const {
1145
1156
  parseClassName,
1146
1157
  getClassGroupId,
1147
1158
  getConflictingClassGroupIds,
1148
- sortModifiers
1159
+ sortModifiers,
1160
+ postfixLookupClassGroupIds
1149
1161
  } = configUtils;
1150
1162
  const classGroupsInConflict = [];
1151
1163
  const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
@@ -1164,7 +1176,18 @@ const mergeClassList = (classList, configUtils) => {
1164
1176
  continue;
1165
1177
  }
1166
1178
  let hasPostfixModifier = !!maybePostfixModifierPosition;
1167
- let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
1179
+ let classGroupId;
1180
+ if (hasPostfixModifier) {
1181
+ const baseClassNameWithoutPostfix = baseClassName.substring(0, maybePostfixModifierPosition);
1182
+ classGroupId = getClassGroupId(baseClassNameWithoutPostfix);
1183
+ const classGroupIdWithPostfix = classGroupId && postfixLookupClassGroupIds[classGroupId] ? getClassGroupId(baseClassName) : void 0;
1184
+ if (classGroupIdWithPostfix && classGroupIdWithPostfix !== classGroupId) {
1185
+ classGroupId = classGroupIdWithPostfix;
1186
+ hasPostfixModifier = false;
1187
+ }
1188
+ } else {
1189
+ classGroupId = getClassGroupId(baseClassName);
1190
+ }
1168
1191
  if (!classGroupId) {
1169
1192
  if (!hasPostfixModifier) {
1170
1193
  result = originalClassName + (result.length > 0 ? " " + result : result);
@@ -1279,6 +1302,7 @@ const isNever = () => false;
1279
1302
  const isShadow = (value) => shadowRegex.test(value);
1280
1303
  const isImage = (value) => imageRegex.test(value);
1281
1304
  const isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
1305
+ const isNamedContainerQuery = (value) => value.startsWith("@container") && (value[10] === "/" && value[11] !== void 0 || value[11] === "s" && value[16] !== void 0 && value.startsWith("-size/", 10) || value[11] === "n" && value[18] !== void 0 && value.startsWith("-normal/", 10));
1282
1306
  const isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
1283
1307
  const isArbitraryValue = (value) => arbitraryValueRegex.test(value);
1284
1308
  const isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
@@ -1457,6 +1481,18 @@ const getDefaultConfig = () => {
1457
1481
  * @deprecated since Tailwind CSS v4.0.0
1458
1482
  */
1459
1483
  container: ["container"],
1484
+ /**
1485
+ * Container Type
1486
+ * @see https://tailwindcss.com/docs/responsive-design#container-queries
1487
+ */
1488
+ "container-type": [{
1489
+ "@container": ["", "normal", "size", isArbitraryVariable, isArbitraryValue]
1490
+ }],
1491
+ /**
1492
+ * Container Name
1493
+ * @see https://tailwindcss.com/docs/responsive-design#named-containers
1494
+ */
1495
+ "container-named": [isNamedContainerQuery],
1460
1496
  /**
1461
1497
  * Columns
1462
1498
  * @see https://tailwindcss.com/docs/columns
@@ -2400,6 +2436,13 @@ const getDefaultConfig = () => {
2400
2436
  indent: [{
2401
2437
  indent: scaleUnambiguousSpacing()
2402
2438
  }],
2439
+ /**
2440
+ * Tab Size
2441
+ * @see https://tailwindcss.com/docs/tab-size
2442
+ */
2443
+ "tab-size": [{
2444
+ tab: [isInteger, isArbitraryVariable, isArbitraryValue]
2445
+ }],
2403
2446
  /**
2404
2447
  * Vertical Alignment
2405
2448
  * @see https://tailwindcss.com/docs/vertical-align
@@ -3625,6 +3668,13 @@ const getDefaultConfig = () => {
3625
3668
  * @see https://tailwindcss.com/docs/translate
3626
3669
  */
3627
3670
  "translate-none": ["translate-none"],
3671
+ /**
3672
+ * Zoom
3673
+ * @see https://tailwindcss.com/docs/zoom
3674
+ */
3675
+ zoom: [{
3676
+ zoom: [isInteger, isArbitraryVariable, isArbitraryValue]
3677
+ }],
3628
3678
  // ---------------------
3629
3679
  // --- Interactivity ---
3630
3680
  // ---------------------
@@ -3691,6 +3741,34 @@ const getDefaultConfig = () => {
3691
3741
  "scroll-behavior": [{
3692
3742
  scroll: ["auto", "smooth"]
3693
3743
  }],
3744
+ /**
3745
+ * Scrollbar Thumb Color
3746
+ * @see https://tailwindcss.com/docs/scrollbar-color
3747
+ */
3748
+ "scrollbar-thumb-color": [{
3749
+ "scrollbar-thumb": scaleColor()
3750
+ }],
3751
+ /**
3752
+ * Scrollbar Track Color
3753
+ * @see https://tailwindcss.com/docs/scrollbar-color
3754
+ */
3755
+ "scrollbar-track-color": [{
3756
+ "scrollbar-track": scaleColor()
3757
+ }],
3758
+ /**
3759
+ * Scrollbar Gutter
3760
+ * @see https://tailwindcss.com/docs/scrollbar-gutter
3761
+ */
3762
+ "scrollbar-gutter": [{
3763
+ "scrollbar-gutter": ["auto", "stable", "both"]
3764
+ }],
3765
+ /**
3766
+ * Scrollbar Width
3767
+ * @see https://tailwindcss.com/docs/scrollbar-width
3768
+ */
3769
+ "scrollbar-w": [{
3770
+ scrollbar: ["auto", "thin", "none"]
3771
+ }],
3694
3772
  /**
3695
3773
  * Scroll Margin
3696
3774
  * @see https://tailwindcss.com/docs/scroll-margin
@@ -3949,6 +4027,7 @@ const getDefaultConfig = () => {
3949
4027
  }]
3950
4028
  },
3951
4029
  conflictingClassGroups: {
4030
+ "container-named": ["container-type"],
3952
4031
  overflow: ["overflow-x", "overflow-y"],
3953
4032
  overscroll: ["overscroll-x", "overscroll-y"],
3954
4033
  inset: ["inset-x", "inset-y", "inset-bs", "inset-be", "start", "end", "top", "right", "bottom", "left"],
@@ -4001,6 +4080,7 @@ const getDefaultConfig = () => {
4001
4080
  conflictingClassGroupModifiers: {
4002
4081
  "font-size": ["leading"]
4003
4082
  },
4083
+ postfixLookupClassGroups: ["container-type"],
4004
4084
  orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
4005
4085
  };
4006
4086
  };
@@ -13647,6 +13727,7 @@ const DEFAULT_AUTO_OPEN_TOOLS = {
13647
13727
  create_document_from_markdown: openOnResult("document"),
13648
13728
  create_new_sheet: openOnResult("spreadsheet"),
13649
13729
  create_powerpoint_deck: openOnResult("presentation"),
13730
+ create_presentation_pptx_studio: openOnResult("presentation"),
13650
13731
  create_new_notebook: openOnResult("notebook"),
13651
13732
  // Open / read existing assets
13652
13733
  open_asset_in_workspace: openFromArgs("unknown"),
@@ -52531,6 +52612,51 @@ function normalizeContentResult(result) {
52531
52612
  }
52532
52613
  return [];
52533
52614
  }
52615
+ function useFreshPresignedUrl({
52616
+ s3Key,
52617
+ fallbackUrl
52618
+ }) {
52619
+ const [freshUrl, setFreshUrl] = useState(null);
52620
+ const config2 = useAthenaConfig();
52621
+ const configRef = useRef(config2);
52622
+ configRef.current = config2;
52623
+ useEffect(() => {
52624
+ setFreshUrl(null);
52625
+ if (!s3Key) return;
52626
+ let cancelled = false;
52627
+ (async () => {
52628
+ try {
52629
+ const { backendUrl, token, apiKey } = configRef.current;
52630
+ const baseUrl = backendUrl.replace(/\/api\/assistant-ui\/?$/, "");
52631
+ const url = `${baseUrl}/api/asset/fetch-attachment-presigned-url`;
52632
+ const headers = {
52633
+ "Content-Type": "application/json"
52634
+ };
52635
+ if (token) {
52636
+ headers["Authorization"] = `Bearer ${token}`;
52637
+ } else if (apiKey) {
52638
+ headers["X-API-KEY"] = apiKey;
52639
+ }
52640
+ const resp = await fetch(url, {
52641
+ method: "POST",
52642
+ headers,
52643
+ body: JSON.stringify({ s3_key: s3Key })
52644
+ });
52645
+ if (!cancelled && resp.ok) {
52646
+ const data = await resp.json();
52647
+ if (!cancelled && data.presigned_url) {
52648
+ setFreshUrl(data.presigned_url);
52649
+ }
52650
+ }
52651
+ } catch {
52652
+ }
52653
+ })();
52654
+ return () => {
52655
+ cancelled = true;
52656
+ };
52657
+ }, [s3Key]);
52658
+ return freshUrl ?? fallbackUrl;
52659
+ }
52534
52660
  function getSlideScreenshotResult(result) {
52535
52661
  let text2 = null;
52536
52662
  let imageUrl = null;
@@ -52570,10 +52696,11 @@ const CaptureSlideScreenshotToolUIImpl = ({
52570
52696
  const typedArgs = args;
52571
52697
  const assetId = getStringField(typedArgs, ["asset_id", "assetId"]);
52572
52698
  const slideNumber = getNumberField(typedArgs, ["slide_number", "slideNumber"]) ?? void 0;
52573
- const { text: text2, imageUrl, mediaType } = useMemo(
52699
+ const { text: text2, imageUrl, mediaType, s3Key } = useMemo(
52574
52700
  () => getSlideScreenshotResult(result),
52575
52701
  [result]
52576
52702
  );
52703
+ const freshImageUrl = useFreshPresignedUrl({ s3Key, fallbackUrl: imageUrl });
52577
52704
  const isRunning = (status == null ? void 0 : status.type) === "running";
52578
52705
  const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
52579
52706
  const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
@@ -52605,11 +52732,11 @@ const CaptureSlideScreenshotToolUIImpl = ({
52605
52732
  result,
52606
52733
  error: errorMsg,
52607
52734
  children: [
52608
- isComplete && !isCancelled && imageUrl && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 p-3", children: [
52735
+ isComplete && !isCancelled && freshImageUrl && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 p-3", children: [
52609
52736
  /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-lg border border-border/50 bg-muted/20", children: /* @__PURE__ */ jsx(
52610
52737
  "img",
52611
52738
  {
52612
- src: imageUrl,
52739
+ src: freshImageUrl,
52613
52740
  alt: slideNumber ? `Slide ${slideNumber} screenshot` : "Slide screenshot",
52614
52741
  className: "aspect-video w-full object-contain",
52615
52742
  loading: "lazy"
@@ -52630,10 +52757,10 @@ const CaptureSlideScreenshotToolUIImpl = ({
52630
52757
  ]
52631
52758
  }
52632
52759
  ),
52633
- imageUrl && /* @__PURE__ */ jsxs(
52760
+ freshImageUrl && /* @__PURE__ */ jsxs(
52634
52761
  "a",
52635
52762
  {
52636
- href: imageUrl,
52763
+ href: freshImageUrl,
52637
52764
  target: "_blank",
52638
52765
  rel: "noreferrer",
52639
52766
  className: "flex items-center gap-1.5 rounded-md border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
@@ -52663,6 +52790,7 @@ const TOOL_UI_REGISTRY = {
52663
52790
  create_document_from_markdown: CreateDocumentToolUI,
52664
52791
  create_new_sheet: CreateSheetToolUI,
52665
52792
  create_powerpoint_deck: CreatePresentationToolUI,
52793
+ create_presentation_pptx_studio: CreatePresentationToolUI,
52666
52794
  create_new_notebook: CreateNotebookToolUI,
52667
52795
  // Studio SDK nested PTC tools
52668
52796
  CreateWorkbook: StudioCreateWorkbookToolUI,
@@ -52872,6 +53000,7 @@ const TOOL_STATUS_LABELS = {
52872
53000
  run_sql_query_tool: { running: "Running database query", complete: "Query complete" },
52873
53001
  // Presentation
52874
53002
  create_powerpoint_deck: { running: "Creating presentation", complete: "Created presentation" },
53003
+ create_presentation_pptx_studio: { running: "Creating presentation", complete: "Created presentation" },
52875
53004
  execute_presentation_code: { running: "Updating presentation", complete: "Updated presentation" },
52876
53005
  capture_slide_screenshot: { running: "Capturing slide", complete: "Slide captured" },
52877
53006
  // Notebook
@@ -52922,13 +53051,14 @@ const DEFAULT_TOOL_TO_TOOLKIT = {
52922
53051
  AddSheet: "Spreadsheet",
52923
53052
  OpenWorkbook: "Spreadsheet",
52924
53053
  // Presentation
52925
- create_powerpoint_deck: "Presentation (PowerPoint)",
52926
- execute_presentation_code: "Presentation (PowerPoint)",
52927
- capture_slide_screenshot: "Presentation (PowerPoint)",
53054
+ create_powerpoint_deck: "Presentation",
53055
+ create_presentation_pptx_studio: "Presentation",
53056
+ execute_presentation_code: "Presentation",
53057
+ capture_slide_screenshot: "Presentation",
52928
53058
  // Studio presentation PTC
52929
- CreatePresentation: "Presentation (PowerPoint)",
52930
- OpenPresentation: "Presentation (PowerPoint)",
52931
- AddSlide: "Presentation (PowerPoint)",
53059
+ CreatePresentation: "Presentation",
53060
+ OpenPresentation: "Presentation",
53061
+ AddSlide: "Presentation",
52932
53062
  // Notebook
52933
53063
  create_new_notebook: "Notebook",
52934
53064
  run_notebook_cell: "Notebook",
@@ -53509,8 +53639,12 @@ const Toolkits = {
53509
53639
  NOTEBOOK: "notebook_toolkit",
53510
53640
  /** Presentation slide editing. */
53511
53641
  PRESENTATION: "presentation_toolkit",
53642
+ /** Presentation slide editing (OnlyOffice, deprecated). */
53643
+ PRESENTATION_ONLYOFFICE: "presentation_onlyoffice_toolkit",
53512
53644
  /** PowerPoint presentation creation from templates. */
53513
53645
  POWERPOINT: "powerpoint_deck_toolkit",
53646
+ /** PowerPoint presentation creation from templates (pptx-studio). */
53647
+ PRESENTATION_PPTX_STUDIO: "presentation_pptx_studio_toolkit",
53514
53648
  /** Workspace file management (Olympus Drive). */
53515
53649
  DRIVE: "olympus_drive_toolkit",
53516
53650
  /** Python code execution. */
@@ -53615,11 +53749,21 @@ const TOOLKIT_DISPLAY_INFO = {
53615
53749
  description: "Edit presentation slides.",
53616
53750
  icon: "Presentation"
53617
53751
  },
53752
+ [Toolkits.PRESENTATION_ONLYOFFICE]: {
53753
+ name: "Presentation v0 (deprecated)",
53754
+ description: "Edit presentation slides (OnlyOffice, deprecated).",
53755
+ icon: "Presentation"
53756
+ },
53618
53757
  [Toolkits.POWERPOINT]: {
53619
53758
  name: "PowerPoint",
53620
53759
  description: "Create PowerPoint decks from templates.",
53621
53760
  icon: "Presentation"
53622
53761
  },
53762
+ [Toolkits.PRESENTATION_PPTX_STUDIO]: {
53763
+ name: "Presentation",
53764
+ description: "Create PowerPoint presentations from templates (pptx-studio).",
53765
+ icon: "Presentation"
53766
+ },
53623
53767
  [Toolkits.DRIVE]: {
53624
53768
  name: "Olympus Drive",
53625
53769
  description: "Find and manage workspace files.",