Files
sim/apps/sim/lib/copilot/tools/client/manager.ts
Waleed 6262503b89 feat(deployed-form): added deployed form input (#2679)
* feat(deployed-form): added deployed form input

* styling consolidation, finishing touches on form

* updated docs

* remove unused files with knip

* added more form fields

* consolidated more test utils

* remove unused/unneeded zustand stores, refactored stores for consistency

* improvement(files): uncolorized plan name

* feat(emcn): button-group

* feat(emcn): tag input, tooltip shortcut

* improvement(emcn): modal padding, api, chat, form

* fix: deleted migrations

* feat(form): added migrations

* fix(emcn): tag input

* fix: failing tests on build

* add suplementary hover and fix bg color in date picker

* fix: build errors

---------

Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
2026-01-09 23:42:21 -08:00

25 lines
678 B
TypeScript

const instances: Record<string, any> = {}
let syncStateFn: ((toolCallId: string, nextState: any, options?: { result?: any }) => void) | null =
null
export function registerClientTool(toolCallId: string, instance: any) {
instances[toolCallId] = instance
}
export function getClientTool(toolCallId: string): any | undefined {
return instances[toolCallId]
}
export function registerToolStateSync(
fn: (toolCallId: string, nextState: any, options?: { result?: any }) => void
) {
syncStateFn = fn
}
export function syncToolState(toolCallId: string, nextState: any, options?: { result?: any }) {
try {
syncStateFn?.(toolCallId, nextState, options)
} catch {}
}