@opengeni/api-router 0.5.2 → 0.5.4
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/app.js +1 -1
- package/dist/{chunk-YY6OAEL6.js → chunk-DO2G3JSB.js} +5333 -2205
- package/dist/chunk-DO2G3JSB.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +297 -54
- package/dist/index.js.map +1 -1
- package/package.json +21 -21
- package/src/app.ts +415 -147
- package/src/auth/managed-auth.ts +32 -16
- package/src/http/auth.ts +8 -1
- package/src/http/common.ts +6 -2
- package/src/http/sse.ts +27 -6
- package/src/index.ts +196 -74
- package/src/integrations/oauth-client.ts +592 -131
- package/src/integrations/provider-domain.ts +4 -1
- package/src/mcp/documents.ts +173 -94
- package/src/mcp/server.ts +1517 -692
- package/src/mcp/session-view.ts +8 -2
- package/src/mcp/toolspace.ts +175 -84
- package/src/observability.ts +7 -1
- package/src/routes/api-keys.ts +39 -23
- package/src/routes/billing.ts +180 -65
- package/src/routes/capabilities.ts +17 -8
- package/src/routes/catalog-assets.ts +5 -2
- package/src/routes/codex.ts +244 -63
- package/src/routes/connections.ts +72 -34
- package/src/routes/documents.ts +242 -92
- package/src/routes/enrollments.ts +100 -70
- package/src/routes/environments.ts +205 -136
- package/src/routes/files.ts +164 -39
- package/src/routes/github.ts +123 -50
- package/src/routes/install.ts +9 -2
- package/src/routes/machines.ts +9 -8
- package/src/routes/packs.ts +141 -89
- package/src/routes/rigs.ts +189 -0
- package/src/routes/scheduled-tasks.ts +51 -9
- package/src/routes/sessions.ts +839 -329
- package/src/routes/social.ts +50 -38
- package/src/routes/workspace-capture.ts +238 -0
- package/src/routes/workspaces.ts +159 -13
- package/src/sandbox/access.ts +11 -3
- package/src/sandbox/auth-callout.ts +5 -1
- package/src/sandbox/channel-a.ts +104 -27
- package/src/sandbox/enrollment.ts +13 -3
- package/src/sandbox/machines.ts +68 -59
- package/src/sandbox/metrics-ingestion.ts +238 -17
- package/src/sandbox/viewer.ts +172 -46
- package/dist/chunk-YY6OAEL6.js.map +0 -1
package/src/app.ts
CHANGED
|
@@ -3,16 +3,20 @@ import {
|
|
|
3
3
|
configuredAllowedReasoningEfforts,
|
|
4
4
|
configuredModels,
|
|
5
5
|
} from "@opengeni/config";
|
|
6
|
-
import { ClientConfig, type AccessGrant } from "@opengeni/contracts";
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { ClientConfig, resolveWorkspaceMemoryEnabled, type AccessGrant } from "@opengeni/contracts";
|
|
7
|
+
import {
|
|
8
|
+
createDocumentServices,
|
|
9
|
+
indexDocumentNow,
|
|
10
|
+
type DocumentServices,
|
|
11
|
+
} from "@opengeni/documents";
|
|
12
|
+
import { dbSql, getWorkspace } from "@opengeni/db";
|
|
9
13
|
import { createObservability } from "@opengeni/observability";
|
|
10
14
|
import { createObjectStorage } from "@opengeni/storage";
|
|
11
15
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
12
16
|
import { Hono } from "hono";
|
|
13
17
|
import { cors } from "hono/cors";
|
|
14
18
|
import { HTTPException } from "hono/http-exception";
|
|
15
|
-
import type { ApiRouteDeps, AppDependencies
|
|
19
|
+
import type { ApiRouteDeps, AppDependencies } from "@opengeni/core";
|
|
16
20
|
import { hasPermission, requireAccessGrant, requirePermission } from "@opengeni/core";
|
|
17
21
|
import { createManagedAuth } from "./auth/managed-auth";
|
|
18
22
|
import { createApiSandboxClient, makeResumeBoxById } from "./sandbox/access";
|
|
@@ -34,6 +38,7 @@ import { registerBillingRoutes } from "./routes/billing";
|
|
|
34
38
|
import { registerGitHubRoutes } from "./routes/github";
|
|
35
39
|
import { registerInstallRoutes } from "./routes/install";
|
|
36
40
|
import { registerPackRoutes } from "./routes/packs";
|
|
41
|
+
import { registerRigRoutes } from "./routes/rigs";
|
|
37
42
|
import { registerScheduledTaskRoutes } from "./routes/scheduled-tasks";
|
|
38
43
|
import { registerSessionRoutes } from "./routes/sessions";
|
|
39
44
|
import { registerSocialRoutes } from "./routes/social";
|
|
@@ -61,22 +66,43 @@ export { replaySessionEvents, sseSessionStream } from "./http/sse";
|
|
|
61
66
|
|
|
62
67
|
export function createApp(deps: AppDependencies): Hono {
|
|
63
68
|
const managedAuth = deps.managedAuth ?? createManagedAuth(deps.settings, deps.db);
|
|
64
|
-
const objectStorage =
|
|
69
|
+
const objectStorage =
|
|
70
|
+
deps.objectStorage === undefined ? createObjectStorage(deps.settings) : deps.objectStorage;
|
|
65
71
|
let documentServices: DocumentServices | null = deps.documentServices ?? null;
|
|
66
72
|
const getDocumentServices = () => {
|
|
67
73
|
documentServices ??= createDocumentServices(deps.settings);
|
|
68
74
|
return documentServices;
|
|
69
75
|
};
|
|
70
76
|
const documentIndexer = deps.documentIndexer ?? {
|
|
71
|
-
indexDocument: async ({
|
|
77
|
+
indexDocument: async ({
|
|
78
|
+
accountId,
|
|
79
|
+
workspaceId,
|
|
80
|
+
documentId,
|
|
81
|
+
}: {
|
|
82
|
+
accountId: string;
|
|
83
|
+
workspaceId: string;
|
|
84
|
+
documentId: string;
|
|
85
|
+
}) => {
|
|
72
86
|
if (!objectStorage) {
|
|
73
87
|
throw new HTTPException(503, { message: "object storage is not configured" });
|
|
74
88
|
}
|
|
75
|
-
return await indexDocumentNow(
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
return await indexDocumentNow(
|
|
90
|
+
deps.db,
|
|
91
|
+
objectStorage,
|
|
92
|
+
workspaceId,
|
|
93
|
+
documentId,
|
|
94
|
+
getDocumentServices(),
|
|
95
|
+
{
|
|
96
|
+
beforeEmbed: async ({ chunkCount }) => {
|
|
97
|
+
await requireLimit(routeDeps, {
|
|
98
|
+
accountId,
|
|
99
|
+
workspaceId,
|
|
100
|
+
action: "document:index",
|
|
101
|
+
quantity: chunkCount,
|
|
102
|
+
});
|
|
103
|
+
},
|
|
78
104
|
},
|
|
79
|
-
|
|
105
|
+
);
|
|
80
106
|
},
|
|
81
107
|
};
|
|
82
108
|
// The API process's own agent-loop-free sandbox client — the API-direct
|
|
@@ -87,7 +113,8 @@ export function createApp(deps: AppDependencies): Hono {
|
|
|
87
113
|
const resumeBoxById = deps.resumeBoxById ?? makeResumeBoxById(sandboxClient);
|
|
88
114
|
const routeDeps: ApiRouteDeps = {
|
|
89
115
|
...deps,
|
|
90
|
-
githubStateSecret:
|
|
116
|
+
githubStateSecret:
|
|
117
|
+
deps.githubStateSecret ?? deps.settings.githubAppManifestStateSecret ?? crypto.randomUUID(),
|
|
91
118
|
managedAuth,
|
|
92
119
|
objectStorage,
|
|
93
120
|
documentIndexer,
|
|
@@ -96,17 +123,21 @@ export function createApp(deps: AppDependencies): Hono {
|
|
|
96
123
|
resumeBoxById,
|
|
97
124
|
};
|
|
98
125
|
const app = new Hono();
|
|
99
|
-
const observability =
|
|
126
|
+
const observability =
|
|
127
|
+
deps.observability ?? createObservability(deps.settings, { component: "api" });
|
|
100
128
|
|
|
101
|
-
app.use(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
129
|
+
app.use(
|
|
130
|
+
"*",
|
|
131
|
+
cors({
|
|
132
|
+
credentials: true,
|
|
133
|
+
origin: (origin) => {
|
|
134
|
+
if (!origin) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
return allowedCorsOrigin(deps.settings.corsAllowOriginRegex, origin) ? origin : null;
|
|
138
|
+
},
|
|
139
|
+
}),
|
|
140
|
+
);
|
|
110
141
|
|
|
111
142
|
app.use("*", async (c, next) => {
|
|
112
143
|
const url = new URL(c.req.url);
|
|
@@ -166,57 +197,67 @@ export function createApp(deps: AppDependencies): Hono {
|
|
|
166
197
|
app.on(["GET", "POST"], "/v1/auth/*", (c) => managedAuth.handler(c.req.raw));
|
|
167
198
|
}
|
|
168
199
|
|
|
169
|
-
app.get("/healthz", (c) =>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
200
|
+
app.get("/healthz", (c) =>
|
|
201
|
+
c.json({
|
|
202
|
+
service: deps.settings.serviceName,
|
|
203
|
+
environment: deps.settings.environment,
|
|
204
|
+
deploymentRevision: deps.settings.deploymentRevision,
|
|
205
|
+
...(deps.settings.serverVersion ? { serverVersion: deps.settings.serverVersion } : {}),
|
|
206
|
+
ok: true,
|
|
207
|
+
}),
|
|
208
|
+
);
|
|
176
209
|
|
|
177
210
|
app.get("/readyz", async (c) => {
|
|
178
211
|
const result = await runReadinessChecks(readinessChecks(deps), 2_000);
|
|
179
212
|
return c.json(result, result.ok ? 200 : 503);
|
|
180
213
|
});
|
|
181
214
|
|
|
182
|
-
app.get("/metrics", async (c) =>
|
|
183
|
-
|
|
184
|
-
|
|
215
|
+
app.get("/metrics", async (c) =>
|
|
216
|
+
c.text(await observability.prometheusMetrics(), 200, {
|
|
217
|
+
"content-type": "text/plain; version=0.0.4; charset=utf-8",
|
|
218
|
+
}),
|
|
219
|
+
);
|
|
185
220
|
|
|
186
|
-
app.get("/v1/config/client", (c) =>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
app.get("/v1/config/client", (c) =>
|
|
222
|
+
c.json(
|
|
223
|
+
ClientConfig.parse({
|
|
224
|
+
deploymentRevision: deps.settings.deploymentRevision,
|
|
225
|
+
...(deps.settings.serverVersion ? { serverVersion: deps.settings.serverVersion } : {}),
|
|
226
|
+
defaultModel: deps.settings.openaiModel,
|
|
227
|
+
allowedModels: configuredAllowedModels(deps.settings),
|
|
228
|
+
// Provider-grouped model list for the picker. configuredModels() carries the
|
|
229
|
+
// union of the built-in allow-list and every registry provider's models, in
|
|
230
|
+
// selection order (default model first); project each to the client-safe
|
|
231
|
+
// ClientModel shape (ConfiguredModel.providerId → ClientModel.provider).
|
|
232
|
+
models: configuredModels(deps.settings).map((model) => ({
|
|
233
|
+
id: model.id,
|
|
234
|
+
label: model.label,
|
|
235
|
+
provider: model.providerId,
|
|
236
|
+
providerLabel: model.providerLabel,
|
|
237
|
+
api: model.api,
|
|
238
|
+
...(model.contextWindowTokens === undefined
|
|
239
|
+
? {}
|
|
240
|
+
: { contextWindowTokens: model.contextWindowTokens }),
|
|
241
|
+
})),
|
|
242
|
+
defaultReasoningEffort: deps.settings.openaiReasoningEffort,
|
|
243
|
+
allowedReasoningEfforts: configuredAllowedReasoningEfforts(deps.settings),
|
|
244
|
+
mcpServers: deps.settings.mcpServers.map((server) => ({
|
|
245
|
+
id: server.id,
|
|
246
|
+
name: server.name ?? server.id,
|
|
247
|
+
})),
|
|
248
|
+
fileUploads: {
|
|
249
|
+
enabled: objectStorage !== null,
|
|
250
|
+
maxSizeBytes: objectStorage?.maxSinglePutSizeBytes ?? 5_000_000_000,
|
|
251
|
+
},
|
|
252
|
+
productAccessMode: deps.settings.productAccessMode,
|
|
253
|
+
auth: clientAuthConfig(deps.settings),
|
|
254
|
+
// Channel-A structured services (P4.4) ride exec/readFile/createEditor,
|
|
255
|
+
// available on every real backend; `none` has no box so they are all off.
|
|
256
|
+
// Per-session availability is still negotiated on /stream-capabilities.
|
|
257
|
+
structuredServices: structuredServicesHint(deps.settings.sandboxBackend),
|
|
258
|
+
}),
|
|
259
|
+
),
|
|
260
|
+
);
|
|
220
261
|
|
|
221
262
|
app.all("/v1/workspaces/:workspaceId/mcp", async (c) => {
|
|
222
263
|
const workspaceId = c.req.param("workspaceId");
|
|
@@ -224,10 +265,13 @@ export function createApp(deps: AppDependencies): Hono {
|
|
|
224
265
|
const toolspace = isToolspaceGrant(routeDeps.settings, grant)
|
|
225
266
|
? await prepareToolspaceMcpSurface({ deps: routeDeps, grant })
|
|
226
267
|
: null;
|
|
268
|
+
const workspace = await getWorkspace(routeDeps.db, workspaceId);
|
|
269
|
+
const workspaceMemoryEnabled = resolveWorkspaceMemoryEnabled(workspace?.settings);
|
|
227
270
|
const transport = new WebStandardStreamableHTTPServerTransport({ enableJsonResponse: true });
|
|
228
271
|
const mcp = buildOpenGeniMcpServer(routeDeps, grant, {
|
|
229
272
|
requestOrigin: new URL(c.req.url).origin,
|
|
230
273
|
toolspace,
|
|
274
|
+
workspaceMemoryEnabled,
|
|
231
275
|
});
|
|
232
276
|
try {
|
|
233
277
|
await mcp.connect(transport);
|
|
@@ -251,6 +295,7 @@ export function createApp(deps: AppDependencies): Hono {
|
|
|
251
295
|
registerEnrollmentRoutes(app, routeDeps);
|
|
252
296
|
registerMachineRoutes(app, routeDeps);
|
|
253
297
|
registerEnvironmentRoutes(app, routeDeps);
|
|
298
|
+
registerRigRoutes(app, routeDeps);
|
|
254
299
|
registerPackRoutes(app, routeDeps);
|
|
255
300
|
registerSessionRoutes(app, routeDeps);
|
|
256
301
|
registerScheduledTaskRoutes(app, routeDeps);
|
|
@@ -259,7 +304,11 @@ export function createApp(deps: AppDependencies): Hono {
|
|
|
259
304
|
return app;
|
|
260
305
|
}
|
|
261
306
|
|
|
262
|
-
async function requireMcpAccessGrant(
|
|
307
|
+
async function requireMcpAccessGrant(
|
|
308
|
+
c: Parameters<typeof requireAccessGrant>[0],
|
|
309
|
+
deps: ApiRouteDeps,
|
|
310
|
+
workspaceId: string,
|
|
311
|
+
): Promise<AccessGrant> {
|
|
263
312
|
const grant = await requireAccessGrant(c, deps, workspaceId);
|
|
264
313
|
if (hasPermission(grant.permissions, "workspace:read")) {
|
|
265
314
|
return grant;
|
|
@@ -276,7 +325,11 @@ function clientAuthConfig(settings: AppDependencies["settings"]) {
|
|
|
276
325
|
return { mode: "managedSession" as const, session: "cookie" as const };
|
|
277
326
|
}
|
|
278
327
|
if (settings.productAccessMode === "configured") {
|
|
279
|
-
return {
|
|
328
|
+
return {
|
|
329
|
+
mode: "configuredToken" as const,
|
|
330
|
+
headerName: "authorization" as const,
|
|
331
|
+
scheme: "bearer" as const,
|
|
332
|
+
};
|
|
280
333
|
}
|
|
281
334
|
if (settings.authRequired) {
|
|
282
335
|
return { mode: "deploymentKey" as const, headerName: "x-opengeni-access-key" as const };
|
|
@@ -284,7 +337,11 @@ function clientAuthConfig(settings: AppDependencies["settings"]) {
|
|
|
284
337
|
return { mode: "none" as const };
|
|
285
338
|
}
|
|
286
339
|
|
|
287
|
-
function structuredServicesHint(backend: string): {
|
|
340
|
+
function structuredServicesHint(backend: string): {
|
|
341
|
+
fileSystem: boolean;
|
|
342
|
+
git: boolean;
|
|
343
|
+
terminalEvents: boolean;
|
|
344
|
+
} {
|
|
288
345
|
const hasBox = backend !== "none";
|
|
289
346
|
return { fileSystem: hasBox, git: hasBox, terminalEvents: hasBox };
|
|
290
347
|
}
|
|
@@ -305,36 +362,53 @@ type ReadinessChecks = Record<ReadinessCheckName, () => Promise<void> | void>;
|
|
|
305
362
|
|
|
306
363
|
function readinessChecks(deps: AppDependencies): ReadinessChecks {
|
|
307
364
|
return {
|
|
308
|
-
db:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
365
|
+
db:
|
|
366
|
+
deps.readinessChecks?.db ??
|
|
367
|
+
(async () => {
|
|
368
|
+
await deps.db.execute(dbSql`select 1`);
|
|
369
|
+
}),
|
|
370
|
+
nats:
|
|
371
|
+
deps.readinessChecks?.nats ??
|
|
372
|
+
(() => {
|
|
373
|
+
if (deps.bus.isConnected && !deps.bus.isConnected()) {
|
|
374
|
+
throw new Error("NATS is not connected");
|
|
375
|
+
}
|
|
376
|
+
}),
|
|
377
|
+
temporal:
|
|
378
|
+
deps.readinessChecks?.temporal ??
|
|
379
|
+
deps.workflowClient.check ??
|
|
380
|
+
(() => {
|
|
381
|
+
throw new Error("Temporal readiness check unavailable");
|
|
382
|
+
}),
|
|
319
383
|
};
|
|
320
384
|
}
|
|
321
385
|
|
|
322
|
-
async function runReadinessChecks(
|
|
386
|
+
async function runReadinessChecks(
|
|
387
|
+
checks: ReadinessChecks,
|
|
388
|
+
timeoutMs: number,
|
|
389
|
+
): Promise<{
|
|
323
390
|
ok: boolean;
|
|
324
391
|
checks: Record<ReadinessCheckName, { ok: boolean; error?: string }>;
|
|
325
392
|
}> {
|
|
326
393
|
const entries = await Promise.all(
|
|
327
|
-
(Object.entries(checks) as Array<[ReadinessCheckName, () => Promise<void> | void]>)
|
|
328
|
-
|
|
394
|
+
(Object.entries(checks) as Array<[ReadinessCheckName, () => Promise<void> | void]>).map(
|
|
395
|
+
async ([name, check]) => {
|
|
329
396
|
try {
|
|
330
397
|
await withTimeout(Promise.resolve().then(check), timeoutMs);
|
|
331
398
|
return [name, { ok: true }] as const;
|
|
332
399
|
} catch (error) {
|
|
333
|
-
return [
|
|
400
|
+
return [
|
|
401
|
+
name,
|
|
402
|
+
{ ok: false, error: error instanceof Error ? error.message : String(error) },
|
|
403
|
+
] as const;
|
|
334
404
|
}
|
|
335
|
-
}
|
|
405
|
+
},
|
|
406
|
+
),
|
|
336
407
|
);
|
|
337
|
-
const result = Object.fromEntries(entries) as Record<
|
|
408
|
+
const result = Object.fromEntries(entries) as Record<
|
|
409
|
+
ReadinessCheckName,
|
|
410
|
+
{ ok: boolean; error?: string }
|
|
411
|
+
>;
|
|
338
412
|
return {
|
|
339
413
|
ok: Object.values(result).every((check) => check.ok),
|
|
340
414
|
checks: result,
|
|
@@ -347,7 +421,10 @@ async function withTimeout<T>(promise: Promise<T>, timeoutMs: number): Promise<T
|
|
|
347
421
|
return await Promise.race([
|
|
348
422
|
promise,
|
|
349
423
|
new Promise<never>((_, reject) => {
|
|
350
|
-
timer = setTimeout(
|
|
424
|
+
timer = setTimeout(
|
|
425
|
+
() => reject(new Error(`readiness check timed out after ${timeoutMs}ms`)),
|
|
426
|
+
timeoutMs,
|
|
427
|
+
);
|
|
351
428
|
}),
|
|
352
429
|
]);
|
|
353
430
|
} finally {
|
|
@@ -360,10 +437,22 @@ async function withTimeout<T>(promise: Promise<T>, timeoutMs: number): Promise<T
|
|
|
360
437
|
const routeLabelPatterns: Array<{ pattern: RegExp; label: string }> = [
|
|
361
438
|
{ pattern: /^\/healthz$/, label: "/healthz" },
|
|
362
439
|
{ pattern: /^\/readyz$/, label: "/readyz" },
|
|
363
|
-
{
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
440
|
+
{
|
|
441
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/codex\/connect\/start$/,
|
|
442
|
+
label: "/v1/workspaces/:workspaceId/codex/connect/start",
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/codex\/connect\/poll$/,
|
|
446
|
+
label: "/v1/workspaces/:workspaceId/codex/connect/poll",
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/codex\/status$/,
|
|
450
|
+
label: "/v1/workspaces/:workspaceId/codex/status",
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/codex\/usage$/,
|
|
454
|
+
label: "/v1/workspaces/:workspaceId/codex/usage",
|
|
455
|
+
},
|
|
367
456
|
{ pattern: /^\/v1\/workspaces\/[^/]+\/codex$/, label: "/v1/workspaces/:workspaceId/codex" },
|
|
368
457
|
{ pattern: /^\/metrics$/, label: "/metrics" },
|
|
369
458
|
{ pattern: /^\/v1\/config\/client$/, label: "/v1/config/client" },
|
|
@@ -373,70 +462,249 @@ const routeLabelPatterns: Array<{ pattern: RegExp; label: string }> = [
|
|
|
373
462
|
{ pattern: /^\/v1\/billing\/entitlements$/, label: "/v1/billing/entitlements" },
|
|
374
463
|
{ pattern: /^\/v1\/webhooks\/stripe$/, label: "/v1/webhooks/stripe" },
|
|
375
464
|
{ pattern: /^\/v1\/workspaces\/[^/]+\/mcp$/, label: "/v1/workspaces/:workspaceId/mcp" },
|
|
376
|
-
{
|
|
465
|
+
{
|
|
466
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/mcp\/docs$/,
|
|
467
|
+
label: "/v1/workspaces/:workspaceId/mcp/docs",
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/default-rig$/,
|
|
471
|
+
label: "/v1/workspaces/:workspaceId/default-rig",
|
|
472
|
+
},
|
|
377
473
|
{ pattern: /^\/v1\/workspaces\/[^/]+\/sessions$/, label: "/v1/workspaces/:workspaceId/sessions" },
|
|
378
|
-
{
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
{
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
{
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
{
|
|
391
|
-
|
|
392
|
-
|
|
474
|
+
{
|
|
475
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/events\/stream$/,
|
|
476
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/events/stream",
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/lineage$/,
|
|
480
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/lineage",
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/events$/,
|
|
484
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/events",
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/turns\/reorder$/,
|
|
488
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/turns/reorder",
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/turns\/[^/]+$/,
|
|
492
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/turns/:turnId",
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/turns$/,
|
|
496
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/turns",
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/stream-capabilities$/,
|
|
500
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/stream-capabilities",
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/viewers\/[^/]+\/heartbeat$/,
|
|
504
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/viewers/:viewerId/heartbeat",
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/viewers\/[^/]+$/,
|
|
508
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/viewers/:viewerId",
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/viewers$/,
|
|
512
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/viewers",
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/goal$/,
|
|
516
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id/goal",
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+$/,
|
|
520
|
+
label: "/v1/workspaces/:workspaceId/sessions/:id",
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/files\/uploads$/,
|
|
524
|
+
label: "/v1/workspaces/:workspaceId/files/uploads",
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/files\/uploads\/[^/]+\/complete$/,
|
|
528
|
+
label: "/v1/workspaces/:workspaceId/files/uploads/:id/complete",
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/files\/[^/]+\/download-url$/,
|
|
532
|
+
label: "/v1/workspaces/:workspaceId/files/:id/download-url",
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/files\/[^/]+$/,
|
|
536
|
+
label: "/v1/workspaces/:workspaceId/files/:id",
|
|
537
|
+
},
|
|
393
538
|
{ pattern: /^\/v1\/workspaces\/[^/]+\/api-keys$/, label: "/v1/workspaces/:workspaceId/api-keys" },
|
|
394
|
-
{
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
{
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
{
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
{
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
{
|
|
419
|
-
|
|
420
|
-
|
|
539
|
+
{
|
|
540
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/api-keys\/[^/]+$/,
|
|
541
|
+
label: "/v1/workspaces/:workspaceId/api-keys/:id",
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks$/,
|
|
545
|
+
label: "/v1/workspaces/:workspaceId/scheduled-tasks",
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/pause$/,
|
|
549
|
+
label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/pause",
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/resume$/,
|
|
553
|
+
label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/resume",
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/trigger$/,
|
|
557
|
+
label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/trigger",
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/runs$/,
|
|
561
|
+
label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/runs",
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+$/,
|
|
565
|
+
label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id",
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/document-bases$/,
|
|
569
|
+
label: "/v1/workspaces/:workspaceId/document-bases",
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/documents\/[^/]+\/reindex$/,
|
|
573
|
+
label: "/v1/workspaces/:workspaceId/document-bases/:id/documents/:documentId/reindex",
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/documents\/[^/]+$/,
|
|
577
|
+
label: "/v1/workspaces/:workspaceId/document-bases/:id/documents/:documentId",
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/documents$/,
|
|
581
|
+
label: "/v1/workspaces/:workspaceId/document-bases/:id/documents",
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/search$/,
|
|
585
|
+
label: "/v1/workspaces/:workspaceId/document-bases/:id/search",
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+$/,
|
|
589
|
+
label: "/v1/workspaces/:workspaceId/document-bases/:id",
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/knowledge\/search$/,
|
|
593
|
+
label: "/v1/workspaces/:workspaceId/knowledge/search",
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/knowledge\/memories\/[^/]+$/,
|
|
597
|
+
label: "/v1/workspaces/:workspaceId/knowledge/memories/:id",
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/knowledge\/memories$/,
|
|
601
|
+
label: "/v1/workspaces/:workspaceId/knowledge/memories",
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/github\/app$/,
|
|
605
|
+
label: "/v1/workspaces/:workspaceId/github/app",
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/github\/repositories$/,
|
|
609
|
+
label: "/v1/workspaces/:workspaceId/github/repositories",
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/github\/repositories\/sync$/,
|
|
613
|
+
label: "/v1/workspaces/:workspaceId/github/repositories/sync",
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/github\/app-manifest$/,
|
|
617
|
+
label: "/v1/workspaces/:workspaceId/github/app-manifest",
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/capabilities$/,
|
|
621
|
+
label: "/v1/workspaces/:workspaceId/capabilities",
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/capabilities\/discovery\/mcp-registry$/,
|
|
625
|
+
label: "/v1/workspaces/:workspaceId/capabilities/discovery/mcp-registry",
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/capabilities\/[^/]+\/enable$/,
|
|
629
|
+
label: "/v1/workspaces/:workspaceId/capabilities/:id/enable",
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/capabilities\/[^/]+\/disable$/,
|
|
633
|
+
label: "/v1/workspaces/:workspaceId/capabilities/:id/disable",
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/environments$/,
|
|
637
|
+
label: "/v1/workspaces/:workspaceId/environments",
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/environments\/[^/]+\/variables\/[^/]+$/,
|
|
641
|
+
label: "/v1/workspaces/:workspaceId/environments/:id/variables/:name",
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/environments\/[^/]+$/,
|
|
645
|
+
label: "/v1/workspaces/:workspaceId/environments/:id",
|
|
646
|
+
},
|
|
421
647
|
{ pattern: /^\/v1\/workspaces\/[^/]+\/packs$/, label: "/v1/workspaces/:workspaceId/packs" },
|
|
422
|
-
{
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
{
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
{
|
|
648
|
+
{
|
|
649
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/packs\/installations$/,
|
|
650
|
+
label: "/v1/workspaces/:workspaceId/packs/installations",
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/packs\/marketing-social-daily-analysis\/scheduled-tasks$/,
|
|
654
|
+
label: "/v1/workspaces/:workspaceId/packs/marketing-social-daily-analysis/scheduled-tasks",
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/packs\/[^/]+\/enable$/,
|
|
658
|
+
label: "/v1/workspaces/:workspaceId/packs/:id/enable",
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/packs\/[^/]+$/,
|
|
662
|
+
label: "/v1/workspaces/:workspaceId/packs/:id",
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/social\/connections$/,
|
|
666
|
+
label: "/v1/workspaces/:workspaceId/social/connections",
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/social\/posts$/,
|
|
670
|
+
label: "/v1/workspaces/:workspaceId/social/posts",
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/connections$/,
|
|
674
|
+
label: "/v1/workspaces/:workspaceId/connections",
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/connections\/oauth\/start$/,
|
|
678
|
+
label: "/v1/workspaces/:workspaceId/connections/oauth/start",
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/connections\/[^/]+$/,
|
|
682
|
+
label: "/v1/workspaces/:workspaceId/connections/:connectionId",
|
|
683
|
+
},
|
|
431
684
|
{ pattern: /^\/v1\/catalog-assets\/.+$/, label: "/v1/catalog-assets/*" },
|
|
432
685
|
{ pattern: /^\/v1\/integrations\/oauth\/callback$/, label: "/v1/integrations/oauth/callback" },
|
|
433
|
-
{
|
|
686
|
+
{
|
|
687
|
+
pattern: /^\/v1\/integrations\/oauth\/client-metadata\.json$/,
|
|
688
|
+
label: "/v1/integrations/oauth/client-metadata.json",
|
|
689
|
+
},
|
|
434
690
|
{ pattern: /^\/v1\/enrollments\/device\/start$/, label: "/v1/enrollments/device/start" },
|
|
435
691
|
{ pattern: /^\/v1\/enrollments\/device\/poll$/, label: "/v1/enrollments/device/poll" },
|
|
436
|
-
{
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
692
|
+
{
|
|
693
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/enrollments\/device\/approve$/,
|
|
694
|
+
label: "/v1/workspaces/:workspaceId/enrollments/device/approve",
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/enrollments\/[^/]+\/revoke$/,
|
|
698
|
+
label: "/v1/workspaces/:workspaceId/enrollments/:id/revoke",
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/enrollments$/,
|
|
702
|
+
label: "/v1/workspaces/:workspaceId/enrollments",
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
pattern: /^\/v1\/workspaces\/[^/]+\/machines\/[^/]+\/metrics\/series$/,
|
|
706
|
+
label: "/v1/workspaces/:workspaceId/machines/:enrollmentId/metrics/series",
|
|
707
|
+
},
|
|
440
708
|
{ pattern: /^\/v1\/workspaces\/[^/]+\/machines$/, label: "/v1/workspaces/:workspaceId/machines" },
|
|
441
709
|
{ pattern: /^\/v1\/github\/app-manifest\/callback$/, label: "/v1/github/app-manifest/callback" },
|
|
442
710
|
{ pattern: /^\/v1\/github\/setup$/, label: "/v1/github/setup" },
|