@bridgeline-digital/hawkai-assistant 1.0.0-beta.1 → 1.0.0-beta.3

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/README.md CHANGED
@@ -241,11 +241,13 @@ interface Tool<TInput, TOutput> {
241
241
  properties: Record<string, unknown>;
242
242
  required?: string[];
243
243
  };
244
- execute: (input: TInput) => Promise<TOutput>;
244
+ execute: (input: TInput, options?: { signal?: AbortSignal }) => Promise<TOutput>;
245
245
  render?: (data: RenderToolData<TInput>, helpers: RenderToolHelpers) => AsyncRenderToolResult;
246
246
  }
247
247
  ```
248
248
 
249
+ `execute` receives an optional `options.signal` (an `AbortSignal`) as its second argument. The signal aborts when the user stops the response; long-running tools may pass it to `fetch` (or otherwise observe it) to cancel in-flight work. Ignoring it is fine for synchronous or fast tools.
250
+
249
251
  Pass tools in the `tools` array of `Config`:
250
252
 
251
253
  ```js
@@ -1,2 +1,7 @@
1
1
  import { FunctionalComponent } from 'preact';
2
- export declare const App: FunctionalComponent;
2
+ import { Turn } from '../api/types';
3
+ interface AppProps {
4
+ initialTurns: Turn[];
5
+ }
6
+ export declare const App: FunctionalComponent<AppProps>;
7
+ export {};
@@ -14,8 +14,10 @@ interface AssistantContextValue {
14
14
  updateToolUse: (toolUseId: string, patch: Partial<ToolUse<unknown, unknown>>) => void;
15
15
  clearChat: () => void;
16
16
  }
17
- export declare const AssistantProvider: FunctionalComponent<{
17
+ interface AssistantProviderProps {
18
18
  children: ComponentChildren;
19
- }>;
19
+ initialTurns: Turn[];
20
+ }
21
+ export declare const AssistantProvider: FunctionalComponent<AssistantProviderProps>;
20
22
  export declare const useAssistant: () => AssistantContextValue;
21
23
  export {};