����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import { recordAgentActivity } from '@agent/api';
import { useWorkflowStore } from '@agent/state/workflows';
import { useCallback, useMemo } from '@wordpress/element';
export const useWhenFinishedToolProps = () => {
const { whenFinishedToolProps, setWhenFinishedToolProps, getWorkflow } =
useWorkflowStore();
const onConfirm = useCallback(
(props = {}) => {
if (!whenFinishedToolProps) return;
const workflow = getWorkflow();
recordAgentActivity({
sessionId: workflow?.sessionId,
action: 'workflow_tool_event',
value: { trigger: 'confirm', workflow: workflow?.id },
});
window.dispatchEvent(
new CustomEvent('extendify-agent:workflow-confirm', {
detail: { ...props, whenFinishedToolProps },
}),
);
},
[whenFinishedToolProps, getWorkflow],
);
const onCancel = useCallback(() => {
if (!whenFinishedToolProps) return;
const workflow = getWorkflow();
recordAgentActivity({
sessionId: workflow?.sessionId,
action: 'workflow_tool_event',
value: { trigger: 'cancel', workflow: workflow?.id },
});
window.dispatchEvent(
new CustomEvent('extendify-agent:workflow-cancel', {
detail: { whenFinishedToolProps },
}),
);
}, [whenFinishedToolProps, getWorkflow]);
const onRetry = useCallback(() => {
if (!whenFinishedToolProps) return;
setWhenFinishedToolProps(null);
const workflow = getWorkflow();
recordAgentActivity({
sessionId: workflow?.sessionId,
action: 'workflow_tool_event',
value: { trigger: 'retry', workflow: workflow?.id },
});
window.dispatchEvent(
new CustomEvent('extendify-agent:workflow-retry', {
detail: { whenFinishedToolProps },
}),
);
}, [whenFinishedToolProps, setWhenFinishedToolProps, getWorkflow]);
const onLoad = useCallback(() => {
if (!whenFinishedToolProps) return;
const c = Array.from(
document.querySelectorAll(
'#extendify-agent-chat-scroll-area div:last-child',
),
)?.at(-1);
c?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}, [whenFinishedToolProps]);
return useMemo(() => {
if (!whenFinishedToolProps) return null;
return { ...whenFinishedToolProps, onConfirm, onCancel, onRetry, onLoad };
}, [whenFinishedToolProps, onConfirm, onCancel, onRetry, onLoad]);
};
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| useDraggable.js | File | 3.77 KB | 0644 |
|
| useFontVariationOverride.js | File | 3.92 KB | 0644 |
|
| useIframeScale.js | File | 786 B | 0644 |
|
| useLockPost.js | File | 607 B | 0644 |
|
| usePortal.js | File | 478 B | 0644 |
|
| useResizable.js | File | 3.17 KB | 0644 |
|
| useSiteVibesOverride.js | File | 2.39 KB | 0644 |
|
| useSiteVibesVariations.js | File | 1.82 KB | 0644 |
|
| useThemeFontsVariations.js | File | 1.17 KB | 0644 |
|
| useThemeVariations.js | File | 1.14 KB | 0644 |
|
| useVariationOverride.js | File | 3.14 KB | 0644 |
|
| useWhenFinishedToolProps.js | File | 2.2 KB | 0644 |
|