@usecrow/ui 0.1.62 → 0.1.63

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.cts CHANGED
@@ -309,7 +309,7 @@ type ClientToolHandler = (args: Record<string, unknown>) => Promise<{
309
309
  };
310
310
  declare global {
311
311
  interface Window {
312
- crow: (command: string, options?: unknown) => void;
312
+ crow: (command: string, options?: unknown) => AbortController | void;
313
313
  __crow_identity_token?: string;
314
314
  __crow_public_metadata?: Record<string, unknown>;
315
315
  __crow_journey_callback?: (event: JourneyEvent) => void;
package/dist/index.d.ts CHANGED
@@ -309,7 +309,7 @@ type ClientToolHandler = (args: Record<string, unknown>) => Promise<{
309
309
  };
310
310
  declare global {
311
311
  interface Window {
312
- crow: (command: string, options?: unknown) => void;
312
+ crow: (command: string, options?: unknown) => AbortController | void;
313
313
  __crow_identity_token?: string;
314
314
  __crow_public_metadata?: Record<string, unknown>;
315
315
  __crow_journey_callback?: (event: JourneyEvent) => void;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React3, { createContext, forwardRef, useEffect, useRef, useCallback, useContext, useState, useMemo, useLayoutEffect } from 'react';
2
2
  import { motion, AnimatePresence } from 'framer-motion';
3
- import { DEFAULT_TOOLS, CrowClient } from '@usecrow/client';
3
+ import { DEFAULT_TOOLS, crowAsk, CrowClient } from '@usecrow/client';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { createPortal } from 'react-dom';
6
6
  import { Mic, Square, ArrowUp, ChevronDown, Check, MessageCircle, Plus, RotateCcw, History, X, Brain, ChevronRight, Loader2 } from 'lucide-react';
@@ -1230,6 +1230,13 @@ function useCrowAPI({ onIdentified, onReset } = {}) {
1230
1230
  new CustomEvent("crow:setGreeting", { detail: options })
1231
1231
  );
1232
1232
  break;
1233
+ case "ask": {
1234
+ if (!opts || typeof opts !== "object") {
1235
+ console.error("[Crow] ask() requires an options object");
1236
+ return;
1237
+ }
1238
+ return crowAsk(opts);
1239
+ }
1233
1240
  case "setSuggestedActions":
1234
1241
  if (!Array.isArray(options)) {
1235
1242
  console.error("[Crow] setSuggestedActions() requires an array of { label, message }");