tidewave 0.4.0 → 0.5.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.
- package/README.md +67 -19
- package/dist/cli/index.js +6 -6
- package/dist/next-js/handler.js +7 -7
- package/dist/tools.d.ts +2 -2
- package/dist/vite-plugin.js +7 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
# Tidewave
|
|
2
2
|
|
|
3
|
-
> Tidewave Web for Next.js is currently in alpha testing!
|
|
3
|
+
> Tidewave Web for Next.js and React+Vite is currently in alpha testing!
|
|
4
4
|
|
|
5
5
|
Tidewave is the coding agent for full-stack web app development.
|
|
6
6
|
[See our website](https://tidewave.ai) for more information.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
server-side framework, [follow the steps here instead](http://hexdocs.pm/tidewave/react.html).
|
|
8
|
+
If you are using Next.js or you have a React + Vite frontend, talking either to
|
|
9
|
+
a backend as a service (such as Supabase) or a third-party framework, you are in
|
|
10
|
+
the right place!
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
If you are using React with Django, FastAPI, Flask, Phoenix, or Rails,
|
|
13
|
+
[follow the steps here instead](http://hexdocs.pm/tidewave/react.html).
|
|
14
|
+
|
|
15
|
+
This project can also be used through the CLI or as a standalone Model Context
|
|
16
|
+
Protocol (MCP) server for your editors.
|
|
15
17
|
|
|
16
18
|
## Installation
|
|
17
19
|
|
|
18
20
|
### Next.js
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
If you are using Next.js, install Tidewave with:
|
|
21
23
|
|
|
22
24
|
```sh
|
|
23
25
|
$ npm install -D tidewave
|
|
@@ -39,7 +41,7 @@ export default async function handler(
|
|
|
39
41
|
res: NextApiResponse,
|
|
40
42
|
) {
|
|
41
43
|
if (process.env.NODE_ENV === 'development') {
|
|
42
|
-
const { tidewaveHandler } = await import('tidewave/next-js');
|
|
44
|
+
const { tidewaveHandler } = await import('tidewave/next-js/handler');
|
|
43
45
|
const handler = await tidewaveHandler();
|
|
44
46
|
return handler(req, res);
|
|
45
47
|
} else {
|
|
@@ -58,14 +60,29 @@ export const config = {
|
|
|
58
60
|
_Note: this uses the **Pages Router**, however it works regardless of the router
|
|
59
61
|
type you use in your application._
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
If you are using Next.js 16+, then create (or modify) `proxy.ts` with:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
67
|
+
|
|
68
|
+
export function proxy(req: NextRequest): NextResponse {
|
|
69
|
+
if (req.nextUrl.pathname.startsWith('/tidewave')) {
|
|
70
|
+
return NextResponse.rewrite(new URL('/api/tidewave', req.url));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Here you could add your own logic or different middlewares.
|
|
74
|
+
return NextResponse.next();
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For Next.js 15+ and earlier, create (or modify) `middleware.ts` with:
|
|
62
79
|
|
|
63
80
|
```typescript
|
|
64
81
|
import { NextRequest, NextResponse } from 'next/server';
|
|
65
82
|
|
|
66
83
|
export function middleware(req: NextRequest): NextResponse {
|
|
67
84
|
if (req.nextUrl.pathname.startsWith('/tidewave')) {
|
|
68
|
-
return NextResponse.rewrite(new URL(
|
|
85
|
+
return NextResponse.rewrite(new URL('/api/tidewave', req.url));
|
|
69
86
|
}
|
|
70
87
|
|
|
71
88
|
// Here you could add your own logic or different middlewares.
|
|
@@ -77,20 +94,31 @@ export const config = {
|
|
|
77
94
|
};
|
|
78
95
|
```
|
|
79
96
|
|
|
80
|
-
Finally, we
|
|
81
|
-
|
|
97
|
+
Finally, we expose your application's spans, events, and logs to Tidewave MCP.
|
|
98
|
+
First install the NodeSDK:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
npm install @opentelemetry/sdk-node
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
And then create (or modify) a custom `instrumentation.ts` file in the root
|
|
105
|
+
directory of the project (or inside `src` folder if using one):
|
|
82
106
|
|
|
83
107
|
```typescript
|
|
84
108
|
// instrumentation.ts
|
|
85
109
|
import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
86
|
-
import {
|
|
110
|
+
import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
111
|
+
import type { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
87
112
|
|
|
88
113
|
export async function register() {
|
|
89
114
|
const runtime = process.env.NEXT_RUNTIME;
|
|
90
115
|
const env = process.env.NODE_ENV;
|
|
91
116
|
|
|
92
117
|
// Add your app own processes here existing configuration
|
|
93
|
-
const sdkConfig
|
|
118
|
+
const sdkConfig: {
|
|
119
|
+
spanProcessors: SpanProcessor[];
|
|
120
|
+
logRecordProcessors: LogRecordProcessor[];
|
|
121
|
+
} = {
|
|
94
122
|
spanProcessors: [],
|
|
95
123
|
logRecordProcessors: [],
|
|
96
124
|
};
|
|
@@ -110,8 +138,16 @@ export async function register() {
|
|
|
110
138
|
}
|
|
111
139
|
```
|
|
112
140
|
|
|
141
|
+
Now make sure
|
|
142
|
+
[Tidewave is installed](https://hexdocs.pm/tidewave/installation.html) and you
|
|
143
|
+
are ready to connect Tidewave to your app.
|
|
144
|
+
|
|
113
145
|
### React + Vite
|
|
114
146
|
|
|
147
|
+
If you are building a front-end application, using a backend as a service, such
|
|
148
|
+
as Supabase, or a non-officially supported web framework, we recommend using our
|
|
149
|
+
React + Vite integration.
|
|
150
|
+
|
|
115
151
|
Install it with:
|
|
116
152
|
|
|
117
153
|
```sh
|
|
@@ -135,9 +171,21 @@ export default defineConfig({
|
|
|
135
171
|
});
|
|
136
172
|
```
|
|
137
173
|
|
|
174
|
+
Now make sure
|
|
175
|
+
[Tidewave is installed](https://hexdocs.pm/tidewave/installation.html) and you
|
|
176
|
+
are ready to connect Tidewave to your app.
|
|
177
|
+
|
|
178
|
+
If you are using Supabase or similar, you can prompt Tidewave to use the
|
|
179
|
+
`supabase` CLI so it has complete access to your database. For non-officially
|
|
180
|
+
supported web frameworks, our React + Vite integration allows Tidewave Web to
|
|
181
|
+
perform changes on the front-end, and the agent will be able to modify your
|
|
182
|
+
backend code as usual, but some functionality (such as accessing logs, doing
|
|
183
|
+
database calls, etc) won't be available.
|
|
184
|
+
|
|
138
185
|
### Configuration
|
|
139
186
|
|
|
140
|
-
Next.js' `tidewaveHandler` and Vite's `tidewave` accept the configuration
|
|
187
|
+
Next.js' `tidewaveHandler` and Vite's `tidewave` accept the configuration
|
|
188
|
+
options below:
|
|
141
189
|
|
|
142
190
|
- `allow_remote_access:` allow remote connections when true (default false)
|
|
143
191
|
- `allowed_origins:` defaults to the current host/port
|
|
@@ -145,9 +193,9 @@ Next.js' `tidewaveHandler` and Vite's `tidewave` accept the configuration option
|
|
|
145
193
|
|
|
146
194
|
## CLI
|
|
147
195
|
|
|
148
|
-
Tidewave.js also comes with a CLI for developers who want to use it
|
|
149
|
-
|
|
150
|
-
|
|
196
|
+
Tidewave.js also comes with a CLI for developers who want to use it as a
|
|
197
|
+
standalone MCP or query its functionality directly. Note this functionality is
|
|
198
|
+
separate from Tidewave Web.
|
|
151
199
|
|
|
152
200
|
### STDIO MCP
|
|
153
201
|
|
package/dist/cli/index.js
CHANGED
|
@@ -4007,12 +4007,12 @@ Module reference format:
|
|
|
4007
4007
|
|
|
4008
4008
|
Examples:
|
|
4009
4009
|
- src/types.ts:SymbolInfo (local file symbol)
|
|
4010
|
-
- lodash:isEmpty (dependency function)
|
|
4010
|
+
- lodash:isEmpty (dependency function)
|
|
4011
4011
|
- react:Component#render (instance method)
|
|
4012
4012
|
- node:Math.max (builtin static method)`, docsInputSchema, sourceInputSchema, getLogsInputSchema, tools;
|
|
4013
4013
|
var init_tools = __esm(() => {
|
|
4014
4014
|
init_zod();
|
|
4015
|
-
projectEvalDescription = `
|
|
4015
|
+
projectEvalDescription = `
|
|
4016
4016
|
Evaluates JavaScript/TypeScript code in the context of the project.
|
|
4017
4017
|
|
|
4018
4018
|
The current NodeJS version is: ${process.version}
|
|
@@ -4039,7 +4039,7 @@ Defaults to 30000 (30 seconds).`),
|
|
|
4039
4039
|
reference: exports_external.string().describe(referenceDescription)
|
|
4040
4040
|
});
|
|
4041
4041
|
getLogsInputSchema = exports_external.object({
|
|
4042
|
-
tail: exports_external.number().
|
|
4042
|
+
tail: exports_external.number().describe("Number of log entries to return from the end"),
|
|
4043
4043
|
grep: exports_external.string().optional().describe("Filter logs with regex pattern (case insensitive)"),
|
|
4044
4044
|
level: exports_external.enum(["DEBUG", "INFO", "WARN", "ERROR"]).optional().describe("Filter by log severity level"),
|
|
4045
4045
|
since: exports_external.string().optional().describe("ISO 8601 timestamp - return logs after this time")
|
|
@@ -4924,12 +4924,12 @@ var init_src = __esm(() => {
|
|
|
4924
4924
|
});
|
|
4925
4925
|
|
|
4926
4926
|
// package.json
|
|
4927
|
-
var name = "tidewave", version = "0.
|
|
4927
|
+
var name = "tidewave", version = "0.5.0", package_default;
|
|
4928
4928
|
var init_package = __esm(() => {
|
|
4929
4929
|
package_default = {
|
|
4930
4930
|
name,
|
|
4931
4931
|
version,
|
|
4932
|
-
description: "Tidewave
|
|
4932
|
+
description: "Tidewave for JavaScript/Next.js",
|
|
4933
4933
|
keywords: [
|
|
4934
4934
|
"typescript",
|
|
4935
4935
|
"documentation",
|
|
@@ -4940,7 +4940,7 @@ var init_package = __esm(() => {
|
|
|
4940
4940
|
homepage: "https://tidewave.ai",
|
|
4941
4941
|
repository: {
|
|
4942
4942
|
type: "git",
|
|
4943
|
-
url: "git+https://github.com/
|
|
4943
|
+
url: "git+https://github.com/tidewave-ai/tidewave_js.git"
|
|
4944
4944
|
},
|
|
4945
4945
|
license: "Apache-2.0",
|
|
4946
4946
|
author: "Dashbit",
|
package/dist/next-js/handler.js
CHANGED
|
@@ -28,7 +28,7 @@ var __export = (target, all) => {
|
|
|
28
28
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
29
29
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
30
|
|
|
31
|
-
// node_modules/connect/node_modules/
|
|
31
|
+
// node_modules/connect/node_modules/ms/index.js
|
|
32
32
|
var require_ms = __commonJS((exports, module) => {
|
|
33
33
|
var s = 1000;
|
|
34
34
|
var m = s * 60;
|
|
@@ -19623,12 +19623,12 @@ Module reference format:
|
|
|
19623
19623
|
|
|
19624
19624
|
Examples:
|
|
19625
19625
|
- src/types.ts:SymbolInfo (local file symbol)
|
|
19626
|
-
- lodash:isEmpty (dependency function)
|
|
19626
|
+
- lodash:isEmpty (dependency function)
|
|
19627
19627
|
- react:Component#render (instance method)
|
|
19628
19628
|
- node:Math.max (builtin static method)`, docsInputSchema, sourceInputSchema, getLogsInputSchema, tools;
|
|
19629
19629
|
var init_tools = __esm(() => {
|
|
19630
19630
|
init_zod();
|
|
19631
|
-
projectEvalDescription = `
|
|
19631
|
+
projectEvalDescription = `
|
|
19632
19632
|
Evaluates JavaScript/TypeScript code in the context of the project.
|
|
19633
19633
|
|
|
19634
19634
|
The current NodeJS version is: ${process.version}
|
|
@@ -19655,7 +19655,7 @@ Defaults to 30000 (30 seconds).`),
|
|
|
19655
19655
|
reference: exports_external.string().describe(referenceDescription)
|
|
19656
19656
|
});
|
|
19657
19657
|
getLogsInputSchema = exports_external.object({
|
|
19658
|
-
tail: exports_external.number().
|
|
19658
|
+
tail: exports_external.number().describe("Number of log entries to return from the end"),
|
|
19659
19659
|
grep: exports_external.string().optional().describe("Filter logs with regex pattern (case insensitive)"),
|
|
19660
19660
|
level: exports_external.enum(["DEBUG", "INFO", "WARN", "ERROR"]).optional().describe("Filter by log severity level"),
|
|
19661
19661
|
since: exports_external.string().optional().describe("ISO 8601 timestamp - return logs after this time")
|
|
@@ -19721,12 +19721,12 @@ Defaults to 30000 (30 seconds).`),
|
|
|
19721
19721
|
});
|
|
19722
19722
|
|
|
19723
19723
|
// package.json
|
|
19724
|
-
var name = "tidewave", version = "0.
|
|
19724
|
+
var name = "tidewave", version = "0.5.0", package_default;
|
|
19725
19725
|
var init_package = __esm(() => {
|
|
19726
19726
|
package_default = {
|
|
19727
19727
|
name,
|
|
19728
19728
|
version,
|
|
19729
|
-
description: "Tidewave
|
|
19729
|
+
description: "Tidewave for JavaScript/Next.js",
|
|
19730
19730
|
keywords: [
|
|
19731
19731
|
"typescript",
|
|
19732
19732
|
"documentation",
|
|
@@ -19737,7 +19737,7 @@ var init_package = __esm(() => {
|
|
|
19737
19737
|
homepage: "https://tidewave.ai",
|
|
19738
19738
|
repository: {
|
|
19739
19739
|
type: "git",
|
|
19740
|
-
url: "git+https://github.com/
|
|
19740
|
+
url: "git+https://github.com/tidewave-ai/tidewave_js.git"
|
|
19741
19741
|
},
|
|
19742
19742
|
license: "Apache-2.0",
|
|
19743
19743
|
author: "Dashbit",
|
package/dist/tools.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare const sourceInputSchema: z.ZodObject<{
|
|
|
57
57
|
reference: string;
|
|
58
58
|
}>;
|
|
59
59
|
export declare const getLogsInputSchema: z.ZodObject<{
|
|
60
|
-
tail: z.
|
|
60
|
+
tail: z.ZodNumber;
|
|
61
61
|
grep: z.ZodOptional<z.ZodString>;
|
|
62
62
|
level: z.ZodOptional<z.ZodEnum<["DEBUG", "INFO", "WARN", "ERROR"]>>;
|
|
63
63
|
since: z.ZodOptional<z.ZodString>;
|
|
@@ -67,7 +67,7 @@ export declare const getLogsInputSchema: z.ZodObject<{
|
|
|
67
67
|
level?: "DEBUG" | "INFO" | "WARN" | "ERROR" | undefined;
|
|
68
68
|
since?: string | undefined;
|
|
69
69
|
}, {
|
|
70
|
-
tail
|
|
70
|
+
tail: number;
|
|
71
71
|
grep?: string | undefined;
|
|
72
72
|
level?: "DEBUG" | "INFO" | "WARN" | "ERROR" | undefined;
|
|
73
73
|
since?: string | undefined;
|
package/dist/vite-plugin.js
CHANGED
|
@@ -28,7 +28,7 @@ var __export = (target, all) => {
|
|
|
28
28
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
29
29
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
30
|
|
|
31
|
-
// node_modules/connect/node_modules/
|
|
31
|
+
// node_modules/connect/node_modules/ms/index.js
|
|
32
32
|
var require_ms = __commonJS((exports, module) => {
|
|
33
33
|
var s = 1000;
|
|
34
34
|
var m = s * 60;
|
|
@@ -19623,12 +19623,12 @@ Module reference format:
|
|
|
19623
19623
|
|
|
19624
19624
|
Examples:
|
|
19625
19625
|
- src/types.ts:SymbolInfo (local file symbol)
|
|
19626
|
-
- lodash:isEmpty (dependency function)
|
|
19626
|
+
- lodash:isEmpty (dependency function)
|
|
19627
19627
|
- react:Component#render (instance method)
|
|
19628
19628
|
- node:Math.max (builtin static method)`, docsInputSchema, sourceInputSchema, getLogsInputSchema, tools;
|
|
19629
19629
|
var init_tools = __esm(() => {
|
|
19630
19630
|
init_zod();
|
|
19631
|
-
projectEvalDescription = `
|
|
19631
|
+
projectEvalDescription = `
|
|
19632
19632
|
Evaluates JavaScript/TypeScript code in the context of the project.
|
|
19633
19633
|
|
|
19634
19634
|
The current NodeJS version is: ${process.version}
|
|
@@ -19655,7 +19655,7 @@ Defaults to 30000 (30 seconds).`),
|
|
|
19655
19655
|
reference: exports_external.string().describe(referenceDescription)
|
|
19656
19656
|
});
|
|
19657
19657
|
getLogsInputSchema = exports_external.object({
|
|
19658
|
-
tail: exports_external.number().
|
|
19658
|
+
tail: exports_external.number().describe("Number of log entries to return from the end"),
|
|
19659
19659
|
grep: exports_external.string().optional().describe("Filter logs with regex pattern (case insensitive)"),
|
|
19660
19660
|
level: exports_external.enum(["DEBUG", "INFO", "WARN", "ERROR"]).optional().describe("Filter by log severity level"),
|
|
19661
19661
|
since: exports_external.string().optional().describe("ISO 8601 timestamp - return logs after this time")
|
|
@@ -19721,12 +19721,12 @@ Defaults to 30000 (30 seconds).`),
|
|
|
19721
19721
|
});
|
|
19722
19722
|
|
|
19723
19723
|
// package.json
|
|
19724
|
-
var name = "tidewave", version = "0.
|
|
19724
|
+
var name = "tidewave", version = "0.5.0", package_default;
|
|
19725
19725
|
var init_package = __esm(() => {
|
|
19726
19726
|
package_default = {
|
|
19727
19727
|
name,
|
|
19728
19728
|
version,
|
|
19729
|
-
description: "Tidewave
|
|
19729
|
+
description: "Tidewave for JavaScript/Next.js",
|
|
19730
19730
|
keywords: [
|
|
19731
19731
|
"typescript",
|
|
19732
19732
|
"documentation",
|
|
@@ -19737,7 +19737,7 @@ var init_package = __esm(() => {
|
|
|
19737
19737
|
homepage: "https://tidewave.ai",
|
|
19738
19738
|
repository: {
|
|
19739
19739
|
type: "git",
|
|
19740
|
-
url: "git+https://github.com/
|
|
19740
|
+
url: "git+https://github.com/tidewave-ai/tidewave_js.git"
|
|
19741
19741
|
},
|
|
19742
19742
|
license: "Apache-2.0",
|
|
19743
19743
|
author: "Dashbit",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tidewave",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Tidewave
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Tidewave for JavaScript/Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
7
7
|
"documentation",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"homepage": "https://tidewave.ai",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/
|
|
15
|
+
"url": "git+https://github.com/tidewave-ai/tidewave_js.git"
|
|
16
16
|
},
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"author": "Dashbit",
|