Repository navigation
Expand file tree
/
Copy pathnext.config.js
More file actions
197 lines (195 loc) · 9.5 KB
/
Copy pathnext.config.js
File metadata and controls
197 lines (195 loc) · 9.5 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
const path = require('path')
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
transpilePackages: ['@clerum/frontend-components'],
experimental: {
globalNotFound: true,
},
// Keep Turbopack rooted at the monorepo so it can resolve the linked
// @clerum packages without guessing from whichever lockfile it finds first.
turbopack: {
root: path.join(__dirname, '..'),
},
async rewrites() {
// NOTE: `/control-api/:path*` is intentionally NOT rewritten here. It is served by
// the app-router handler app/control-api/[...path]/route.ts, which streams the body
// (no 10MiB proxyClientMaxBodySize truncation) and honours the runtime-configurable
// CONTROL_API_PROXY_TIMEOUT_MS. Routing it through a rewrite sends it via Next's
// internal proxy, which silently truncates request bodies at 10MiB and hard-caps at
// a 30s proxyTimeout — the "Request timed out" / "request aborted" failure on large
// GFS uploads. The handler reads CONTROL_API_INTERNAL_URL for its upstream.
return [
{ source: '/agents', destination: '/hosts' },
{ source: '/agents/:path*', destination: '/hosts/:path*' },
{ source: '/connectors', destination: '/mcp-servers' },
{ source: '/connectors/:path*', destination: '/mcp-servers/:path*' },
{ source: '/plugins/sdk', destination: '/plugin-workload-sdk' },
{ source: '/plugins', destination: '/workflow-recipes' },
{ source: '/plugins/:path*', destination: '/workflow-recipes/:path*' },
{ source: '/agent-files', destination: '/shared-filesystems' },
{ source: '/agent-files/:path*', destination: '/shared-filesystems/:path*' },
{ source: '/agent-outputs/:path*', destination: '/outputs/:path*' },
{ source: '/global-file-system', destination: '/gfs' },
{ source: '/global-file-system/:path*', destination: '/gfs/:path*' },
{ source: '/external-channels', destination: '/communication-channels' },
{
source: '/external-channels/:path*',
destination: '/communication-channels/:path*',
},
{ source: '/users-and-teams/admins/new', destination: '/control-admins/new' },
{ source: '/users-and-teams', destination: '/profile-admin/users' },
{ source: '/users-and-teams/:path*', destination: '/profile-admin/:path*' },
{ source: '/marketplace/connectors', destination: '/registry' },
{ source: '/marketplace/plugins', destination: '/registry' },
{ source: '/marketplace/:path*', destination: '/registry/:path*' },
{ source: '/cost-and-usage/:path*', destination: '/cost/:path*' },
{ source: '/settings/ui', destination: '/settings' },
]
},
async redirects() {
// Cost & Usage consolidation: old top-level routes now live under /cost/*.
// Keep bookmarks and deep links working (including their sub-routes).
return [
{ source: '/hosts', destination: '/agents', permanent: true },
{ source: '/hosts/:path*', destination: '/agents/:path*', permanent: true },
{ source: '/mcp-servers', destination: '/connectors', permanent: true },
{ source: '/mcp-servers/:path*', destination: '/connectors/:path*', permanent: true },
{ source: '/workflow-recipes', destination: '/plugins', permanent: true },
{ source: '/workflow-recipes/:path*', destination: '/plugins/:path*', permanent: true },
{ source: '/plugin-workload-sdk', destination: '/plugins/sdk', permanent: true },
{ source: '/shared-filesystems', destination: '/agent-files', permanent: true },
{
source: '/shared-filesystems/:path*',
destination: '/agent-files/:path*',
permanent: true,
},
{ source: '/shared-files', destination: '/agent-files', permanent: true },
{ source: '/shared-files/:path*', destination: '/agent-files/:path*', permanent: true },
{ source: '/gfs', destination: '/global-file-system', permanent: true },
{
source: '/gfs/:path*',
destination: '/global-file-system/:path*',
permanent: true,
},
{ source: '/global-files', destination: '/global-file-system', permanent: true },
{
source: '/global-files/:path*',
destination: '/global-file-system/:path*',
permanent: true,
},
{ source: '/communication-channels', destination: '/external-channels', permanent: true },
{
source: '/communication-channels/:path*',
destination: '/external-channels/:path*',
permanent: true,
},
{ source: '/profile-admin', destination: '/users-and-teams', permanent: true },
{ source: '/profile-admin/:path*', destination: '/users-and-teams/:path*', permanent: true },
{
source: '/control-admins/new',
destination: '/users-and-teams/admins/new',
permanent: true,
},
{ source: '/registry', destination: '/marketplace/connectors', permanent: true },
{ source: '/registry/:path*', destination: '/marketplace/:path*', permanent: true },
// The Publisher console folded into the org-named Marketplace tab (§4).
// Keep old bookmarks working. Specific routes precede the catch-all.
{ source: '/publisher/api-keys', destination: '/marketplace/keys', permanent: true },
{
source: '/publisher/credentials',
destination: '/marketplace/org/credentials',
permanent: true,
},
{
source: '/publisher/shared-with-me',
destination: '/marketplace/org/entries',
permanent: true,
},
{ source: '/publisher/entries', destination: '/marketplace/org/entries', permanent: true },
{ source: '/publisher', destination: '/marketplace/org/entries', permanent: true },
{ source: '/publisher/:path*', destination: '/marketplace/org/entries', permanent: true },
{ source: '/cost', destination: '/cost-and-usage/usage', permanent: true },
{ source: '/cost/:path*', destination: '/cost-and-usage/:path*', permanent: true },
// Host detail tab consolidation (R1-H1 in feat/agent-ux-polish PR
// review): the old top-level tabs are now sub-tabs under the new
// `access` and `advanced` parents. Send each old slug to its new
// parent so bookmarks, shared links, and the approval-tools E2E
// (which navigates to /hosts/<name>/approvals) still reach the
// section they used to.
{
source: '/agents/:name/member-access',
destination: '/agents/:name/access',
permanent: true,
},
{ source: '/agents/:name/team-access', destination: '/agents/:name/access', permanent: true },
{ source: '/agents/:name/approvals', destination: '/agents/:name/advanced', permanent: true },
{ source: '/agents/:name/env-vars', destination: '/agents/:name/advanced', permanent: true },
// The agent-scoped Contexts tab was renamed to Connectors. Keep old
// bookmarks and shared links working before the /agents -> /hosts
// rewrite reaches the physical tab route.
{
source: '/agents/:name/contexts',
destination: '/agents/:name/connectors',
permanent: true,
},
// Connector edit "Context" tab renamed to "Access".
{
source: '/connectors/:name/edit/context',
destination: '/connectors/:name/edit/access',
permanent: true,
},
// Users & Teams access tabs consolidated onto "Agents" (D10): the old
// "Contexts" and "Access" tab URLs all land on the Agents tab.
{
source: '/users-and-teams/users/:id/contexts',
destination: '/users-and-teams/users/:id/agents',
permanent: true,
},
{
source: '/users-and-teams/teams/:id/contexts',
destination: '/users-and-teams/teams/:id/agents',
permanent: true,
},
{
source: '/users-and-teams/users/:id/access',
destination: '/users-and-teams/users/:id/agents',
permanent: true,
},
{
source: '/users-and-teams/teams/:id/access',
destination: '/users-and-teams/teams/:id/agents',
permanent: true,
},
{ source: '/marketplace', destination: '/marketplace/connectors', permanent: true },
{ source: '/cost-and-usage', destination: '/cost-and-usage/usage', permanent: true },
{
source: '/agent-outputs',
destination: '/agent-outputs/recipe-artifacts',
permanent: true,
},
{ source: '/outputs', destination: '/agent-outputs/recipe-artifacts', permanent: true },
{ source: '/outputs/:path*', destination: '/agent-outputs/:path*', permanent: true },
{ source: '/secrets', destination: '/secrets/llm', permanent: true },
{ source: '/settings', destination: '/settings/ui', permanent: true },
{ source: '/traces/hosts', destination: '/traces', permanent: true },
{ source: '/traces/sessions', destination: '/traces', permanent: true },
{ source: '/traces/workflows', destination: '/traces', permanent: true },
{ source: '/usage', destination: '/cost-and-usage/usage', permanent: true },
{ source: '/usage/:path*', destination: '/cost-and-usage/usage/:path*', permanent: true },
{ source: '/llm-prices', destination: '/cost-and-usage/llm-prices', permanent: true },
{
source: '/llm-prices/:path*',
destination: '/cost-and-usage/llm-prices/:path*',
permanent: true,
},
{ source: '/token-budgets', destination: '/cost-and-usage/token-budgets', permanent: true },
{
source: '/token-budgets/:path*',
destination: '/cost-and-usage/token-budgets/:path*',
permanent: true,
},
]
},
}
module.exports = nextConfig