@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.
Files changed (48) hide show
  1. package/dist/app.js +1 -1
  2. package/dist/{chunk-YY6OAEL6.js → chunk-DO2G3JSB.js} +5333 -2205
  3. package/dist/chunk-DO2G3JSB.js.map +1 -0
  4. package/dist/index.d.ts +2 -1
  5. package/dist/index.js +297 -54
  6. package/dist/index.js.map +1 -1
  7. package/package.json +21 -21
  8. package/src/app.ts +415 -147
  9. package/src/auth/managed-auth.ts +32 -16
  10. package/src/http/auth.ts +8 -1
  11. package/src/http/common.ts +6 -2
  12. package/src/http/sse.ts +27 -6
  13. package/src/index.ts +196 -74
  14. package/src/integrations/oauth-client.ts +592 -131
  15. package/src/integrations/provider-domain.ts +4 -1
  16. package/src/mcp/documents.ts +173 -94
  17. package/src/mcp/server.ts +1517 -692
  18. package/src/mcp/session-view.ts +8 -2
  19. package/src/mcp/toolspace.ts +175 -84
  20. package/src/observability.ts +7 -1
  21. package/src/routes/api-keys.ts +39 -23
  22. package/src/routes/billing.ts +180 -65
  23. package/src/routes/capabilities.ts +17 -8
  24. package/src/routes/catalog-assets.ts +5 -2
  25. package/src/routes/codex.ts +244 -63
  26. package/src/routes/connections.ts +72 -34
  27. package/src/routes/documents.ts +242 -92
  28. package/src/routes/enrollments.ts +100 -70
  29. package/src/routes/environments.ts +205 -136
  30. package/src/routes/files.ts +164 -39
  31. package/src/routes/github.ts +123 -50
  32. package/src/routes/install.ts +9 -2
  33. package/src/routes/machines.ts +9 -8
  34. package/src/routes/packs.ts +141 -89
  35. package/src/routes/rigs.ts +189 -0
  36. package/src/routes/scheduled-tasks.ts +51 -9
  37. package/src/routes/sessions.ts +839 -329
  38. package/src/routes/social.ts +50 -38
  39. package/src/routes/workspace-capture.ts +238 -0
  40. package/src/routes/workspaces.ts +159 -13
  41. package/src/sandbox/access.ts +11 -3
  42. package/src/sandbox/auth-callout.ts +5 -1
  43. package/src/sandbox/channel-a.ts +104 -27
  44. package/src/sandbox/enrollment.ts +13 -3
  45. package/src/sandbox/machines.ts +68 -59
  46. package/src/sandbox/metrics-ingestion.ts +238 -17
  47. package/src/sandbox/viewer.ts +172 -46
  48. 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 { createDocumentServices, indexDocumentNow, type DocumentServices } from "@opengeni/documents";
8
- import { dbSql } from "@opengeni/db";
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, ObjectStorageDependency, SessionWorkflowClient } from "@opengeni/core";
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 = createObjectStorage(deps.settings);
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 ({ accountId, workspaceId, documentId }: { accountId: string; workspaceId: string; documentId: string }) => {
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(deps.db, objectStorage, workspaceId, documentId, getDocumentServices(), {
76
- beforeEmbed: async ({ chunkCount }) => {
77
- await requireLimit(routeDeps, { accountId, workspaceId, action: "document:index", quantity: chunkCount });
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: deps.githubStateSecret ?? deps.settings.githubAppManifestStateSecret ?? crypto.randomUUID(),
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 = deps.observability ?? createObservability(deps.settings, { component: "api" });
126
+ const observability =
127
+ deps.observability ?? createObservability(deps.settings, { component: "api" });
100
128
 
101
- app.use("*", cors({
102
- credentials: true,
103
- origin: (origin) => {
104
- if (!origin) {
105
- return null;
106
- }
107
- return allowedCorsOrigin(deps.settings.corsAllowOriginRegex, origin) ? origin : null;
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) => c.json({
170
- service: deps.settings.serviceName,
171
- environment: deps.settings.environment,
172
- deploymentRevision: deps.settings.deploymentRevision,
173
- ...(deps.settings.serverVersion ? { serverVersion: deps.settings.serverVersion } : {}),
174
- ok: true,
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) => c.text(await observability.prometheusMetrics(), 200, {
183
- "content-type": "text/plain; version=0.0.4; charset=utf-8",
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) => c.json(ClientConfig.parse({
187
- deploymentRevision: deps.settings.deploymentRevision,
188
- ...(deps.settings.serverVersion ? { serverVersion: deps.settings.serverVersion } : {}),
189
- defaultModel: deps.settings.openaiModel,
190
- allowedModels: configuredAllowedModels(deps.settings),
191
- // Provider-grouped model list for the picker. configuredModels() carries the
192
- // union of the built-in allow-list and every registry provider's models, in
193
- // selection order (default model first); project each to the client-safe
194
- // ClientModel shape (ConfiguredModel.providerId ClientModel.provider).
195
- models: configuredModels(deps.settings).map((model) => ({
196
- id: model.id,
197
- label: model.label,
198
- provider: model.providerId,
199
- providerLabel: model.providerLabel,
200
- api: model.api,
201
- ...(model.contextWindowTokens === undefined ? {} : { contextWindowTokens: model.contextWindowTokens }),
202
- })),
203
- defaultReasoningEffort: deps.settings.openaiReasoningEffort,
204
- allowedReasoningEfforts: configuredAllowedReasoningEfforts(deps.settings),
205
- mcpServers: deps.settings.mcpServers.map((server) => ({
206
- id: server.id,
207
- name: server.name ?? server.id,
208
- })),
209
- fileUploads: {
210
- enabled: objectStorage !== null,
211
- maxSizeBytes: objectStorage?.maxSinglePutSizeBytes ?? 5_000_000_000,
212
- },
213
- productAccessMode: deps.settings.productAccessMode,
214
- auth: clientAuthConfig(deps.settings),
215
- // Channel-A structured services (P4.4) ride exec/readFile/createEditor,
216
- // available on every real backend; `none` has no box so they are all off.
217
- // Per-session availability is still negotiated on /stream-capabilities.
218
- structuredServices: structuredServicesHint(deps.settings.sandboxBackend),
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(c: Parameters<typeof requireAccessGrant>[0], deps: ApiRouteDeps, workspaceId: string): Promise<AccessGrant> {
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 { mode: "configuredToken" as const, headerName: "authorization" as const, scheme: "bearer" as const };
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): { fileSystem: boolean; git: boolean; terminalEvents: boolean } {
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: deps.readinessChecks?.db ?? (async () => {
309
- await deps.db.execute(dbSql`select 1`);
310
- }),
311
- nats: deps.readinessChecks?.nats ?? (() => {
312
- if (deps.bus.isConnected && !deps.bus.isConnected()) {
313
- throw new Error("NATS is not connected");
314
- }
315
- }),
316
- temporal: deps.readinessChecks?.temporal ?? deps.workflowClient.check ?? (() => {
317
- throw new Error("Temporal readiness check unavailable");
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(checks: ReadinessChecks, timeoutMs: number): Promise<{
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
- .map(async ([name, check]) => {
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 [name, { ok: false, error: error instanceof Error ? error.message : String(error) }] as const;
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<ReadinessCheckName, { ok: boolean; error?: string }>;
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(() => reject(new Error(`readiness check timed out after ${timeoutMs}ms`)), timeoutMs);
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
- { pattern: /^\/v1\/workspaces\/[^/]+\/codex\/connect\/start$/, label: "/v1/workspaces/:workspaceId/codex/connect/start" },
364
- { pattern: /^\/v1\/workspaces\/[^/]+\/codex\/connect\/poll$/, label: "/v1/workspaces/:workspaceId/codex/connect/poll" },
365
- { pattern: /^\/v1\/workspaces\/[^/]+\/codex\/status$/, label: "/v1/workspaces/:workspaceId/codex/status" },
366
- { pattern: /^\/v1\/workspaces\/[^/]+\/codex\/usage$/, label: "/v1/workspaces/:workspaceId/codex/usage" },
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
- { pattern: /^\/v1\/workspaces\/[^/]+\/mcp\/docs$/, label: "/v1/workspaces/:workspaceId/mcp/docs" },
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
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/events\/stream$/, label: "/v1/workspaces/:workspaceId/sessions/:id/events/stream" },
379
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/events$/, label: "/v1/workspaces/:workspaceId/sessions/:id/events" },
380
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/turns\/reorder$/, label: "/v1/workspaces/:workspaceId/sessions/:id/turns/reorder" },
381
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/turns\/[^/]+$/, label: "/v1/workspaces/:workspaceId/sessions/:id/turns/:turnId" },
382
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/turns$/, label: "/v1/workspaces/:workspaceId/sessions/:id/turns" },
383
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/stream-capabilities$/, label: "/v1/workspaces/:workspaceId/sessions/:id/stream-capabilities" },
384
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/viewers\/[^/]+\/heartbeat$/, label: "/v1/workspaces/:workspaceId/sessions/:id/viewers/:viewerId/heartbeat" },
385
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/viewers\/[^/]+$/, label: "/v1/workspaces/:workspaceId/sessions/:id/viewers/:viewerId" },
386
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/viewers$/, label: "/v1/workspaces/:workspaceId/sessions/:id/viewers" },
387
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/goal$/, label: "/v1/workspaces/:workspaceId/sessions/:id/goal" },
388
- { pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+$/, label: "/v1/workspaces/:workspaceId/sessions/:id" },
389
- { pattern: /^\/v1\/workspaces\/[^/]+\/files\/uploads$/, label: "/v1/workspaces/:workspaceId/files/uploads" },
390
- { pattern: /^\/v1\/workspaces\/[^/]+\/files\/uploads\/[^/]+\/complete$/, label: "/v1/workspaces/:workspaceId/files/uploads/:id/complete" },
391
- { pattern: /^\/v1\/workspaces\/[^/]+\/files\/[^/]+\/download-url$/, label: "/v1/workspaces/:workspaceId/files/:id/download-url" },
392
- { pattern: /^\/v1\/workspaces\/[^/]+\/files\/[^/]+$/, label: "/v1/workspaces/:workspaceId/files/:id" },
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
- { pattern: /^\/v1\/workspaces\/[^/]+\/api-keys\/[^/]+$/, label: "/v1/workspaces/:workspaceId/api-keys/:id" },
395
- { pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks$/, label: "/v1/workspaces/:workspaceId/scheduled-tasks" },
396
- { pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/pause$/, label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/pause" },
397
- { pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/resume$/, label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/resume" },
398
- { pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/trigger$/, label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/trigger" },
399
- { pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+\/runs$/, label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id/runs" },
400
- { pattern: /^\/v1\/workspaces\/[^/]+\/scheduled-tasks\/[^/]+$/, label: "/v1/workspaces/:workspaceId/scheduled-tasks/:id" },
401
- { pattern: /^\/v1\/workspaces\/[^/]+\/document-bases$/, label: "/v1/workspaces/:workspaceId/document-bases" },
402
- { pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/documents\/[^/]+\/reindex$/, label: "/v1/workspaces/:workspaceId/document-bases/:id/documents/:documentId/reindex" },
403
- { pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/documents\/[^/]+$/, label: "/v1/workspaces/:workspaceId/document-bases/:id/documents/:documentId" },
404
- { pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/documents$/, label: "/v1/workspaces/:workspaceId/document-bases/:id/documents" },
405
- { pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+\/search$/, label: "/v1/workspaces/:workspaceId/document-bases/:id/search" },
406
- { pattern: /^\/v1\/workspaces\/[^/]+\/document-bases\/[^/]+$/, label: "/v1/workspaces/:workspaceId/document-bases/:id" },
407
- { pattern: /^\/v1\/workspaces\/[^/]+\/knowledge\/search$/, label: "/v1/workspaces/:workspaceId/knowledge/search" },
408
- { pattern: /^\/v1\/workspaces\/[^/]+\/knowledge\/memories\/[^/]+$/, label: "/v1/workspaces/:workspaceId/knowledge/memories/:id" },
409
- { pattern: /^\/v1\/workspaces\/[^/]+\/knowledge\/memories$/, label: "/v1/workspaces/:workspaceId/knowledge/memories" },
410
- { pattern: /^\/v1\/workspaces\/[^/]+\/github\/app$/, label: "/v1/workspaces/:workspaceId/github/app" },
411
- { pattern: /^\/v1\/workspaces\/[^/]+\/github\/repositories$/, label: "/v1/workspaces/:workspaceId/github/repositories" },
412
- { pattern: /^\/v1\/workspaces\/[^/]+\/github\/repositories\/sync$/, label: "/v1/workspaces/:workspaceId/github/repositories/sync" },
413
- { pattern: /^\/v1\/workspaces\/[^/]+\/github\/app-manifest$/, label: "/v1/workspaces/:workspaceId/github/app-manifest" },
414
- { pattern: /^\/v1\/workspaces\/[^/]+\/capabilities$/, label: "/v1/workspaces/:workspaceId/capabilities" },
415
- { pattern: /^\/v1\/workspaces\/[^/]+\/capabilities\/discovery\/mcp-registry$/, label: "/v1/workspaces/:workspaceId/capabilities/discovery/mcp-registry" },
416
- { pattern: /^\/v1\/workspaces\/[^/]+\/capabilities\/[^/]+\/enable$/, label: "/v1/workspaces/:workspaceId/capabilities/:id/enable" },
417
- { pattern: /^\/v1\/workspaces\/[^/]+\/capabilities\/[^/]+\/disable$/, label: "/v1/workspaces/:workspaceId/capabilities/:id/disable" },
418
- { pattern: /^\/v1\/workspaces\/[^/]+\/environments$/, label: "/v1/workspaces/:workspaceId/environments" },
419
- { pattern: /^\/v1\/workspaces\/[^/]+\/environments\/[^/]+\/variables\/[^/]+$/, label: "/v1/workspaces/:workspaceId/environments/:id/variables/:name" },
420
- { pattern: /^\/v1\/workspaces\/[^/]+\/environments\/[^/]+$/, label: "/v1/workspaces/:workspaceId/environments/:id" },
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
- { pattern: /^\/v1\/workspaces\/[^/]+\/packs\/installations$/, label: "/v1/workspaces/:workspaceId/packs/installations" },
423
- { pattern: /^\/v1\/workspaces\/[^/]+\/packs\/marketing-social-daily-analysis\/scheduled-tasks$/, label: "/v1/workspaces/:workspaceId/packs/marketing-social-daily-analysis/scheduled-tasks" },
424
- { pattern: /^\/v1\/workspaces\/[^/]+\/packs\/[^/]+\/enable$/, label: "/v1/workspaces/:workspaceId/packs/:id/enable" },
425
- { pattern: /^\/v1\/workspaces\/[^/]+\/packs\/[^/]+$/, label: "/v1/workspaces/:workspaceId/packs/:id" },
426
- { pattern: /^\/v1\/workspaces\/[^/]+\/social\/connections$/, label: "/v1/workspaces/:workspaceId/social/connections" },
427
- { pattern: /^\/v1\/workspaces\/[^/]+\/social\/posts$/, label: "/v1/workspaces/:workspaceId/social/posts" },
428
- { pattern: /^\/v1\/workspaces\/[^/]+\/connections$/, label: "/v1/workspaces/:workspaceId/connections" },
429
- { pattern: /^\/v1\/workspaces\/[^/]+\/connections\/oauth\/start$/, label: "/v1/workspaces/:workspaceId/connections/oauth/start" },
430
- { pattern: /^\/v1\/workspaces\/[^/]+\/connections\/[^/]+$/, label: "/v1/workspaces/:workspaceId/connections/:connectionId" },
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
- { pattern: /^\/v1\/integrations\/oauth\/client-metadata\.json$/, label: "/v1/integrations/oauth/client-metadata.json" },
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
- { pattern: /^\/v1\/workspaces\/[^/]+\/enrollments\/device\/approve$/, label: "/v1/workspaces/:workspaceId/enrollments/device/approve" },
437
- { pattern: /^\/v1\/workspaces\/[^/]+\/enrollments\/[^/]+\/revoke$/, label: "/v1/workspaces/:workspaceId/enrollments/:id/revoke" },
438
- { pattern: /^\/v1\/workspaces\/[^/]+\/enrollments$/, label: "/v1/workspaces/:workspaceId/enrollments" },
439
- { pattern: /^\/v1\/workspaces\/[^/]+\/machines\/[^/]+\/metrics\/series$/, label: "/v1/workspaces/:workspaceId/machines/:enrollmentId/metrics/series" },
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" },