@opentabs-dev/browser-extension 0.0.61 → 0.0.62
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/dist/background-message-handlers.d.ts +8 -14
- package/dist/background-message-handlers.d.ts.map +1 -1
- package/dist/background-message-handlers.js +50 -156
- package/dist/background-message-handlers.js.map +1 -1
- package/dist/background.js +173 -216
- package/dist/confirmation-badge.d.ts +3 -24
- package/dist/confirmation-badge.d.ts.map +1 -1
- package/dist/confirmation-badge.js +13 -98
- package/dist/confirmation-badge.js.map +1 -1
- package/dist/extension-messages.d.ts +17 -34
- package/dist/extension-messages.d.ts.map +1 -1
- package/dist/message-router.d.ts +2 -2
- package/dist/message-router.d.ts.map +1 -1
- package/dist/message-router.js +22 -10
- package/dist/message-router.js.map +1 -1
- package/dist/offscreen/index.js +3 -5
- package/dist/offscreen/index.js.map +1 -1
- package/dist/plugin-storage.js +3 -3
- package/dist/plugin-storage.js.map +1 -1
- package/dist/server-state-cache.d.ts +12 -6
- package/dist/server-state-cache.d.ts.map +1 -1
- package/dist/server-state-cache.js +51 -21
- package/dist/server-state-cache.js.map +1 -1
- package/dist/side-panel/App.d.ts.map +1 -1
- package/dist/side-panel/App.js +19 -25
- package/dist/side-panel/App.js.map +1 -1
- package/dist/side-panel/bridge.d.ts +13 -18
- package/dist/side-panel/bridge.d.ts.map +1 -1
- package/dist/side-panel/bridge.js +9 -13
- package/dist/side-panel/bridge.js.map +1 -1
- package/dist/side-panel/components/BrowserToolsCard.d.ts +5 -1
- package/dist/side-panel/components/BrowserToolsCard.d.ts.map +1 -1
- package/dist/side-panel/components/BrowserToolsCard.js +40 -22
- package/dist/side-panel/components/BrowserToolsCard.js.map +1 -1
- package/dist/side-panel/components/ConfirmationDialog.d.ts +4 -11
- package/dist/side-panel/components/ConfirmationDialog.d.ts.map +1 -1
- package/dist/side-panel/components/ConfirmationDialog.js +23 -34
- package/dist/side-panel/components/ConfirmationDialog.js.map +1 -1
- package/dist/side-panel/components/NpmPluginCard.d.ts.map +1 -1
- package/dist/side-panel/components/NpmPluginCard.js +1 -1
- package/dist/side-panel/components/NpmPluginCard.js.map +1 -1
- package/dist/side-panel/components/PluginCard.d.ts +2 -1
- package/dist/side-panel/components/PluginCard.d.ts.map +1 -1
- package/dist/side-panel/components/PluginCard.js +18 -40
- package/dist/side-panel/components/PluginCard.js.map +1 -1
- package/dist/side-panel/components/PluginIcon.d.ts +1 -2
- package/dist/side-panel/components/PluginIcon.d.ts.map +1 -1
- package/dist/side-panel/components/PluginIcon.js +36 -41
- package/dist/side-panel/components/PluginIcon.js.map +1 -1
- package/dist/side-panel/components/PluginList.d.ts +2 -1
- package/dist/side-panel/components/PluginList.d.ts.map +1 -1
- package/dist/side-panel/components/PluginList.js +2 -2
- package/dist/side-panel/components/PluginList.js.map +1 -1
- package/dist/side-panel/components/PluginMenu.d.ts.map +1 -1
- package/dist/side-panel/components/PluginMenu.js +1 -1
- package/dist/side-panel/components/PluginMenu.js.map +1 -1
- package/dist/side-panel/components/SearchResults.d.ts +2 -1
- package/dist/side-panel/components/SearchResults.d.ts.map +1 -1
- package/dist/side-panel/components/SearchResults.js +2 -2
- package/dist/side-panel/components/SearchResults.js.map +1 -1
- package/dist/side-panel/components/ToolIcon.d.ts.map +1 -1
- package/dist/side-panel/components/ToolIcon.js +9 -2
- package/dist/side-panel/components/ToolIcon.js.map +1 -1
- package/dist/side-panel/components/ToolRow.d.ts +14 -4
- package/dist/side-panel/components/ToolRow.d.ts.map +1 -1
- package/dist/side-panel/components/ToolRow.js +13 -3
- package/dist/side-panel/components/ToolRow.js.map +1 -1
- package/dist/side-panel/components/retro/Select.d.ts +13 -0
- package/dist/side-panel/components/retro/Select.d.ts.map +1 -0
- package/dist/side-panel/components/retro/Select.js +27 -0
- package/dist/side-panel/components/retro/Select.js.map +1 -0
- package/dist/side-panel/constants.d.ts +0 -2
- package/dist/side-panel/constants.d.ts.map +1 -1
- package/dist/side-panel/constants.js +0 -2
- package/dist/side-panel/constants.js.map +1 -1
- package/dist/side-panel/hooks/useServerNotifications.d.ts +1 -3
- package/dist/side-panel/hooks/useServerNotifications.d.ts.map +1 -1
- package/dist/side-panel/hooks/useServerNotifications.js +13 -41
- package/dist/side-panel/hooks/useServerNotifications.js.map +1 -1
- package/dist/side-panel/side-panel.js +5715 -4723
- package/dist/side-panel/styles.css +1 -1
- package/dist/tool-dispatch.d.ts +2 -1
- package/dist/tool-dispatch.d.ts.map +1 -1
- package/dist/tool-dispatch.js +4 -6
- package/dist/tool-dispatch.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -1
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../lib/cn.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Select } from './retro/Select.js';
|
|
4
4
|
import { Tooltip } from './retro/Tooltip.js';
|
|
5
5
|
import { ToolIcon } from './ToolIcon.js';
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const PERMISSION_LABELS = {
|
|
7
|
+
off: 'Off',
|
|
8
|
+
ask: 'Ask',
|
|
9
|
+
auto: 'Auto',
|
|
10
|
+
};
|
|
11
|
+
const PermissionSelect = ({ value, onValueChange, disabled, ariaLabel, }) => (_jsxs(Select, { value: value, onValueChange: (v) => onValueChange(v), children: [_jsx(Select.Trigger, { className: "h-6 w-[4.5rem] min-w-0 px-1.5 py-0 font-mono text-xs shadow-none focus:shadow-none", onClick: (e) => e.stopPropagation(), disabled: disabled, "aria-label": ariaLabel, children: _jsx(Select.Value, {}) }), _jsx(Select.Content, { className: "font-mono text-xs", children: ['off', 'ask', 'auto'].map(p => (_jsx(Select.Item, { value: p, children: PERMISSION_LABELS[p] }, p))) })] }));
|
|
12
|
+
const ToolRow = ({ name, displayName, description, summary, icon, permission, active, disabled, onPermissionChange, }) => {
|
|
13
|
+
const enabled = permission !== 'off';
|
|
14
|
+
const displayDescription = summary ?? description;
|
|
15
|
+
return (_jsxs("div", { className: cn('flex items-center gap-2 border-border border-b px-3 py-1.5 transition-colors last:border-b-0 even:bg-muted/10', enabled ? 'hover:bg-primary/10' : 'hover:bg-muted/50', disabled && 'opacity-50'), children: [_jsx(ToolIcon, { icon: icon, enabled: enabled, active: active }), _jsxs(Tooltip, { children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-foreground text-sm", children: displayName }), _jsx("div", { className: "truncate text-muted-foreground text-xs", children: displayDescription })] }) }), _jsx(Tooltip.Content, { children: displayDescription })] }), _jsx("div", { className: "flex shrink-0 items-center gap-2", children: _jsx(PermissionSelect, { value: permission, onValueChange: p => onPermissionChange(name, p), disabled: disabled ?? false, ariaLabel: `Permission for ${name} tool` }) })] }));
|
|
16
|
+
};
|
|
17
|
+
export { PermissionSelect, ToolRow };
|
|
8
18
|
//# sourceMappingURL=ToolRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolRow.js","sourceRoot":"","sources":["../../../src/side-panel/components/ToolRow.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ToolRow.js","sourceRoot":"","sources":["../../../src/side-panel/components/ToolRow.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,iBAAiB,GAAmC;IACxD,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,EACxB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,GAMV,EAAE,EAAE,CAAC,CACJ,MAAC,MAA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AO,EACrE,cAAK,SAAS,EAAC,wCAAwC,YAAE,kBAAkB,GAAO,IAC9E,GACU,EAClB,KAAC,OAAO,CAAC,OAAO,cAAE,kBAAkB,GAAmB,IAC/C,EACV,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,gBAAgB,IACf,KAAK,EAAE,UAAU,EACjB,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,EAC/C,QAAQ,EAAE,QAAQ,IAAI,KAAK,EAC3B,SAAS,EAAE,kBAAkB,IAAI,OAAO,GACxC,GACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
|
+
declare const SelectObj: import("react").FC<SelectPrimitive.SelectProps> & {
|
|
3
|
+
Trigger: ({ className, children, ...props }: SelectPrimitive.SelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
Value: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
Icon: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectIconProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
Content: ({ className, children, position, ...props }: SelectPrimitive.SelectContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Group: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
Item: ({ className, children, ...props }: SelectPrimitive.SelectItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Label: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
Separator: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
};
|
|
12
|
+
export { SelectObj as Select };
|
|
13
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/side-panel/components/retro/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AA0E1D,QAAA,MAAM,SAAS;iDApE2C,eAAe,CAAC,kBAAkB;;;2DAkBb,eAAe,CAAC,kBAAkB;;8CA8B1D,eAAe,CAAC,eAAe;;;CA6BpF,CAAC;AAEH,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
+
import { Check, ChevronDown, ChevronUp } from 'lucide-react';
|
|
4
|
+
import { cn } from '../../lib/cn.js';
|
|
5
|
+
const Select = SelectPrimitive.Root;
|
|
6
|
+
const SelectTrigger = ({ className, children, ...props }) => (_jsxs(SelectPrimitive.Trigger, { className: cn('flex h-10 min-w-40 items-center justify-between rounded border-2 border-border bg-transparent px-4 py-2 shadow-md outline-none placeholder:text-muted-foreground focus:shadow-xs focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "ml-2 h-4 w-4" }) })] }));
|
|
7
|
+
const SelectValue = SelectPrimitive.Value;
|
|
8
|
+
const SelectIcon = SelectPrimitive.Icon;
|
|
9
|
+
const SelectContent = ({ className, children, position = 'popper', ...props }) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { className: cn('data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in', position === 'popper' &&
|
|
10
|
+
'data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [_jsx(SelectPrimitive.ScrollUpButton, { className: "flex cursor-default items-center justify-center py-1 text-muted-foreground", children: _jsx(ChevronUp, { className: "h-4 w-4" }) }), _jsx(SelectPrimitive.Viewport, { className: cn(position === 'popper' &&
|
|
11
|
+
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'), children: children }), _jsx(SelectPrimitive.ScrollDownButton, { className: "flex cursor-default items-center justify-center py-1 text-muted-foreground", children: _jsx(ChevronDown, { className: "h-4 w-4" }) })] }) }));
|
|
12
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
13
|
+
const SelectItem = ({ className, children, ...props }) => (_jsxs(SelectPrimitive.Item, { className: cn('relative flex w-full cursor-default select-none items-center px-2 py-1.5 outline-none focus:bg-primary focus:text-primary-foreground data-disabled:pointer-events-none data-[highlighted]:bg-primary data-[highlighted]:text-primary-foreground data-disabled:opacity-50', className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4 text-foreground" }) }) })] }));
|
|
14
|
+
const SelectLabel = SelectPrimitive.Label;
|
|
15
|
+
const SelectSeparator = SelectPrimitive.Separator;
|
|
16
|
+
const SelectObj = Object.assign(Select, {
|
|
17
|
+
Trigger: SelectTrigger,
|
|
18
|
+
Value: SelectValue,
|
|
19
|
+
Icon: SelectIcon,
|
|
20
|
+
Content: SelectContent,
|
|
21
|
+
Group: SelectGroup,
|
|
22
|
+
Item: SelectItem,
|
|
23
|
+
Label: SelectLabel,
|
|
24
|
+
Separator: SelectSeparator,
|
|
25
|
+
});
|
|
26
|
+
export { SelectObj as Select };
|
|
27
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/side-panel/components/retro/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AAEpC,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAsC,EAAE,EAAE,CAAC,CAC/F,MAAC,eAAe,CAAC,OAAO,IACtB,SAAS,EAAE,EAAE,CACX,gRAAgR,EAChR,SAAS,CACV,KACG,KAAK,aACR,QAAQ,EACT,KAAC,eAAe,CAAC,IAAI,IAAC,OAAO,kBAC3B,KAAC,WAAW,IAAC,SAAS,EAAC,cAAc,GAAG,GACnB,IACC,CAC3B,CAAC;AAEF,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAE1C,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC;AAExC,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAsC,EAAE,EAAE,CAAC,CACpH,KAAC,eAAe,CAAC,MAAM,cACrB,MAAC,eAAe,CAAC,OAAO,IACtB,SAAS,EAAE,EAAE,CACX,0bAA0b,EAC1b,QAAQ,KAAK,QAAQ;YACnB,iIAAiI,EACnI,SAAS,CACV,EACD,QAAQ,EAAE,QAAQ,KACd,KAAK,aACT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 -1,7 +1,5 @@
|
|
|
1
1
|
/** Duration (ms) to display toggle-error alerts before auto-dismissing */
|
|
2
2
|
export declare const ERROR_DISPLAY_DURATION_MS = 3000;
|
|
3
|
-
/** Interval (ms) between countdown bar progress updates */
|
|
4
|
-
export declare const COUNTDOWN_POLL_INTERVAL_MS = 200;
|
|
5
3
|
/** Maximum duration (ms) a tool invocation can remain in activeTools before being auto-removed */
|
|
6
4
|
export declare const TOOL_INVOCATION_TIMEOUT_MS: number;
|
|
7
5
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/side-panel/constants.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/side-panel/constants.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,kGAAkG;AAClG,eAAO,MAAM,0BAA0B,QAAgB,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** Duration (ms) to display toggle-error alerts before auto-dismissing */
|
|
2
2
|
export const ERROR_DISPLAY_DURATION_MS = 3000;
|
|
3
|
-
/** Interval (ms) between countdown bar progress updates */
|
|
4
|
-
export const COUNTDOWN_POLL_INTERVAL_MS = 200;
|
|
5
3
|
/** Maximum duration (ms) a tool invocation can remain in activeTools before being auto-removed */
|
|
6
4
|
export const TOOL_INVOCATION_TIMEOUT_MS = 5 * 60 * 1000;
|
|
7
5
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/side-panel/constants.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/side-panel/constants.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,kGAAkG;AAClG,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC"}
|
|
@@ -7,12 +7,10 @@ interface UseServerNotificationsParams {
|
|
|
7
7
|
}
|
|
8
8
|
interface UseServerNotificationsResult {
|
|
9
9
|
handleNotification: (data: Record<string, unknown>) => void;
|
|
10
|
-
clearConfirmationTimeout: (id: string) => void;
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
12
|
* Returns a stable callback that processes server notification messages
|
|
14
|
-
* (confirmation.request, tab.stateChanged, tool.invocationStart, tool.invocationEnd)
|
|
15
|
-
* and a function to clear a confirmation's auto-removal timeout.
|
|
13
|
+
* (confirmation.request, tab.stateChanged, tool.invocationStart, tool.invocationEnd).
|
|
16
14
|
*/
|
|
17
15
|
declare const useServerNotifications: ({ setPlugins, setActiveTools, setPendingConfirmations, }: UseServerNotificationsParams) => UseServerNotificationsResult;
|
|
18
16
|
export { useServerNotifications };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useServerNotifications.d.ts","sourceRoot":"","sources":["../../../src/side-panel/hooks/useServerNotifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAK5E,UAAU,4BAA4B;IACpC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAChE,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAClE,uBAAuB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;CACnF;AAED,UAAU,4BAA4B;IACpC,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"useServerNotifications.d.ts","sourceRoot":"","sources":["../../../src/side-panel/hooks/useServerNotifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAK5E,UAAU,4BAA4B;IACpC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAChE,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAClE,uBAAuB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;CACnF;AAED,UAAU,4BAA4B;IACpC,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED;;;GAGG;AACH,QAAA,MAAM,sBAAsB,GAAI,0DAI7B,4BAA4B,KAAG,4BAiGjC,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -4,66 +4,38 @@ import { TOOL_INVOCATION_TIMEOUT_MS } from '../constants.js';
|
|
|
4
4
|
const validTabStates = new Set(['closed', 'unavailable', 'ready']);
|
|
5
5
|
/**
|
|
6
6
|
* Returns a stable callback that processes server notification messages
|
|
7
|
-
* (confirmation.request, tab.stateChanged, tool.invocationStart, tool.invocationEnd)
|
|
8
|
-
* and a function to clear a confirmation's auto-removal timeout.
|
|
7
|
+
* (confirmation.request, tab.stateChanged, tool.invocationStart, tool.invocationEnd).
|
|
9
8
|
*/
|
|
10
9
|
const useServerNotifications = ({ setPlugins, setActiveTools, setPendingConfirmations, }) => {
|
|
11
|
-
const
|
|
10
|
+
const seenConfirmationIds = useRef(new Set());
|
|
12
11
|
const invocationTimeoutIds = useRef(new Map());
|
|
13
12
|
useEffect(() => {
|
|
14
|
-
const confirmationMap = timeoutIds.current;
|
|
15
13
|
const invocationMap = invocationTimeoutIds.current;
|
|
16
14
|
return () => {
|
|
17
|
-
for (const id of confirmationMap.values()) {
|
|
18
|
-
clearTimeout(id);
|
|
19
|
-
}
|
|
20
|
-
confirmationMap.clear();
|
|
21
15
|
for (const id of invocationMap.values()) {
|
|
22
16
|
clearTimeout(id);
|
|
23
17
|
}
|
|
24
18
|
invocationMap.clear();
|
|
25
19
|
};
|
|
26
20
|
}, []);
|
|
27
|
-
const clearConfirmationTimeout = (id) => {
|
|
28
|
-
const tid = timeoutIds.current.get(id);
|
|
29
|
-
if (tid !== undefined) {
|
|
30
|
-
clearTimeout(tid);
|
|
31
|
-
timeoutIds.current.delete(id);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
21
|
const handleNotification = (data) => {
|
|
35
22
|
if (data.method === 'confirmation.request' && data.params) {
|
|
36
23
|
const params = data.params;
|
|
37
|
-
if (typeof params.id === 'string' && typeof params.tool === 'string'
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
|
|
24
|
+
if (typeof params.id === 'string' && typeof params.tool === 'string') {
|
|
25
|
+
// Skip duplicate confirmations (e.g., real-time sp:serverMessage
|
|
26
|
+
// followed by bg:getFullState hydration for the same id).
|
|
27
|
+
if (seenConfirmationIds.current.has(params.id))
|
|
28
|
+
return;
|
|
29
|
+
seenConfirmationIds.current.add(params.id);
|
|
41
30
|
const confirmation = {
|
|
42
31
|
id: params.id,
|
|
43
32
|
tool: params.tool,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
? params.
|
|
47
|
-
:
|
|
48
|
-
paramsPreview: typeof params.paramsPreview === 'string' ? params.paramsPreview : '',
|
|
49
|
-
timeoutMs: params.timeoutMs,
|
|
50
|
-
receivedAt,
|
|
33
|
+
plugin: typeof params.plugin === 'string' ? params.plugin : 'unknown',
|
|
34
|
+
params: typeof params.params === 'object' && params.params !== null
|
|
35
|
+
? params.params
|
|
36
|
+
: {},
|
|
51
37
|
};
|
|
52
|
-
// Skip duplicate confirmations (e.g., real-time sp:serverMessage
|
|
53
|
-
// followed by bg:getFullState hydration for the same id).
|
|
54
|
-
if (timeoutIds.current.has(confirmation.id))
|
|
55
|
-
return;
|
|
56
38
|
setPendingConfirmations(prev => (prev.some(c => c.id === confirmation.id) ? prev : [...prev, confirmation]));
|
|
57
|
-
// Compute remaining time from the original receivedAt so hydrated
|
|
58
|
-
// confirmations expire at the correct wall-clock time.
|
|
59
|
-
const elapsed = Date.now() - receivedAt;
|
|
60
|
-
const removeDelay = Math.max(0, params.timeoutMs + 1000 - elapsed);
|
|
61
|
-
const tid = setTimeout(() => {
|
|
62
|
-
timeoutIds.current.delete(confirmation.id);
|
|
63
|
-
setPendingConfirmations(prev => prev.filter(c => c.id !== confirmation.id));
|
|
64
|
-
chrome.runtime.sendMessage({ type: 'sp:confirmationTimeout', id: confirmation.id }).catch(() => { });
|
|
65
|
-
}, removeDelay);
|
|
66
|
-
timeoutIds.current.set(confirmation.id, tid);
|
|
67
39
|
}
|
|
68
40
|
}
|
|
69
41
|
if (data.method === 'tab.stateChanged' && data.params) {
|
|
@@ -117,7 +89,7 @@ const useServerNotifications = ({ setPlugins, setActiveTools, setPendingConfirma
|
|
|
117
89
|
}
|
|
118
90
|
}
|
|
119
91
|
};
|
|
120
|
-
return { handleNotification
|
|
92
|
+
return { handleNotification };
|
|
121
93
|
};
|
|
122
94
|
export { useServerNotifications };
|
|
123
95
|
//# sourceMappingURL=useServerNotifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useServerNotifications.js","sourceRoot":"","sources":["../../../src/side-panel/hooks/useServerNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"useServerNotifications.js","sourceRoot":"","sources":["../../../src/side-panel/hooks/useServerNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAYlG;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAC,EAC9B,UAAU,EACV,cAAc,EACd,uBAAuB,GACM,EAAgC,EAAE;IAC/D,MAAM,mBAAmB,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAC;IAC3D,MAAM,oBAAoB,GAAG,MAAM,CAA6C,IAAI,GAAG,EAAE,CAAC,CAAC;IAE3F,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,oBAAoB,CAAC,OAAO,CAAC;QACnD,OAAO,GAAG,EAAE;YACV,KAAK,MAAM,EAAE,IAAI,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;gBACxC,YAAY,CAAC,EAAE,CAAC,CAAC;YACnB,CAAC;YACD,aAAa,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC,CAAC;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