@opengeni/api-router 0.2.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.
Files changed (41) hide show
  1. package/dist/app.d.ts +16 -0
  2. package/dist/app.js +35 -0
  3. package/dist/app.js.map +1 -0
  4. package/dist/chunk-XSYUDIX3.js +6331 -0
  5. package/dist/chunk-XSYUDIX3.js.map +1 -0
  6. package/dist/index.d.ts +19 -0
  7. package/dist/index.js +567 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +74 -0
  10. package/src/app.ts +351 -0
  11. package/src/auth/managed-auth.ts +237 -0
  12. package/src/http/auth.ts +92 -0
  13. package/src/http/common.ts +16 -0
  14. package/src/http/sse.ts +89 -0
  15. package/src/index.ts +362 -0
  16. package/src/mcp/documents.ts +57 -0
  17. package/src/mcp/server.ts +961 -0
  18. package/src/mcp/session-view.ts +281 -0
  19. package/src/routes/api-keys.ts +65 -0
  20. package/src/routes/billing.ts +495 -0
  21. package/src/routes/capabilities.ts +80 -0
  22. package/src/routes/codex.ts +393 -0
  23. package/src/routes/documents.ts +185 -0
  24. package/src/routes/enrollments.ts +357 -0
  25. package/src/routes/environments.ts +175 -0
  26. package/src/routes/files.ts +148 -0
  27. package/src/routes/github.ts +341 -0
  28. package/src/routes/install.ts +218 -0
  29. package/src/routes/machines.ts +107 -0
  30. package/src/routes/packs.ts +241 -0
  31. package/src/routes/scheduled-tasks.ts +126 -0
  32. package/src/routes/sessions.ts +1083 -0
  33. package/src/routes/social.ts +119 -0
  34. package/src/routes/workspaces.ts +206 -0
  35. package/src/sandbox/access.ts +89 -0
  36. package/src/sandbox/auth-callout.ts +178 -0
  37. package/src/sandbox/channel-a.ts +265 -0
  38. package/src/sandbox/enrollment.ts +498 -0
  39. package/src/sandbox/machines.ts +255 -0
  40. package/src/sandbox/metrics-ingestion.ts +289 -0
  41. package/src/sandbox/viewer.ts +993 -0
package/dist/app.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { Hono } from 'hono';
2
+ import { AppDependencies } from '@opengeni/core';
3
+ export { ApiRouteDeps, AppDependencies, DocumentIndexClient, ObjectStorageDependency, SessionWorkflowClient, mergeResourceRefs, mergeToolRefs, normalizeResources, validateFileResources, validateGitHubRepositorySelection, validateGitHubRepositorySelectionShape, validateToolRefs, withDefaultEnabledCapabilityMcpTools, workflowIdForSession } from '@opengeni/core';
4
+ import { SessionEvent } from '@opengeni/contracts';
5
+ import { Database } from '@opengeni/db';
6
+ import { EventBus } from '@opengeni/events';
7
+
8
+ declare function sseSessionStream(db: Database, bus: EventBus, workspaceId: string, sessionId: string, after: number, signal: AbortSignal): Promise<Response>;
9
+ declare function replaySessionEvents(loadPage: (after: number, limit: number) => Promise<SessionEvent[]>, send: (event: SessionEvent) => Promise<void>, after: number, pageSize?: number): Promise<void>;
10
+
11
+ declare function createApp(deps: AppDependencies): Hono;
12
+ declare function allowedCorsOrigin(pattern: string, origin: string): boolean;
13
+ declare function httpStatusForError(error: unknown): number;
14
+ declare function routeLabel(pathname: string): string;
15
+
16
+ export { allowedCorsOrigin, createApp, httpStatusForError, replaySessionEvents, routeLabel, sseSessionStream };
package/dist/app.js ADDED
@@ -0,0 +1,35 @@
1
+ import {
2
+ allowedCorsOrigin,
3
+ createApp,
4
+ httpStatusForError,
5
+ mergeResourceRefs,
6
+ mergeToolRefs,
7
+ normalizeResources,
8
+ replaySessionEvents,
9
+ routeLabel,
10
+ sseSessionStream,
11
+ validateFileResources,
12
+ validateGitHubRepositorySelection,
13
+ validateGitHubRepositorySelectionShape,
14
+ validateToolRefs,
15
+ withDefaultEnabledCapabilityMcpTools,
16
+ workflowIdForSession
17
+ } from "./chunk-XSYUDIX3.js";
18
+ export {
19
+ allowedCorsOrigin,
20
+ createApp,
21
+ httpStatusForError,
22
+ mergeResourceRefs,
23
+ mergeToolRefs,
24
+ normalizeResources,
25
+ replaySessionEvents,
26
+ routeLabel,
27
+ sseSessionStream,
28
+ validateFileResources,
29
+ validateGitHubRepositorySelection,
30
+ validateGitHubRepositorySelectionShape,
31
+ validateToolRefs,
32
+ withDefaultEnabledCapabilityMcpTools,
33
+ workflowIdForSession
34
+ };
35
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}