react-devbelt 0.0.0-stage → 0.2.0

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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +16 -0
  3. package/README.md +324 -2
  4. package/dist/announce-6XECDMRI.js +12 -0
  5. package/dist/announce-6XECDMRI.js.map +1 -0
  6. package/dist/chunk-3SXZJ6OP.js +65 -0
  7. package/dist/chunk-3SXZJ6OP.js.map +1 -0
  8. package/dist/chunk-63DO3YVL.js +330 -0
  9. package/dist/chunk-63DO3YVL.js.map +1 -0
  10. package/dist/chunk-6PAFI4BJ.js +14615 -0
  11. package/dist/chunk-6PAFI4BJ.js.map +1 -0
  12. package/dist/chunk-7JLNVGRQ.js +164 -0
  13. package/dist/chunk-7JLNVGRQ.js.map +1 -0
  14. package/dist/chunk-C7RMX5PF.js +57 -0
  15. package/dist/chunk-C7RMX5PF.js.map +1 -0
  16. package/dist/chunk-GB5T3MS2.js +8030 -0
  17. package/dist/chunk-GB5T3MS2.js.map +1 -0
  18. package/dist/chunk-GNJF3UHO.js +1030 -0
  19. package/dist/chunk-GNJF3UHO.js.map +1 -0
  20. package/dist/chunk-PRTINXUT.js +105 -0
  21. package/dist/chunk-PRTINXUT.js.map +1 -0
  22. package/dist/chunk-QRXHNBFY.js +22 -0
  23. package/dist/chunk-QRXHNBFY.js.map +1 -0
  24. package/dist/chunk-QT3YSHQA.js +18 -0
  25. package/dist/chunk-QT3YSHQA.js.map +1 -0
  26. package/dist/cli.js +2174 -0
  27. package/dist/context-D2euxPc4.d.ts +6 -0
  28. package/dist/core.d.ts +266 -0
  29. package/dist/core.js +1070 -0
  30. package/dist/core.js.map +1 -0
  31. package/dist/findable-rows-UQBKFZ45.js +356 -0
  32. package/dist/findable-rows-UQBKFZ45.js.map +1 -0
  33. package/dist/index.d.ts +57 -0
  34. package/dist/index.js +47 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/install.d.ts +2 -0
  37. package/dist/install.js +21 -0
  38. package/dist/install.js.map +1 -0
  39. package/dist/next.d.ts +18 -0
  40. package/dist/next.js +13 -0
  41. package/dist/next.js.map +1 -0
  42. package/dist/plugin-C8VytW9X.d.ts +162 -0
  43. package/dist/plugins.d.ts +118 -0
  44. package/dist/plugins.js +36 -0
  45. package/dist/plugins.js.map +1 -0
  46. package/dist/sheet-presentation-S6GGOKMB.js +2667 -0
  47. package/dist/sheet-presentation-S6GGOKMB.js.map +1 -0
  48. package/dist/styles.css +2 -0
  49. package/dist/toolbar-entry-QHIQKNOO.js +1687 -0
  50. package/dist/toolbar-entry-QHIQKNOO.js.map +1 -0
  51. package/dist/ui.d.ts +37 -0
  52. package/dist/ui.js +126 -0
  53. package/dist/ui.js.map +1 -0
  54. package/licenses/motion-MIT.txt +21 -0
  55. package/licenses/ui-sdk-APACHE-2.0.txt +202 -0
  56. package/package.json +120 -3
package/dist/index.js ADDED
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import {
3
+ installPlugins
4
+ } from "./chunk-C7RMX5PF.js";
5
+ import {
6
+ definePlugin
7
+ } from "./chunk-QRXHNBFY.js";
8
+ import {
9
+ useToolbar
10
+ } from "./chunk-QT3YSHQA.js";
11
+
12
+ // src/dev-toolbar.tsx
13
+ import { lazy, Suspense, useSyncExternalStore } from "react";
14
+ import { jsx } from "react/jsx-runtime";
15
+ var ToolbarImpl = process.env.NODE_ENV !== "production" ? lazy(() => import("./toolbar-entry-QHIQKNOO.js")) : null;
16
+ var noopSubscribe = () => () => {
17
+ };
18
+ function DevBelt({
19
+ plugins,
20
+ isolation = "shadow",
21
+ panelMode,
22
+ aiTools,
23
+ enabled = true
24
+ }) {
25
+ const isClient = useSyncExternalStore(
26
+ noopSubscribe,
27
+ () => true,
28
+ () => false
29
+ );
30
+ if (!ToolbarImpl || !isClient || !enabled) return null;
31
+ return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(ToolbarImpl, { plugins, isolation, panelMode, aiTools }) });
32
+ }
33
+
34
+ // src/install-devbelt.ts
35
+ function installDevBelt(plugins) {
36
+ if (process.env.NODE_ENV === "production" || typeof window === "undefined") {
37
+ return;
38
+ }
39
+ installPlugins(plugins);
40
+ }
41
+ export {
42
+ DevBelt,
43
+ definePlugin,
44
+ installDevBelt,
45
+ useToolbar
46
+ };
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dev-toolbar.tsx","../src/install-devbelt.ts"],"sourcesContent":["\"use client\";\n\nimport { lazy, Suspense, useSyncExternalStore } from \"react\";\n\nimport type { AiTool } from \"./core/ai-tools\";\nimport type { DevBeltPlugin } from \"./plugin\";\nimport type { Isolation } from \"./ui/toolbar-root\";\nimport type { PanelMode } from \"./ui/use-dev-layout\";\n\nexport type DevBeltProps = {\n /**\n * What the toolbar offers. Default: Viewport, Grab, Network, Console,\n * Display and Copy debug bundle. Create the array once, at module level.\n */\n plugins?: readonly DevBeltPlugin[];\n /**\n * `\"shadow\"` (default) renders in a shadow root with its own stylesheet, so\n * nothing leaks in or out. `\"none\"` renders in a plain div and expects you\n * to import `react-devbelt/styles.css`.\n */\n isolation?: Isolation;\n /**\n * How tools open: `\"window\"` (default) is a floating, draggable, resizable\n * window; `\"popover\"` is a panel on the tool's toolbar item, one at a time.\n * People can change it in More tools, and their choice is remembered.\n */\n panelMode?: PanelMode;\n /**\n * The AI tools offered for \"open in …\" (Grab, Copy debug bundle). Default:\n * Cursor, Claude Code and Codex. Add your own with `{ id, label, link }`;\n * create the array once, at module level.\n */\n aiTools?: readonly AiTool[];\n /** Turn the toolbar off without removing it, e.g. `enabled={!isDemo}`. Default true. */\n enabled?: boolean;\n};\n\n// Decided at build time, so a production build drops the import() and never\n// emits the toolbar chunk (ui-sdk panels, highlight.js, react-grab) at all.\nconst ToolbarImpl =\n process.env.NODE_ENV !== \"production\"\n ? lazy(() => import(\"./ui/toolbar-entry\"))\n : null;\n\nconst noopSubscribe = () => () => {};\n\n/**\n * The dev toolbar. Renders nothing in production builds and on the server.\n * Put it once in your root layout.\n */\nexport function DevBelt({\n plugins,\n isolation = \"shadow\",\n panelMode,\n aiTools,\n enabled = true,\n}: DevBeltProps) {\n const isClient = useSyncExternalStore(\n noopSubscribe,\n () => true,\n () => false,\n );\n if (!ToolbarImpl || !isClient || !enabled) return null;\n return (\n <Suspense fallback={null}>\n <ToolbarImpl plugins={plugins} isolation={isolation} panelMode={panelMode} aiTools={aiTools} />\n </Suspense>\n );\n}\n","import { installPlugins } from \"./install-plugins\";\nimport type { DevBeltPlugin } from \"./plugin\";\n\n/**\n * Starts capturing (network, console, shortcuts) for your own plugin list\n * before the app runs, so the first requests and errors are not missed. Call\n * it from Next's `instrumentation-client.ts` or the first line of your entry\n * file, with the same array you give `<DevBelt plugins>`. Does nothing in\n * production or on the server.\n *\n * Use this or `import \"react-devbelt/install\"`, not both: whichever runs first\n * decides each plugin's options.\n */\nexport function installDevBelt(plugins: readonly DevBeltPlugin[]): void {\n if (process.env.NODE_ENV === \"production\" || typeof window === \"undefined\") {\n return;\n }\n installPlugins(plugins);\n}\n"],"mappings":";;;;;;;;;;;;AAEA,SAAS,MAAM,UAAU,4BAA4B;AA+D/C;AA1BN,IAAM,cACJ,QAAQ,IAAI,aAAa,eACrB,KAAK,MAAM,OAAO,6BAAoB,CAAC,IACvC;AAEN,IAAM,gBAAgB,MAAM,MAAM;AAAC;AAM5B,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAAiB;AACf,QAAM,WAAW;AAAA,IACf;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACA,MAAI,CAAC,eAAe,CAAC,YAAY,CAAC,QAAS,QAAO;AAClD,SACE,oBAAC,YAAS,UAAU,MAClB,8BAAC,eAAY,SAAkB,WAAsB,WAAsB,SAAkB,GAC/F;AAEJ;;;ACvDO,SAAS,eAAe,SAAyC;AACtE,MAAI,QAAQ,IAAI,aAAa,gBAAgB,OAAO,WAAW,aAAa;AAC1E;AAAA,EACF;AACA,iBAAe,OAAO;AACxB;","names":[]}
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import {
3
+ installPlugins
4
+ } from "./chunk-C7RMX5PF.js";
5
+ import {
6
+ defaultPlugins
7
+ } from "./chunk-GB5T3MS2.js";
8
+ import "./chunk-QRXHNBFY.js";
9
+ import "./chunk-6PAFI4BJ.js";
10
+ import "./chunk-QT3YSHQA.js";
11
+ import "./chunk-3SXZJ6OP.js";
12
+ import "./chunk-GNJF3UHO.js";
13
+ import "./chunk-PRTINXUT.js";
14
+ import "./chunk-63DO3YVL.js";
15
+ import "./chunk-7JLNVGRQ.js";
16
+
17
+ // src/install.ts
18
+ if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
19
+ installPlugins(defaultPlugins());
20
+ }
21
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/install.ts"],"sourcesContent":["import { installPlugins } from \"./install-plugins\";\nimport { defaultPlugins } from \"./plugins\";\n\n// `import \"react-devbelt/install\"` is the zero-config form: the built-in plugins,\n// installed before the app runs. The whole body sits behind one build-time\n// condition, so a production build drops it and the plugins it pulls in.\nif (process.env.NODE_ENV !== \"production\" && typeof window !== \"undefined\") {\n installPlugins(defaultPlugins());\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAMA,IAAI,QAAQ,IAAI,aAAa,gBAAgB,OAAO,WAAW,aAAa;AAC1E,iBAAe,eAAe,CAAC;AACjC;","names":[]}
package/dist/next.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ type WithInject = {
2
+ instrumentationClientInject?: string[];
3
+ };
4
+ /**
5
+ * Next.js config wrapper that loads `react-devbelt/install` before hydration
6
+ * (Next 16.3+), so you don't need an `instrumentation-client.ts` file.
7
+ *
8
+ * ```ts
9
+ * import { withDevBelt } from "react-devbelt/next";
10
+ * export default withDevBelt({ ...yourConfig });
11
+ * ```
12
+ *
13
+ * Skip it if you pass your own plugin list: call `installDevBelt(plugins)`
14
+ * from `instrumentation-client.ts` instead.
15
+ */
16
+ declare function withDevBelt<T extends object>(config?: T): T & WithInject;
17
+
18
+ export { withDevBelt };
package/dist/next.js ADDED
@@ -0,0 +1,13 @@
1
+ // src/next.ts
2
+ function withDevBelt(config = {}) {
3
+ const existing = config.instrumentationClientInject ?? [];
4
+ if (existing.includes("react-devbelt/install")) return config;
5
+ return {
6
+ ...config,
7
+ instrumentationClientInject: [...existing, "react-devbelt/install"]
8
+ };
9
+ }
10
+ export {
11
+ withDevBelt
12
+ };
13
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/next.ts"],"sourcesContent":["// Server-side helper for next.config.{js,ts}. No React in here.\n\ntype WithInject = { instrumentationClientInject?: string[] };\n\n/**\n * Next.js config wrapper that loads `react-devbelt/install` before hydration\n * (Next 16.3+), so you don't need an `instrumentation-client.ts` file.\n *\n * ```ts\n * import { withDevBelt } from \"react-devbelt/next\";\n * export default withDevBelt({ ...yourConfig });\n * ```\n *\n * Skip it if you pass your own plugin list: call `installDevBelt(plugins)`\n * from `instrumentation-client.ts` instead.\n */\nexport function withDevBelt<T extends object>(\n config: T = {} as T,\n): T & WithInject {\n const existing = (config as WithInject).instrumentationClientInject ?? [];\n if (existing.includes(\"react-devbelt/install\")) return config;\n return {\n ...config,\n instrumentationClientInject: [...existing, \"react-devbelt/install\"],\n };\n}\n"],"mappings":";AAgBO,SAAS,YACd,SAAY,CAAC,GACG;AAChB,QAAM,WAAY,OAAsB,+BAA+B,CAAC;AACxE,MAAI,SAAS,SAAS,uBAAuB,EAAG,QAAO;AACvD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,6BAA6B,CAAC,GAAG,UAAU,uBAAuB;AAAA,EACpE;AACF;","names":[]}
@@ -0,0 +1,162 @@
1
+ import { ReactNode, ComponentType } from 'react';
2
+
3
+ type AiTool = {
4
+ /** Unique, lowercase, e.g. `cursor`. Also the saved choice in Grab's menu. */
5
+ id: string;
6
+ /** Shown on buttons and menu items, e.g. `Cursor`. */
7
+ label: string;
8
+ /** The link that opens the tool with `prompt` filled in. */
9
+ link: (prompt: string) => string;
10
+ /**
11
+ * A link that opens the tool with no prompt, used with the clipboard when the
12
+ * prompt is too long for `link`. Leave it out if the tool has none.
13
+ */
14
+ openLink?: string;
15
+ /** Longest prompt `link` can carry, in characters. Default 5000. */
16
+ maxPrompt?: number;
17
+ };
18
+
19
+ type ToolResult = {
20
+ content: {
21
+ type: "text";
22
+ text: string;
23
+ }[];
24
+ /** True when the call failed; the text says why. */
25
+ isError?: boolean;
26
+ _meta?: Record<string, unknown>;
27
+ };
28
+ /**
29
+ * `Context` is whatever the host hands every tool when it runs (the toolbar
30
+ * passes its API), so a tool can read live state without a global.
31
+ */
32
+ type AgentTool<Context = void> = {
33
+ name: string;
34
+ description: string;
35
+ inputSchema: object;
36
+ annotations?: Record<string, boolean>;
37
+ /**
38
+ * True when the tool changes state. Writing tools are only offered to
39
+ * agents once the Plugin sets `agent: { write: true }` (ADR 0003).
40
+ */
41
+ writes?: boolean;
42
+ run: (input: Record<string, unknown>, context: Context) => ToolResult | Promise<ToolResult>;
43
+ };
44
+
45
+ /** One line of the bundle's header, e.g. `{ label: "Viewport", value: "iPad 820×1180" }`. */
46
+ type DebugEntry = {
47
+ label: string;
48
+ value: string;
49
+ };
50
+
51
+ type WindowSize = {
52
+ width: number;
53
+ height: number;
54
+ minWidth: number;
55
+ minHeight: number;
56
+ };
57
+ /** What a plugin can ask the toolbar to do. Get it from `useToolbar()` or `run()`. */
58
+ interface ToolbarApi {
59
+ /** Opens the window of the plugin with this id, as a floating window or a popover (the panel mode). */
60
+ openWindow(pluginId: string): void;
61
+ closeWindow(pluginId: string): void;
62
+ toggleWindow(pluginId: string): void;
63
+ /** The lines every plugin contributes to the debug bundle's header. */
64
+ debugContext(): DebugEntry[];
65
+ /** The Markdown sections plugins add to the end of the debug bundle. */
66
+ debugSections(): string[];
67
+ /** The AI tools the app offers for "open in …" (the `aiTools` prop). Pass one to `openInAiTool`. */
68
+ aiTools: readonly AiTool[];
69
+ /** Overlays that handle Esc themselves call this; the returned function releases it. */
70
+ holdEscape(): () => void;
71
+ /**
72
+ * Hides the toolbar, its windows and popovers (what ⌘/ does), or shows them again. For a plugin
73
+ * that needs the screen clear, like recording it. Whoever hides it should show it again.
74
+ */
75
+ setHidden(hidden: boolean): void;
76
+ /** Whether the toolbar is hidden right now. */
77
+ isHidden(): boolean;
78
+ /** The element the toolbar renders into: inside its shadow root, or a div on the page. */
79
+ container: HTMLElement;
80
+ /** The shadow root or document the toolbar lives in, for queries. */
81
+ root: Document | ShadowRoot;
82
+ }
83
+ interface DevBeltPlugin {
84
+ /** Plugin API version. `definePlugin` fills it in. */
85
+ apiVersion: 1;
86
+ /** Unique, lowercase, e.g. `react-query`. Also the key for saved layout. */
87
+ id: string;
88
+ /** Shown in menus and as the default window title. */
89
+ name: string;
90
+ icon: ReactNode;
91
+ /** Whether the toolbar shows this plugin by default. Default true. People can change it in More tools. */
92
+ pinned?: boolean;
93
+ /** Not used: the toolbar draws a divider between every two plugins. */
94
+ separatorAfter?: boolean;
95
+ /**
96
+ * Runs once in every frame, including the viewport iframe, as early as
97
+ * `installDevBelt` or the first `<DevBelt />` mount. Patch globals or
98
+ * register shortcuts here. Return a cleanup.
99
+ */
100
+ install?: () => void | (() => void);
101
+ /** Tools for the browser's agent (WebMCP) and `window.devbelt`. */
102
+ agentTools?: AgentTool<ToolbarApi>[];
103
+ /**
104
+ * Agent options set by the app. Agent tools marked `writes: true` stay off
105
+ * until `agent: { write: true }` (ADR 0003). Read-only tools are unaffected.
106
+ */
107
+ agent?: {
108
+ write?: boolean;
109
+ };
110
+ /** Lines for the header of "Copy debug bundle". */
111
+ debugContext?: () => DebugEntry[];
112
+ /** Whole Markdown sections for the end of the debug bundle. */
113
+ debugSections?: () => string[];
114
+ /**
115
+ * The toolbar item. Without it the toolbar draws a toggle for `window`, or
116
+ * a button for `run`. A custom item is rendered inside the toolbar.
117
+ */
118
+ Item?: ComponentType;
119
+ /** A count or dot inside the default toggle. */
120
+ Badge?: ComponentType;
121
+ /** Extra text after the default toggle's tooltip, e.g. " · 2 failed". */
122
+ Hint?: ComponentType;
123
+ /** Accessible name of the default toggle or button. Default: `name`. */
124
+ label?: string;
125
+ /**
126
+ * The plugin's panel: a floating, draggable, resizable window, or, in popover
127
+ * panel mode, a popover on its toolbar item at `size.width` × `size.height`.
128
+ */
129
+ window?: {
130
+ title?: string;
131
+ size: WindowSize;
132
+ Component: ComponentType;
133
+ };
134
+ /**
135
+ * An action. Called by the default button and by More tools. A returned
136
+ * string flashes beside the icon, e.g. "Copied".
137
+ */
138
+ run?: (api: ToolbarApi) => void | string | Promise<void | string>;
139
+ /** Tooltip of the default `run` button. */
140
+ description?: string;
141
+ /**
142
+ * CSS for this plugin's own markup. The toolbar's stylesheet only knows the
143
+ * classes the built-in plugins use, so a plugin that styles itself ships it here.
144
+ */
145
+ styles?: string;
146
+ /** Rendered over the page in the top window, e.g. a picker or a device frame. */
147
+ Overlay?: ComponentType;
148
+ /** Rendered inside the More tools menu. Use ui-sdk `Menu*` parts. */
149
+ MenuSection?: ComponentType;
150
+ /** Rendered at the end of the toolbar, e.g. the current frame size. */
151
+ Status?: ComponentType;
152
+ /** Rendered in the collapsed toolbar's chip. */
153
+ ChipStatus?: ComponentType;
154
+ }
155
+ type PluginConfig = Omit<DevBeltPlugin, "apiVersion"> & {
156
+ apiVersion?: 1;
157
+ };
158
+ /** Declares a plugin. Checks the id and stamps the API version. */
159
+ declare function definePlugin(config: PluginConfig): DevBeltPlugin;
160
+
161
+ export { definePlugin as d };
162
+ export type { AiTool as A, DevBeltPlugin as D, PluginConfig as P, ToolbarApi as T, WindowSize as W, AgentTool as a, DebugEntry as b, ToolResult as c };
@@ -0,0 +1,118 @@
1
+ import { DevBeltPlugin } from './index.js';
2
+ import 'react';
3
+
4
+ type NetworkLogOptions = {
5
+ /**
6
+ * Header names whose values are masked in the log (case-insensitive).
7
+ * Defaults to credentials: authorization, cookies and API keys.
8
+ */
9
+ redactHeaders?: string[];
10
+ /**
11
+ * Decides what a replayed request sends for a header. `value` is what the
12
+ * log holds, which is masked for redacted headers. Return the real value
13
+ * (for example the current session's token), or null to leave it out.
14
+ * By default redacted headers are left out of a replay.
15
+ */
16
+ replayHeaders?: (name: string, value: string) => string | null | undefined;
17
+ /** Also record `fetch` calls. Default true. */
18
+ fetch?: boolean;
19
+ };
20
+
21
+ /** One button that copies page, viewport, errors and failed requests for an AI assistant. */
22
+ declare function bundle(): DevBeltPlugin;
23
+
24
+ /** Breakpoint name to its minimum width: px as a number, or a `rem`/`px` string. */
25
+ type Breakpoints = Record<string, number | string>;
26
+
27
+ type BreakpointOptions = {
28
+ /**
29
+ * Breakpoint name to minimum width (px number, or a `rem`/`px` string).
30
+ * Default: Tailwind v4's `sm 40rem`, `md 48rem`, `lg 64rem`, `xl 80rem`, `2xl 96rem`.
31
+ */
32
+ breakpoints?: Breakpoints;
33
+ /** Name of the range below the smallest breakpoint. Default `base`. */
34
+ base?: string;
35
+ /** Start with the outline on. Default off. A saved choice wins after the first toggle. */
36
+ outline?: boolean;
37
+ };
38
+ /** The current breakpoint and width, e.g. `md · 812px`. */
39
+ declare function breakpoint(options?: BreakpointOptions): DevBeltPlugin;
40
+
41
+ type CaptureOptions = {
42
+ /** Pixel ratio of screenshots. Default: the screen's, e.g. 2 on a retina display. */
43
+ scale?: number;
44
+ /**
45
+ * Hide the toolbar, its windows and popovers while the screen is recorded, so they are not in
46
+ * the video. They come back when the recording ends. The person can change this in More tools,
47
+ * and their choice wins. Default true.
48
+ */
49
+ hideWhileRecording?: boolean;
50
+ };
51
+ /**
52
+ * Screenshot and screen recording. The camera copies a PNG of the page (the
53
+ * device Frame's page while one is up), rendered from the DOM with
54
+ * modern-screenshot, without the toolbar. The circle records the screen as a
55
+ * video through the browser's own screen sharing, which asks what to share, and
56
+ * saves it as a .webm when stopped. Opt-in: add it by name.
57
+ */
58
+ declare function capture(options?: CaptureOptions): DevBeltPlugin;
59
+
60
+ /** console.error, console.warn, uncaught errors and unhandled rejections, with stacks. */
61
+ declare function consolePlugin(): DevBeltPlugin;
62
+
63
+ type LocaleOptions = {
64
+ /** Name of the cookie the app reads its language from. */
65
+ cookie: string;
66
+ /** Language codes the switch offers, e.g. `["en", "th"]`. */
67
+ options: readonly string[];
68
+ /** Used when the cookie is missing or not one of `options`. Default: the first option. */
69
+ default?: string;
70
+ };
71
+
72
+ type DisplayOptions = {
73
+ /**
74
+ * The class that turns dark mode on, set on `<html>` of the page and of the
75
+ * framed page. Default `"dark"`. Pass `false` if the app has no such switch;
76
+ * the Dark mode toggle is then hidden.
77
+ */
78
+ darkClass?: string | false;
79
+ /** Show a language switch that sets a cookie and reloads. Off by default. */
80
+ locale?: LocaleOptions;
81
+ };
82
+ /** Rotate, custom size, dark mode and (optionally) language. */
83
+ declare function display(options?: DisplayOptions): DevBeltPlugin;
84
+
85
+ /** Turns the picker on or off from anywhere. */
86
+ declare function setGrabbing(active: boolean): void;
87
+ /** Point at an element to copy it, its component stack and source location for an AI assistant (key G). */
88
+ declare function grab(): DevBeltPlugin;
89
+
90
+ /** Every `fetch` and XHR the page makes, with bodies, copyable for an AI assistant. */
91
+ declare function network(options?: NetworkLogOptions): DevBeltPlugin;
92
+
93
+ type StorageStore = "localStorage" | "sessionStorage" | "cookies";
94
+
95
+ type StorageOptions = {
96
+ /** Stores to show. Default: localStorage, sessionStorage and cookies. */
97
+ stores?: readonly StorageStore[];
98
+ /** Keys matching this are Redacted. Default: `/token|secret|password|auth|session|jwt|key/i`. */
99
+ redact?: RegExp;
100
+ /** Put values in the Debug bundle too. Redacted values stay hidden. Default false: names and sizes only. */
101
+ includeValuesInBundle?: boolean;
102
+ };
103
+ /**
104
+ * localStorage, sessionStorage and readable cookies: view, edit, delete and
105
+ * clear, and the Window updates as the page or a framed page writes. Opt-in:
106
+ * add it by name. The Agent tools that change state need
107
+ * `agent: { write: true }`. Hides its own `devbelt:*` keys; HttpOnly cookies are invisible.
108
+ */
109
+ declare function storage(options?: StorageOptions): DevBeltPlugin;
110
+
111
+ /** The device frame: pick Mobile, iPad, MacBook, PC or a custom size (keys 1–6). */
112
+ declare function viewport(): DevBeltPlugin;
113
+
114
+ /** Viewport, Grab, Network, Console, Display and Copy debug bundle, in toolbar order. */
115
+ declare function defaultPlugins(): DevBeltPlugin[];
116
+
117
+ export { breakpoint, bundle, capture, consolePlugin, defaultPlugins, display, grab, network, setGrabbing, storage, viewport };
118
+ export type { BreakpointOptions, CaptureOptions, DisplayOptions, StorageOptions };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import {
3
+ breakpoint,
4
+ bundle,
5
+ capture,
6
+ consolePlugin,
7
+ defaultPlugins,
8
+ display,
9
+ grab,
10
+ network,
11
+ setGrabbing,
12
+ storage,
13
+ viewport
14
+ } from "./chunk-GB5T3MS2.js";
15
+ import "./chunk-QRXHNBFY.js";
16
+ import "./chunk-6PAFI4BJ.js";
17
+ import "./chunk-QT3YSHQA.js";
18
+ import "./chunk-3SXZJ6OP.js";
19
+ import "./chunk-GNJF3UHO.js";
20
+ import "./chunk-PRTINXUT.js";
21
+ import "./chunk-63DO3YVL.js";
22
+ import "./chunk-7JLNVGRQ.js";
23
+ export {
24
+ breakpoint,
25
+ bundle,
26
+ capture,
27
+ consolePlugin,
28
+ defaultPlugins,
29
+ display,
30
+ grab,
31
+ network,
32
+ setGrabbing,
33
+ storage,
34
+ viewport
35
+ };
36
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}