@anuma/sdk 11.0.1 → 11.2.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.
@@ -2507,7 +2507,13 @@ type StreamingTransport = (options: StreamingTransportOptions) => StreamingTrans
2507
2507
  /**
2508
2508
  * Tool executor function type
2509
2509
  */
2510
- type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal) => Promise<unknown> | unknown;
2510
+ type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal, context?: ToolExecutionContext) => Promise<unknown> | unknown;
2511
+ /** How the portal treats a call to this device tool while the device is away. */
2512
+ type DetachedToolClass = "render" | "deferred";
2513
+ /** Context for one executor run; `detached` marks a call from an answer finished while the device was away. */
2514
+ type ToolExecutionContext = {
2515
+ detached?: boolean;
2516
+ };
2511
2517
  /**
2512
2518
  * Tool configuration with optional executor
2513
2519
  */
@@ -2577,6 +2583,8 @@ type ToolConfig = LlmapiChatCompletionTool & {
2577
2583
  * files from IndexedDB that `create_file` writes.
2578
2584
  */
2579
2585
  dependsOn?: string[];
2586
+ /** How the portal handles a call to this tool while the device is away; unset tools pause the turn. */
2587
+ detachedClass?: DetachedToolClass;
2580
2588
  };
2581
2589
  /**
2582
2590
  * Responses API options that can be passed to sendMessage
@@ -9136,6 +9144,8 @@ interface ResumeStreamOptions {
9136
9144
  onFinish?: (response: ApiResponse) => void;
9137
9145
  /** Called on a transient/unexpected failure. Never called for 410 (throws) nor interrupted terminals. */
9138
9146
  onError?: (error: Error) => void;
9147
+ /** Tools a finished replay may end on because the device runs them when the answer is stored. */
9148
+ finishedToolNames?: string[];
9139
9149
  }
9140
9150
  /**
9141
9151
  * Result of {@link resumeStream}. A `410 Gone` is the only outcome that throws
@@ -14419,6 +14429,7 @@ declare function renderAnumaTree(node: AnumaNode): React.ReactElement | null;
14419
14429
  declare function renderAnumaJsx(jsx: string): React.ReactElement | null;
14420
14430
 
14421
14431
  type ChartDataPoint = Record<string, string | number>;
14432
+ type ChartValueFormat = "number" | "currency" | "percent";
14422
14433
  type DisplayChartResult = {
14423
14434
  chartType: "bar" | "line" | "area" | "pie";
14424
14435
  title?: string;
@@ -14426,6 +14437,8 @@ type DisplayChartResult = {
14426
14437
  dataKeys: string[];
14427
14438
  xAxisKey?: string;
14428
14439
  colors?: Record<string, string>;
14440
+ valueFormat?: ChartValueFormat;
14441
+ currency?: string;
14429
14442
  } | {
14430
14443
  error: string;
14431
14444
  };
@@ -14455,12 +14468,13 @@ declare function ChartContainer({ id, className, children, config, ...props }: R
14455
14468
  children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
14456
14469
  }): react_jsx_runtime.JSX.Element;
14457
14470
  declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
14458
- declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
14471
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, valueFormatter, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
14459
14472
  hideLabel?: boolean;
14460
14473
  hideIndicator?: boolean;
14461
14474
  indicator?: "line" | "dot" | "dashed";
14462
14475
  nameKey?: string;
14463
14476
  labelKey?: string;
14477
+ valueFormatter?: (value: number) => string;
14464
14478
  }): react_jsx_runtime.JSX.Element | null;
14465
14479
  declare const ChartLegend: typeof RechartsPrimitive.Legend;
14466
14480
  declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
@@ -14926,6 +14940,11 @@ interface UseChatStorageOptions extends BaseUseChatStorageOptions {
14926
14940
  background?: boolean;
14927
14941
  /** The vault inbox that receives answers finished while no client was attached. */
14928
14942
  inbox?: VaultInbox;
14943
+ /**
14944
+ * Device tools that can finish a turn the portal completed while the device was away: their
14945
+ * executors run when that answer is stored. Pass the display tools and the memory save tool.
14946
+ */
14947
+ detachedTools?: ToolConfig[];
14929
14948
  /** Stream handle for each HTTP round, including client-tool continuations. */
14930
14949
  onStreamMeta?: (meta: StreamMeta) => void;
14931
14950
  /**
@@ -2507,7 +2507,13 @@ type StreamingTransport = (options: StreamingTransportOptions) => StreamingTrans
2507
2507
  /**
2508
2508
  * Tool executor function type
2509
2509
  */
2510
- type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal) => Promise<unknown> | unknown;
2510
+ type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal, context?: ToolExecutionContext) => Promise<unknown> | unknown;
2511
+ /** How the portal treats a call to this device tool while the device is away. */
2512
+ type DetachedToolClass = "render" | "deferred";
2513
+ /** Context for one executor run; `detached` marks a call from an answer finished while the device was away. */
2514
+ type ToolExecutionContext = {
2515
+ detached?: boolean;
2516
+ };
2511
2517
  /**
2512
2518
  * Tool configuration with optional executor
2513
2519
  */
@@ -2577,6 +2583,8 @@ type ToolConfig = LlmapiChatCompletionTool & {
2577
2583
  * files from IndexedDB that `create_file` writes.
2578
2584
  */
2579
2585
  dependsOn?: string[];
2586
+ /** How the portal handles a call to this tool while the device is away; unset tools pause the turn. */
2587
+ detachedClass?: DetachedToolClass;
2580
2588
  };
2581
2589
  /**
2582
2590
  * Responses API options that can be passed to sendMessage
@@ -9136,6 +9144,8 @@ interface ResumeStreamOptions {
9136
9144
  onFinish?: (response: ApiResponse) => void;
9137
9145
  /** Called on a transient/unexpected failure. Never called for 410 (throws) nor interrupted terminals. */
9138
9146
  onError?: (error: Error) => void;
9147
+ /** Tools a finished replay may end on because the device runs them when the answer is stored. */
9148
+ finishedToolNames?: string[];
9139
9149
  }
9140
9150
  /**
9141
9151
  * Result of {@link resumeStream}. A `410 Gone` is the only outcome that throws
@@ -14419,6 +14429,7 @@ declare function renderAnumaTree(node: AnumaNode): React.ReactElement | null;
14419
14429
  declare function renderAnumaJsx(jsx: string): React.ReactElement | null;
14420
14430
 
14421
14431
  type ChartDataPoint = Record<string, string | number>;
14432
+ type ChartValueFormat = "number" | "currency" | "percent";
14422
14433
  type DisplayChartResult = {
14423
14434
  chartType: "bar" | "line" | "area" | "pie";
14424
14435
  title?: string;
@@ -14426,6 +14437,8 @@ type DisplayChartResult = {
14426
14437
  dataKeys: string[];
14427
14438
  xAxisKey?: string;
14428
14439
  colors?: Record<string, string>;
14440
+ valueFormat?: ChartValueFormat;
14441
+ currency?: string;
14429
14442
  } | {
14430
14443
  error: string;
14431
14444
  };
@@ -14455,12 +14468,13 @@ declare function ChartContainer({ id, className, children, config, ...props }: R
14455
14468
  children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
14456
14469
  }): react_jsx_runtime.JSX.Element;
14457
14470
  declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
14458
- declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
14471
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, valueFormatter, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
14459
14472
  hideLabel?: boolean;
14460
14473
  hideIndicator?: boolean;
14461
14474
  indicator?: "line" | "dot" | "dashed";
14462
14475
  nameKey?: string;
14463
14476
  labelKey?: string;
14477
+ valueFormatter?: (value: number) => string;
14464
14478
  }): react_jsx_runtime.JSX.Element | null;
14465
14479
  declare const ChartLegend: typeof RechartsPrimitive.Legend;
14466
14480
  declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
@@ -14926,6 +14940,11 @@ interface UseChatStorageOptions extends BaseUseChatStorageOptions {
14926
14940
  background?: boolean;
14927
14941
  /** The vault inbox that receives answers finished while no client was attached. */
14928
14942
  inbox?: VaultInbox;
14943
+ /**
14944
+ * Device tools that can finish a turn the portal completed while the device was away: their
14945
+ * executors run when that answer is stored. Pass the display tools and the memory save tool.
14946
+ */
14947
+ detachedTools?: ToolConfig[];
14929
14948
  /** Stream handle for each HTTP round, including client-tool continuations. */
14930
14949
  onStreamMeta?: (meta: StreamMeta) => void;
14931
14950
  /**