@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 +3 -1
- package/dist/components/App.d.ts +6 -1
- package/dist/contexts/AssistantContext.d.ts +4 -2
- package/dist/hawkai-assistant.js +24 -24
- package/dist/index.d.ts +1 -1
- package/dist/index.js +689 -618
- package/dist/session-manager.d.ts +1 -0
- package/dist/sync.d.ts +8 -0
- package/dist/types.d.ts +4 -1
- package/dist/utilities/logging.d.ts +3 -0
- package/package.json +7 -2
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
|
package/dist/components/App.d.ts
CHANGED
|
@@ -14,8 +14,10 @@ interface AssistantContextValue {
|
|
|
14
14
|
updateToolUse: (toolUseId: string, patch: Partial<ToolUse<unknown, unknown>>) => void;
|
|
15
15
|
clearChat: () => void;
|
|
16
16
|
}
|
|
17
|
-
|
|
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 {};
|