@opengeni/api-router 2.6.4 → 2.10.0-canary.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 (75) hide show
  1. package/dist/access-grant-rls.d.ts +3 -0
  2. package/dist/app.d.ts +2 -1
  3. package/dist/app.js +3 -1
  4. package/dist/auth/organization-user-setup.d.ts +23 -0
  5. package/dist/{chunk-XTLI3CBH.js → chunk-XXH7DW34.js} +6866 -3554
  6. package/dist/chunk-XXH7DW34.js.map +1 -0
  7. package/dist/codemode.d.ts +6 -0
  8. package/dist/github-access.d.ts +25 -2
  9. package/dist/http/request-source.d.ts +14 -0
  10. package/dist/index.js +19 -3
  11. package/dist/index.js.map +1 -1
  12. package/dist/integrations/oauth-client.d.ts +2 -11
  13. package/dist/integrations/personal-github-repositories.d.ts +41 -2
  14. package/dist/integrations/slack-interactions.d.ts +1 -1
  15. package/dist/mcp/server.d.ts +158 -1
  16. package/dist/mcp/session-view.d.ts +56 -2
  17. package/dist/mcp/session-wait.d.ts +1 -1
  18. package/dist/mcp-oauth.d.ts +19 -0
  19. package/dist/model-catalog.d.ts +5 -31
  20. package/dist/routes/codex.d.ts +27 -2
  21. package/dist/routes/github.d.ts +2 -0
  22. package/dist/routes/organization-model-providers.d.ts +3 -0
  23. package/dist/routes/workspace-artifacts.d.ts +2 -1
  24. package/dist/work-discovery-observability.d.ts +1 -1
  25. package/dist/workspace-artifact-content.d.ts +28 -0
  26. package/dist/workspace-artifact-provenance.d.ts +7 -0
  27. package/dist/workspace-deletion.d.ts +6 -0
  28. package/dist/workspace-tool-gateway-observability.d.ts +17 -0
  29. package/dist/workspace-tool-gateway.d.ts +118 -0
  30. package/package.json +19 -18
  31. package/src/access-grant-rls.ts +40 -0
  32. package/src/app.ts +296 -53
  33. package/src/auth/organization-user-setup.ts +95 -5
  34. package/src/codemode.ts +33 -4
  35. package/src/github-access.ts +117 -1
  36. package/src/http/auth.ts +11 -0
  37. package/src/http/request-source.ts +37 -0
  38. package/src/http/sse.ts +15 -7
  39. package/src/index.ts +18 -2
  40. package/src/integrations/oauth-client.ts +168 -203
  41. package/src/integrations/personal-github-repositories.ts +238 -9
  42. package/src/integrations/slack-app-home.ts +2 -2
  43. package/src/integrations/slack-interactions.ts +77 -37
  44. package/src/mcp/company-brain-governed-writes.ts +2 -2
  45. package/src/mcp/company-profile-agent-admin.ts +1 -1
  46. package/src/mcp/remember.ts +1 -1
  47. package/src/mcp/server.ts +504 -133
  48. package/src/mcp/session-view.ts +20 -1
  49. package/src/mcp/session-wait.ts +3 -0
  50. package/src/mcp-oauth.ts +539 -0
  51. package/src/model-catalog.ts +45 -337
  52. package/src/routes/automations.ts +178 -19
  53. package/src/routes/codex.ts +242 -73
  54. package/src/routes/connections.ts +271 -16
  55. package/src/routes/documents.ts +67 -19
  56. package/src/routes/files.ts +54 -6
  57. package/src/routes/github.ts +116 -15
  58. package/src/routes/organization-memberships.ts +59 -16
  59. package/src/routes/organization-model-providers.ts +231 -0
  60. package/src/routes/packs.ts +1 -0
  61. package/src/routes/personal-github.ts +39 -0
  62. package/src/routes/pr-review.ts +72 -4
  63. package/src/routes/scheduled-tasks.ts +40 -13
  64. package/src/routes/sessions.ts +153 -65
  65. package/src/routes/supergrok.ts +3 -2
  66. package/src/routes/workspace-artifacts.ts +176 -67
  67. package/src/routes/workspaces.ts +405 -62
  68. package/src/sandbox/channel-a.ts +17 -4
  69. package/src/work-discovery-observability.ts +3 -3
  70. package/src/workspace-artifact-content.ts +163 -0
  71. package/src/workspace-artifact-provenance.ts +104 -0
  72. package/src/workspace-deletion.ts +64 -0
  73. package/src/workspace-tool-gateway-observability.ts +100 -0
  74. package/src/workspace-tool-gateway.ts +691 -0
  75. package/dist/chunk-XTLI3CBH.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ import type { AccessGrant } from "@opengeni/contracts";
2
+ import { type ApiRouteDeps } from "@opengeni/core";
3
+ export declare function withAccessGrantSessionRlsContext<T>(deps: ApiRouteDeps, grant: AccessGrant, fn: () => Promise<T>): Promise<T>;
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type ErrorCode } from "@opengeni/contracts";
1
+ import { type AccessGrant, type ErrorCode } from "@opengeni/contracts";
2
2
  import { Hono } from "hono";
3
3
  import type { ApiRouteDeps, AppDependencies } from "@opengeni/core";
4
4
  export { allowedCorsOrigin } from "./http/cors.js";
@@ -13,6 +13,7 @@ export declare function apiRequestBodyLimitBytes(settings: {
13
13
  voiceInputResumableMaxChunkSizeBytes?: number;
14
14
  }): number;
15
15
  export declare function createApp(deps: AppDependencies): Hono;
16
+ export declare function resolveWorkspaceMcpRouteDeps(routeDeps: ApiRouteDeps, grant: AccessGrant): Promise<ApiRouteDeps>;
16
17
  export declare function createAppComposition(deps: AppDependencies): {
17
18
  app: Hono;
18
19
  routeDeps: ApiRouteDeps;
package/dist/app.js CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  mergeToolRefs,
13
13
  normalizeResources,
14
14
  replaySessionEvents,
15
+ resolveWorkspaceMcpRouteDeps,
15
16
  routeLabel,
16
17
  sseSessionStream,
17
18
  sseWorkspaceControlStream,
@@ -23,7 +24,7 @@ import {
23
24
  withDefaultEnabledCapabilityMcpTools,
24
25
  workflowIdForSession,
25
26
  workspaceActorContextExempt
26
- } from "./chunk-XTLI3CBH.js";
27
+ } from "./chunk-XXH7DW34.js";
27
28
  export {
28
29
  API_MAX_REQUEST_BODY_BYTES,
29
30
  allowedCorsOrigin,
@@ -38,6 +39,7 @@ export {
38
39
  mergeToolRefs,
39
40
  normalizeResources,
40
41
  replaySessionEvents,
42
+ resolveWorkspaceMcpRouteDeps,
41
43
  routeLabel,
42
44
  sseSessionStream,
43
45
  sseWorkspaceControlStream,
@@ -1,5 +1,6 @@
1
1
  import type { Settings } from "@opengeni/config";
2
2
  import type { ManagedEmailTransport } from "@opengeni/core";
3
+ export type OrganizationUserSetupEmailTokenTransport = "fragment" | "query";
3
4
  /**
4
5
  * Prove that the stable invited-user setup bearer can be constructed before an
5
6
  * invitation commits. Provider availability is intentionally outside this
@@ -7,11 +8,14 @@ import type { ManagedEmailTransport } from "@opengeni/core";
7
8
  * transport outcome after the invitation exists.
8
9
  */
9
10
  export declare function assertOrganizationUserSetupDeliveryConfigured(settings: Settings, transport: ManagedEmailTransport): void;
11
+ /** Enforce the query-bearing edge proof for env and embedded settings alike. */
12
+ export declare function assertOrganizationUserSetupQueryTransportConfigured(settings: Pick<Settings, "organizationUserSetupEmailTokenTransport" | "organizationUserSetupQueryEdgeSanitizationConfirmed">): void;
10
13
  /** Reject an invalid embedded-provider contract before any durable boundary. */
11
14
  export declare function assertManagedEmailTransportMetadata(transport: ManagedEmailTransport): void;
12
15
  export declare function deriveOrganizationUserSetupToken(settings: Settings, input: {
13
16
  invitationId: string;
14
17
  deliveryId: string;
18
+ transport?: OrganizationUserSetupEmailTokenTransport;
15
19
  }): Promise<{
16
20
  token: string;
17
21
  digest: string;
@@ -45,6 +49,25 @@ export declare function organizationUserSetupPayloadDigest(input: {
45
49
  html: string;
46
50
  providerIdempotencyScope: string;
47
51
  }): Promise<string>;
52
+ export declare function resolveOrganizationUserSetupDeliveryEmail(settings: Settings, input: {
53
+ invitationId: string;
54
+ deliveryId: string;
55
+ senderEmail: string;
56
+ recipientEmail: string;
57
+ recipientName: string | null;
58
+ organizationName: string;
59
+ organizationRole: "owner" | "admin" | "member";
60
+ sharedWorkspaceAccess: OrganizationUserSetupEmailSnapshot["sharedWorkspaceAccess"];
61
+ providerIdempotencyScope: string;
62
+ frozenTransport: OrganizationUserSetupEmailTokenTransport | null;
63
+ frozenPayloadDigest: string | null;
64
+ }): Promise<{
65
+ transport: OrganizationUserSetupEmailTokenTransport;
66
+ token: string;
67
+ tokenDigest: string;
68
+ payloadDigest: string;
69
+ message: ReturnType<typeof renderOrganizationUserSetupEmail>;
70
+ }>;
48
71
  export declare function organizationUserSetupRequestFingerprint(settings: Settings, input: {
49
72
  tokenDigest: string;
50
73
  name: string;