import { jsx as _jsx } from "react/jsx-runtime";
import { Braces, FileCode2, PlayCircle, ShieldAlert } from "lucide-react";
import { GroupedFieldConfigPanel, } from "./GroupedFieldConfigPanel";
const FIELD_GROUPS = [
    {
        title: "Identity",
        description: "Explain when agents should use it, what it returns, and when relevant how the script accesses vars or calls other tools.",
        icon: _jsx(FileCode2, { className: "h-4 w-4", strokeWidth: 1.5 }),
        fieldNames: [["Description"]],
    },
    {
        title: "Signature",
        description: "JSON schema exposed to agents as the callable method signature.",
        icon: _jsx(Braces, { className: "h-4 w-4", strokeWidth: 1.5 }),
        fieldNames: [["Schema"]],
    },
    {
        title: "Runtime",
        description: "Hidden JavaScript source that executes when the tool is called. Read input parameters from vars, inspect tools.availableTools, and call allowed tools with await tools.call('tool-name', { ... }).",
        icon: _jsx(PlayCircle, { className: "h-4 w-4", strokeWidth: 1.5 }),
        fieldNames: [["Script"]],
    },
    {
        title: "Approval",
        description: "Optional approval logic evaluated before execution in supervised mode.",
        icon: _jsx(ShieldAlert, { className: "h-4 w-4", strokeWidth: 1.5 }),
        fieldNames: [["Approval Script"]],
    },
];
export function JavaScriptToolConfigPanel({ itemId, title, refreshToken = 0, actions, }) {
    return (_jsx(GroupedFieldConfigPanel, { itemId: itemId, title: title, refreshToken: refreshToken, actions: actions, fieldGroups: FIELD_GROUPS, headerIcon: _jsx(FileCode2, { className: "h-4 w-4", strokeWidth: 1.5 }), loadErrorTitle: "Unable to load JavaScript tool", emptyMessage: "No editable JavaScript tool fields were found for this item.", fallbackTitle: "JavaScript Tool", supplementalContent: _jsx("div", { className: "rounded-lg border border-blue-200 bg-blue-50 px-4 py-3 text-xs text-blue-900", children: "Normal agents only see the tool name, description, and schema. The script source and approval script stay hidden from them." }), footerLeadingText: "For item name changes, insert options, and all fields use the " }));
}
export default JavaScriptToolConfigPanel;
//# sourceMappingURL=JavaScriptToolConfigPanel.js.map