@tanstack/preact-ai-devtools 0.0.1 → 0.1.1
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/LICENSE +21 -0
- package/README.md +132 -45
- package/dist/esm/AiDevtools.d.ts +5 -0
- package/dist/esm/AiDevtools.js +8 -0
- package/dist/esm/AiDevtools.js.map +1 -0
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/plugin.d.ts +12 -0
- package/dist/esm/plugin.js +13 -0
- package/dist/esm/plugin.js.map +1 -0
- package/dist/esm/production.d.ts +3 -0
- package/dist/esm/production.js +7 -0
- package/dist/esm/production.js.map +1 -0
- package/package.json +59 -8
- package/src/AiDevtools.tsx +9 -0
- package/src/index.ts +14 -0
- package/src/plugin.tsx +11 -0
- package/src/production.ts +5 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tanner Linsley
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,132 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./media/header_ai.png" >
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<br />
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
<a href="https://npmjs.com/package/@tanstack/ai" target="\_parent">
|
|
9
|
+
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/ai.svg" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://github.com/TanStack/ai" target="\_parent">
|
|
12
|
+
<img alt="" src="https://img.shields.io/github/stars/TanStack/ai.svg?style=social&label=Star" alt="GitHub stars" />
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://bundlephobia.com/result?p=@tanstack/ai@latest" target="\_parent">
|
|
15
|
+
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/ai@latest" />
|
|
16
|
+
</a>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div align="center">
|
|
20
|
+
<a href="#badge">
|
|
21
|
+
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
|
|
22
|
+
</a>
|
|
23
|
+
<a href="#badge">
|
|
24
|
+
<img src="https://img.shields.io/github/v/release/tanstack/ai" alt="Release"/>
|
|
25
|
+
</a>
|
|
26
|
+
<a href="https://twitter.com/tan_stack">
|
|
27
|
+
<img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/>
|
|
28
|
+
</a>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div align="center">
|
|
32
|
+
|
|
33
|
+
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
# TanStack AI
|
|
37
|
+
|
|
38
|
+
A powerful, type-safe AI SDK for building AI-powered applications.
|
|
39
|
+
|
|
40
|
+
- Provider-agnostic adapters (OpenAI, Anthropic, Gemini, Ollama, etc.)
|
|
41
|
+
- **Tree-shakeable adapters** - Import only what you need for smaller bundles
|
|
42
|
+
- **Multimodal content support** - Send images, audio, video, and documents
|
|
43
|
+
- **Image generation** - Generate images with OpenAI DALL-E/GPT-Image and Gemini Imagen
|
|
44
|
+
- Chat completion, streaming, and agent loop strategies
|
|
45
|
+
- Headless chat state management with adapters (SSE, HTTP stream, custom)
|
|
46
|
+
- Isomorphic type-safe tools with server/client execution
|
|
47
|
+
- **Enhanced integration with TanStack Start** - Share implementations between AI tools and server functions
|
|
48
|
+
|
|
49
|
+
### <a href="https://tanstack.com/ai">Read the docs →</b></a>
|
|
50
|
+
|
|
51
|
+
## Tree-Shakeable Adapters
|
|
52
|
+
|
|
53
|
+
Import only the functionality you need for smaller bundle sizes:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
// Only chat functionality - no summarization code bundled
|
|
57
|
+
import { openaiText } from '@tanstack/ai-openai/adapters'
|
|
58
|
+
import { generate } from '@tanstack/ai'
|
|
59
|
+
|
|
60
|
+
const textAdapter = openaiText()
|
|
61
|
+
|
|
62
|
+
const result = generate({
|
|
63
|
+
adapter: textAdapter,
|
|
64
|
+
model: 'gpt-4o',
|
|
65
|
+
messages: [{ role: 'user', content: [{ type: 'text', content: 'Hello!' }] }],
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
for await (const chunk of result) {
|
|
69
|
+
console.log(chunk)
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Available adapters: `openaiText`, `openaiEmbed`, `openaiSummarize`, `anthropicText`, `geminiText`, `ollamaText`, and more.
|
|
74
|
+
|
|
75
|
+
## Get Involved
|
|
76
|
+
|
|
77
|
+
- We welcome issues and pull requests!
|
|
78
|
+
- Participate in [GitHub discussions](https://github.com/TanStack/ai/discussions)
|
|
79
|
+
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
|
|
80
|
+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions
|
|
81
|
+
|
|
82
|
+
## Partners
|
|
83
|
+
|
|
84
|
+
<table align="center">
|
|
85
|
+
<tr>
|
|
86
|
+
<td>
|
|
87
|
+
<a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
|
|
88
|
+
<picture>
|
|
89
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
|
|
90
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
|
|
91
|
+
<img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
|
|
92
|
+
</picture>
|
|
93
|
+
</a>
|
|
94
|
+
</td>
|
|
95
|
+
<td>
|
|
96
|
+
<a href="https://www.cloudflare.com?utm_source=tanstack">
|
|
97
|
+
<picture>
|
|
98
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
|
|
99
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
|
|
100
|
+
<img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
|
|
101
|
+
</picture>
|
|
102
|
+
</a>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</table>
|
|
106
|
+
|
|
107
|
+
<div align="center">
|
|
108
|
+
<img src="./media/partner_logo.svg" alt="AI & you?" height="65">
|
|
109
|
+
<p>
|
|
110
|
+
We're looking for TanStack AI Partners to join our mission! Partner with us to push the boundaries of TanStack AI and build amazing things together.
|
|
111
|
+
</p>
|
|
112
|
+
<a href="mailto:partners@tanstack.com?subject=TanStack AI Partnership"><b>LET'S CHAT</b></a>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
## Explore the TanStack Ecosystem
|
|
116
|
+
|
|
117
|
+
- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
|
|
118
|
+
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
|
|
119
|
+
- <a href="https://github.com/tanstack/devtools"><b>TanStack Devtools</b></a> – Unified devtools panel
|
|
120
|
+
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
|
|
121
|
+
- <a href="https://github.com/tanstack/pacer"><b>TanStack Pacer</b></a> – Debouncing, throttling, batching
|
|
122
|
+
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
|
|
123
|
+
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
|
|
124
|
+
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
|
|
125
|
+
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
|
|
126
|
+
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
|
|
127
|
+
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
|
|
128
|
+
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering
|
|
129
|
+
|
|
130
|
+
… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>
|
|
131
|
+
|
|
132
|
+
<!-- USE THE FORCE LUKE -->
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DevtoolsPanelProps } from '@tanstack/devtools-utils/preact';
|
|
2
|
+
declare const AiDevtoolsPanel: (props: DevtoolsPanelProps | undefined) => import("preact").JSX.Element, AiDevtoolsPanelNoOp: (_props: DevtoolsPanelProps | undefined) => import("preact").JSX.Element;
|
|
3
|
+
export interface AiDevtoolsPreactInit extends DevtoolsPanelProps {
|
|
4
|
+
}
|
|
5
|
+
export { AiDevtoolsPanel, AiDevtoolsPanelNoOp };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createPreactPanel } from "@tanstack/devtools-utils/preact";
|
|
2
|
+
import { AiDevtoolsCore } from "@tanstack/ai-devtools-core";
|
|
3
|
+
const [AiDevtoolsPanel, AiDevtoolsPanelNoOp] = createPreactPanel(AiDevtoolsCore);
|
|
4
|
+
export {
|
|
5
|
+
AiDevtoolsPanel,
|
|
6
|
+
AiDevtoolsPanelNoOp
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=AiDevtools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiDevtools.js","sources":["../../src/AiDevtools.tsx"],"sourcesContent":["import { createPreactPanel } from '@tanstack/devtools-utils/preact'\nimport { AiDevtoolsCore } from '@tanstack/ai-devtools-core'\nimport type { DevtoolsPanelProps } from '@tanstack/devtools-utils/preact'\n\nconst [AiDevtoolsPanel, AiDevtoolsPanelNoOp] = createPreactPanel(AiDevtoolsCore)\n\nexport interface AiDevtoolsPreactInit extends DevtoolsPanelProps {}\n\nexport { AiDevtoolsPanel, AiDevtoolsPanelNoOp }\n"],"names":[],"mappings":";;AAIA,MAAM,CAAC,iBAAiB,mBAAmB,IAAI,kBAAkB,cAAc;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const AiDevtoolsPanel: (props: import('@tanstack/devtools-utils/preact').DevtoolsPanelProps | undefined) => import("preact").JSX.Element;
|
|
2
|
+
export declare const aiDevtoolsPlugin: () => {
|
|
3
|
+
render: (_el: HTMLElement, theme: "light" | "dark") => import("preact").JSX.Element;
|
|
4
|
+
name: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type { AiDevtoolsPreactInit } from './AiDevtools.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AiDevtoolsPanelNoOp, AiDevtoolsPanel as AiDevtoolsPanel$1 } from "./AiDevtools.js";
|
|
2
|
+
import { aiDevtoolsNoOpPlugin, aiDevtoolsPlugin as aiDevtoolsPlugin$1 } from "./plugin.js";
|
|
3
|
+
const AiDevtoolsPanel = process.env.NODE_ENV !== "development" ? AiDevtoolsPanelNoOp : AiDevtoolsPanel$1;
|
|
4
|
+
const aiDevtoolsPlugin = process.env.NODE_ENV !== "development" ? aiDevtoolsNoOpPlugin : aiDevtoolsPlugin$1;
|
|
5
|
+
export {
|
|
6
|
+
AiDevtoolsPanel,
|
|
7
|
+
aiDevtoolsPlugin
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './AiDevtools'\nimport * as plugin from './plugin'\n\nexport const AiDevtoolsPanel =\n process.env.NODE_ENV !== 'development'\n ? Devtools.AiDevtoolsPanelNoOp\n : Devtools.AiDevtoolsPanel\n\nexport const aiDevtoolsPlugin =\n process.env.NODE_ENV !== 'development'\n ? plugin.aiDevtoolsNoOpPlugin\n : plugin.aiDevtoolsPlugin\n\nexport type { AiDevtoolsPreactInit } from './AiDevtools'\n"],"names":["Devtools.AiDevtoolsPanelNoOp","Devtools.AiDevtoolsPanel","plugin.aiDevtoolsNoOpPlugin","plugin.aiDevtoolsPlugin"],"mappings":";;AAGO,MAAM,kBACX,QAAQ,IAAI,aAAa,gBACrBA,sBACAC;AAEC,MAAM,mBACX,QAAQ,IAAI,aAAa,gBACrBC,uBACAC;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const aiDevtoolsPlugin: () => {
|
|
2
|
+
render: (_el: HTMLElement, theme: "light" | "dark") => import("preact").JSX.Element;
|
|
3
|
+
name: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
}, aiDevtoolsNoOpPlugin: () => {
|
|
7
|
+
render: (_el: HTMLElement, _theme: "light" | "dark") => import("preact").JSX.Element;
|
|
8
|
+
name: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export { aiDevtoolsPlugin, aiDevtoolsNoOpPlugin };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createPreactPlugin } from "@tanstack/devtools-utils/preact";
|
|
2
|
+
import { AiDevtoolsPanel } from "./AiDevtools.js";
|
|
3
|
+
const [aiDevtoolsPlugin, aiDevtoolsNoOpPlugin] = createPreactPlugin({
|
|
4
|
+
Component: AiDevtoolsPanel,
|
|
5
|
+
name: "TanStack AI",
|
|
6
|
+
id: "tanstack-ai",
|
|
7
|
+
defaultOpen: true
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
aiDevtoolsNoOpPlugin,
|
|
11
|
+
aiDevtoolsPlugin
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["../../src/plugin.tsx"],"sourcesContent":["import { createPreactPlugin } from '@tanstack/devtools-utils/preact'\nimport { AiDevtoolsPanel } from './AiDevtools'\n\nconst [aiDevtoolsPlugin, aiDevtoolsNoOpPlugin] = createPreactPlugin({\n Component: AiDevtoolsPanel,\n name: 'TanStack AI',\n id: 'tanstack-ai',\n defaultOpen: true,\n})\n\nexport { aiDevtoolsPlugin, aiDevtoolsNoOpPlugin }\n"],"names":[],"mappings":";;AAGA,MAAM,CAAC,kBAAkB,oBAAoB,IAAI,mBAAmB;AAAA,EAClE,WAAW;AAAA,EACX,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,aAAa;AACf,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/preact-ai-devtools",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Preact Devtools for TanStack AI.",
|
|
5
|
+
"author": "tannerlinsley",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://tanstack.com/ai",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/TanStack/ai.git",
|
|
11
|
+
"directory": "packages/typescript/preact-ai-devtools"
|
|
12
|
+
},
|
|
13
|
+
"funding": {
|
|
14
|
+
"type": "github",
|
|
15
|
+
"url": "https://github.com/sponsors/tannerlinsley"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"types": "./dist/esm/index.d.ts",
|
|
19
|
+
"module": "./dist/esm/index.js",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./dist/esm/index.d.ts",
|
|
24
|
+
"default": "./dist/esm/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"./production": {
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/esm/production.d.ts",
|
|
30
|
+
"default": "./dist/esm/production.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"src"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@tanstack/devtools-utils": "^0.3.0",
|
|
42
|
+
"@tanstack/ai-devtools-core": "0.2.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@vitest/coverage-v8": "4.0.14",
|
|
46
|
+
"vite": "^7.2.7"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"preact": "^10.0.0"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"clean": "premove ./build ./dist",
|
|
53
|
+
"lint:fix": "eslint ./src --fix",
|
|
54
|
+
"test:eslint": "eslint ./src",
|
|
55
|
+
"test:lib": "vitest --passWithNoTests",
|
|
56
|
+
"test:lib:dev": "pnpm test:lib --watch",
|
|
57
|
+
"test:types": "tsc",
|
|
58
|
+
"test:build": "publint --strict",
|
|
59
|
+
"build": "vite build"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createPreactPanel } from '@tanstack/devtools-utils/preact'
|
|
2
|
+
import { AiDevtoolsCore } from '@tanstack/ai-devtools-core'
|
|
3
|
+
import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/preact'
|
|
4
|
+
|
|
5
|
+
const [AiDevtoolsPanel, AiDevtoolsPanelNoOp] = createPreactPanel(AiDevtoolsCore)
|
|
6
|
+
|
|
7
|
+
export interface AiDevtoolsPreactInit extends DevtoolsPanelProps {}
|
|
8
|
+
|
|
9
|
+
export { AiDevtoolsPanel, AiDevtoolsPanelNoOp }
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Devtools from './AiDevtools'
|
|
2
|
+
import * as plugin from './plugin'
|
|
3
|
+
|
|
4
|
+
export const AiDevtoolsPanel =
|
|
5
|
+
process.env.NODE_ENV !== 'development'
|
|
6
|
+
? Devtools.AiDevtoolsPanelNoOp
|
|
7
|
+
: Devtools.AiDevtoolsPanel
|
|
8
|
+
|
|
9
|
+
export const aiDevtoolsPlugin =
|
|
10
|
+
process.env.NODE_ENV !== 'development'
|
|
11
|
+
? plugin.aiDevtoolsNoOpPlugin
|
|
12
|
+
: plugin.aiDevtoolsPlugin
|
|
13
|
+
|
|
14
|
+
export type { AiDevtoolsPreactInit } from './AiDevtools'
|
package/src/plugin.tsx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createPreactPlugin } from '@tanstack/devtools-utils/preact'
|
|
2
|
+
import { AiDevtoolsPanel } from './AiDevtools'
|
|
3
|
+
|
|
4
|
+
const [aiDevtoolsPlugin, aiDevtoolsNoOpPlugin] = createPreactPlugin({
|
|
5
|
+
Component: AiDevtoolsPanel,
|
|
6
|
+
name: 'TanStack AI',
|
|
7
|
+
id: 'tanstack-ai',
|
|
8
|
+
defaultOpen: true,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export { aiDevtoolsPlugin, aiDevtoolsNoOpPlugin }
|