@opengeni/api-router 0.12.7 → 0.14.3
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.d.ts +18 -38
- package/dist/app.js +3 -1
- package/dist/auth/managed-auth.d.ts +35 -0
- package/dist/{chunk-SD5GJTZ4.js → chunk-36PW33ND.js} +3744 -638
- package/dist/chunk-36PW33ND.js.map +1 -0
- package/dist/codex-redemption-security.d.ts +15 -0
- package/dist/github-access.d.ts +12 -0
- package/dist/github-browser-flow.d.ts +14 -0
- package/dist/http/auth.d.ts +3 -0
- package/dist/http/common.d.ts +3 -0
- package/dist/http/sse.d.ts +70 -0
- package/dist/index.d.ts +11 -13
- package/dist/index.js +1 -1
- package/dist/integrations/google-drive.d.ts +76 -0
- package/dist/integrations/oauth-client.d.ts +42 -0
- package/dist/integrations/provider-domain.d.ts +7 -0
- package/dist/integrations/slack-bot.d.ts +343 -0
- package/dist/mcp/documents.d.ts +8 -0
- package/dist/mcp/files.d.ts +5 -0
- package/dist/mcp/server.d.ts +107 -0
- package/dist/mcp/session-view.d.ts +191 -0
- package/dist/mcp/toolspace.d.ts +61 -0
- package/dist/model-catalog.d.ts +39 -0
- package/dist/observability.d.ts +3 -0
- package/dist/routes/api-keys.d.ts +3 -0
- package/dist/routes/billing.d.ts +16 -0
- package/dist/routes/capabilities.d.ts +3 -0
- package/dist/routes/catalog-assets.d.ts +5 -0
- package/dist/routes/codex.d.ts +10 -0
- package/dist/routes/connections.d.ts +3 -0
- package/dist/routes/documents.d.ts +3 -0
- package/dist/routes/enrollments.d.ts +3 -0
- package/dist/routes/environments.d.ts +5 -0
- package/dist/routes/files.d.ts +4 -0
- package/dist/routes/github.d.ts +3 -0
- package/dist/routes/insights.d.ts +3 -0
- package/dist/routes/install.d.ts +5 -0
- package/dist/routes/machines.d.ts +3 -0
- package/dist/routes/packs.d.ts +3 -0
- package/dist/routes/preference-registry.d.ts +5 -0
- package/dist/routes/rigs.d.ts +3 -0
- package/dist/routes/scheduled-tasks.d.ts +3 -0
- package/dist/routes/sessions.d.ts +15 -0
- package/dist/routes/social.d.ts +3 -0
- package/dist/routes/transcriptions.d.ts +3 -0
- package/dist/routes/workspace-capture.d.ts +59 -0
- package/dist/routes/workspace-instruction-policies.d.ts +3 -0
- package/dist/routes/workspace-state.d.ts +3 -0
- package/dist/routes/workspaces.d.ts +5 -0
- package/dist/sandbox/access.d.ts +21 -0
- package/dist/sandbox/auth-callout.d.ts +30 -0
- package/dist/sandbox/channel-a.d.ts +37 -0
- package/dist/sandbox/enrollment.d.ts +120 -0
- package/dist/sandbox/machines.d.ts +29 -0
- package/dist/sandbox/metrics-ingestion.d.ts +128 -0
- package/dist/sandbox/rematerialize.d.ts +24 -0
- package/dist/sandbox/viewer.d.ts +251 -0
- package/dist/transcription/providers/azure-openai.d.ts +9 -0
- package/dist/transcription/providers/codex-subscription.d.ts +9 -0
- package/dist/transcription/providers/openai.d.ts +9 -0
- package/dist/transcription/service.d.ts +10 -0
- package/dist/workspace-state-projection.d.ts +16 -0
- package/package.json +13 -13
- package/src/app.ts +75 -5
- package/src/github-access.ts +1 -0
- package/src/integrations/google-drive.ts +869 -0
- package/src/integrations/oauth-client.ts +41 -6
- package/src/integrations/slack-bot.ts +756 -26
- package/src/mcp/server.ts +226 -42
- package/src/mcp/session-view.ts +1 -0
- package/src/mcp/toolspace.ts +17 -9
- package/src/routes/connections.ts +137 -7
- package/src/routes/documents.ts +13 -2
- package/src/routes/github.ts +327 -20
- package/src/routes/insights.ts +30 -0
- package/src/routes/preference-registry.ts +482 -0
- package/src/routes/sessions.ts +22 -23
- package/src/routes/transcriptions.ts +155 -0
- package/src/routes/workspace-capture.ts +108 -8
- package/src/routes/workspace-state.ts +61 -0
- package/src/sandbox/channel-a.ts +2 -0
- package/src/sandbox/rematerialize.ts +111 -4
- package/src/sandbox/viewer.ts +29 -12
- package/src/transcription/providers/azure-openai.ts +45 -0
- package/src/transcription/providers/codex-subscription.ts +100 -0
- package/src/transcription/providers/openai.ts +93 -0
- package/src/transcription/service.ts +121 -0
- package/src/workspace-state-projection.ts +244 -0
- package/dist/chunk-SD5GJTZ4.js.map +0 -1
package/dist/app.d.ts
CHANGED
|
@@ -1,43 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Hono } from
|
|
3
|
-
import { AppDependencies } from
|
|
4
|
-
export { ApiRouteDeps, AppDependencies, DocumentIndexClient, ObjectStorageDependency, SessionWorkflowClient,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
declare function
|
|
16
|
-
declare function
|
|
17
|
-
declare function
|
|
18
|
-
type SseDeliveryOptions = {
|
|
19
|
-
maxQueuedBytes?: number;
|
|
20
|
-
stallTimeoutMs?: number;
|
|
21
|
-
observability?: Observability | undefined;
|
|
22
|
-
onObservation?: ((observation: SseDeliveryBoundObservation) => void) | undefined;
|
|
23
|
-
};
|
|
24
|
-
type SessionSseDeliveryOptions = SseDeliveryOptions & {
|
|
25
|
-
/** Host ACL re-check, run even while the event stream is otherwise idle. */
|
|
26
|
-
reauthorize?: (() => Promise<void>) | undefined;
|
|
27
|
-
reauthorizeAfterMs?: number | undefined;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
declare const API_MAX_REQUEST_BODY_BYTES: number;
|
|
31
|
-
declare function createApp(deps: AppDependencies): Hono;
|
|
32
|
-
declare function allowedCorsOrigin(pattern: string, origin: string): boolean;
|
|
33
|
-
declare function httpStatusForError(error: unknown): number;
|
|
34
|
-
declare function errorCodeForStatus(status: number): ErrorCode;
|
|
35
|
-
declare function routeLabel(pathname: string): string;
|
|
1
|
+
import { type ErrorCode } from "@opengeni/contracts";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import type { AppDependencies } from "@opengeni/core";
|
|
4
|
+
export type { ApiRouteDeps, AppDependencies, DocumentIndexClient, ObjectStorageDependency, SessionWorkflowClient, } from "@opengeni/core";
|
|
5
|
+
export { mergeResourceRefs, mergeToolRefs, normalizeResources, validateFileResources, validateGitHubRepositorySelection, validateGitHubRepositorySelectionShape, validateGitHubRepositorySelectionShapes, validateToolRefs, withDefaultEnabledCapabilityMcpTools, } from "@opengeni/core";
|
|
6
|
+
export { workflowIdForSession } from "@opengeni/core";
|
|
7
|
+
export { replaySessionEvents, sseSessionStream, sseWorkspaceControlStream } from "./http/sse";
|
|
8
|
+
export declare const API_MAX_REQUEST_BODY_BYTES: number;
|
|
9
|
+
/** Effective Hono bodyLimit — API JSON ceiling or voice multipart + multipart overhead. */
|
|
10
|
+
export declare function apiRequestBodyLimitBytes(settings: {
|
|
11
|
+
voiceInputMaxSizeBytes: number;
|
|
12
|
+
}): number;
|
|
13
|
+
export declare function createApp(deps: AppDependencies): Hono;
|
|
14
|
+
export declare function allowedCorsOrigin(pattern: string, origin: string): boolean;
|
|
15
|
+
export declare function httpStatusForError(error: unknown): number;
|
|
16
|
+
export declare function errorCodeForStatus(status: number): ErrorCode;
|
|
17
|
+
export declare function routeLabel(pathname: string): string;
|
|
36
18
|
/**
|
|
37
19
|
* State-changing OpenGeni HTTP calls must never cross an incompatible rollout
|
|
38
20
|
* boundary. Standard third-party protocols and externally initiated callbacks
|
|
39
21
|
* are intentionally outside this product API contract.
|
|
40
22
|
*/
|
|
41
|
-
declare function isApiContractProtectedMutation(method: string, pathname: string): boolean;
|
|
42
|
-
|
|
43
|
-
export { API_MAX_REQUEST_BODY_BYTES, allowedCorsOrigin, createApp, errorCodeForStatus, httpStatusForError, isApiContractProtectedMutation, replaySessionEvents, routeLabel, sseSessionStream, sseWorkspaceControlStream };
|
|
23
|
+
export declare function isApiContractProtectedMutation(method: string, pathname: string): boolean;
|
package/dist/app.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
API_MAX_REQUEST_BODY_BYTES,
|
|
3
3
|
allowedCorsOrigin,
|
|
4
|
+
apiRequestBodyLimitBytes,
|
|
4
5
|
createApp,
|
|
5
6
|
errorCodeForStatus,
|
|
6
7
|
httpStatusForError,
|
|
@@ -19,10 +20,11 @@ import {
|
|
|
19
20
|
validateToolRefs,
|
|
20
21
|
withDefaultEnabledCapabilityMcpTools,
|
|
21
22
|
workflowIdForSession
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-36PW33ND.js";
|
|
23
24
|
export {
|
|
24
25
|
API_MAX_REQUEST_BODY_BYTES,
|
|
25
26
|
allowedCorsOrigin,
|
|
27
|
+
apiRequestBodyLimitBytes,
|
|
26
28
|
createApp,
|
|
27
29
|
errorCodeForStatus,
|
|
28
30
|
httpStatusForError,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import { type ManagedAuth } from "@opengeni/core";
|
|
3
|
+
import type { Database } from "@opengeni/db";
|
|
4
|
+
export type { ManagedAuth };
|
|
5
|
+
export declare function createManagedAuth(settings: Settings, db: Database): ManagedAuth | null;
|
|
6
|
+
export declare function managedSessionAccessContext(auth: ManagedAuth, db: Database, headers: Headers): Promise<{
|
|
7
|
+
mode: "configured" | "local" | "managed";
|
|
8
|
+
subjectId: string;
|
|
9
|
+
subjectLabel?: string | undefined;
|
|
10
|
+
accountGrants: {
|
|
11
|
+
accountId: string;
|
|
12
|
+
subjectId: string;
|
|
13
|
+
subjectLabel?: string | undefined;
|
|
14
|
+
role?: "admin" | "member" | "owner" | undefined;
|
|
15
|
+
permissions: ("account:admin" | "account:read" | "api_keys:manage" | "billing:manage" | "billing:read" | "connections:read" | "connections:write" | "documents:manage" | "documents:search" | "enrollments:manage" | "enrollments:read" | "environments:manage" | "environments:use" | "files:read" | "files:upload" | "files:write" | "github:manage" | "github:use" | "goals:manage" | "mcp_servers:attach" | "members:manage" | "rigs:manage" | "rigs:use" | "scheduled_tasks:manage" | "scheduled_tasks:run" | "sessions:control" | "sessions:create" | "sessions:read" | "stream:acknowledge" | "stream:control" | "stream:view" | "terminal:attach" | "toolspace:call" | "variable-sets:manage" | "variable-sets:use" | "workspace:admin" | "workspace:create" | "workspace:read")[];
|
|
16
|
+
metadata?: Record<string, unknown> | undefined;
|
|
17
|
+
}[];
|
|
18
|
+
workspaceGrants: {
|
|
19
|
+
workspaceId: string;
|
|
20
|
+
accountId: string;
|
|
21
|
+
subjectId: string;
|
|
22
|
+
subjectLabel?: string | undefined;
|
|
23
|
+
permissions: ("account:admin" | "account:read" | "api_keys:manage" | "billing:manage" | "billing:read" | "connections:read" | "connections:write" | "documents:manage" | "documents:search" | "enrollments:manage" | "enrollments:read" | "environments:manage" | "environments:use" | "files:read" | "files:upload" | "files:write" | "github:manage" | "github:use" | "goals:manage" | "mcp_servers:attach" | "members:manage" | "rigs:manage" | "rigs:use" | "scheduled_tasks:manage" | "scheduled_tasks:run" | "sessions:control" | "sessions:create" | "sessions:read" | "stream:acknowledge" | "stream:control" | "stream:view" | "terminal:attach" | "toolspace:call" | "variable-sets:manage" | "variable-sets:use" | "workspace:admin" | "workspace:create" | "workspace:read")[];
|
|
24
|
+
principalKind?: "agent_attempt" | "api_key" | "configured_key" | "human_session" | "service" | undefined;
|
|
25
|
+
metadata?: Record<string, unknown> | undefined;
|
|
26
|
+
serviceInitiator?: {
|
|
27
|
+
kind: "service";
|
|
28
|
+
subjectId: string;
|
|
29
|
+
label?: string | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
serviceInitiatorContext?: Record<string, unknown> | undefined;
|
|
32
|
+
}[];
|
|
33
|
+
defaultAccountId: string | null;
|
|
34
|
+
defaultWorkspaceId: string | null;
|
|
35
|
+
} | null>;
|