@opengeni/api-router 5.2.0 → 5.3.0-canary.36927100590001

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 (76) hide show
  1. package/dist/access-grant-rls.d.ts +1 -1
  2. package/dist/app.d.ts +10 -1
  3. package/dist/app.js +6 -1
  4. package/dist/browser-controller-authority.d.ts +1 -61
  5. package/dist/browser-state-authority.d.ts +1 -27
  6. package/dist/{chunk-WL3TES6Q.js → chunk-2QCRFD6U.js} +5659 -3636
  7. package/dist/{chunk-WL3TES6Q.js.map → chunk-2QCRFD6U.js.map} +1 -1
  8. package/dist/chunk-OGQDXVXY.js +18 -0
  9. package/dist/chunk-OGQDXVXY.js.map +1 -0
  10. package/dist/claude-subscription-oauth.d.ts +20 -0
  11. package/dist/codemode.d.ts +3 -1
  12. package/dist/editable-artifact-source-session.d.ts +3 -0
  13. package/dist/editable-artifact-websocket.d.ts +5 -3
  14. package/dist/http/api-error.d.ts +9 -1
  15. package/dist/index.js +124 -10
  16. package/dist/index.js.map +1 -1
  17. package/dist/integration-endpoint-test.d.ts +20 -0
  18. package/dist/integrations/api-integrations.d.ts +2 -2
  19. package/dist/integrations/github-lens-connect.d.ts +23 -1
  20. package/dist/integrations/marketplace-plugin.d.ts +43 -43
  21. package/dist/integrations/oauth-client.d.ts +1 -0
  22. package/dist/integrations/slack-interactions.d.ts +2 -0
  23. package/dist/interaction-agent-access.d.ts +4 -8
  24. package/dist/mcp/server.d.ts +4 -4
  25. package/dist/routes/api-keys.d.ts +4 -7
  26. package/dist/routes/automations.d.ts +2 -0
  27. package/dist/routes/browser-sessions.d.ts +2 -0
  28. package/dist/routes/claude-subscription-oauth.d.ts +3 -0
  29. package/dist/routes/codex.d.ts +2 -1
  30. package/dist/routes/session-artifact-associations.d.ts +4 -0
  31. package/dist/routes/session-history-imports.d.ts +9 -0
  32. package/dist/routes/usage-allowances.d.ts +12 -0
  33. package/dist/routes/workspace-integrations.d.ts +6 -1
  34. package/dist/routes/workspaces.d.ts +1 -1
  35. package/dist/sandbox/enrollment.d.ts +7 -1
  36. package/dist/{session-event-view-LHHZAJPE.js → session-event-view-5SPZTQBE.js} +3 -1
  37. package/dist/{session-event-view-LHHZAJPE.js.map → session-event-view-5SPZTQBE.js.map} +1 -1
  38. package/package.json +20 -19
  39. package/src/access-grant-rls.ts +31 -8
  40. package/src/app.ts +419 -34
  41. package/src/browser-controller-authority.ts +1 -186
  42. package/src/browser-state-authority.ts +1 -236
  43. package/src/claude-subscription-oauth.ts +348 -0
  44. package/src/claude-subscription-usage.ts +13 -2
  45. package/src/codemode.ts +26 -5
  46. package/src/editable-artifact-source-session.ts +123 -0
  47. package/src/editable-artifact-websocket.ts +16 -3
  48. package/src/http/api-error.ts +44 -1
  49. package/src/index.ts +9 -1
  50. package/src/integration-endpoint-test.ts +291 -0
  51. package/src/integrations/api-integrations.ts +81 -7
  52. package/src/integrations/oauth-client.ts +11 -3
  53. package/src/integrations/slack-interactions.ts +67 -16
  54. package/src/interaction-agent-access.ts +8 -20
  55. package/src/mcp/server.ts +174 -53
  56. package/src/routes/api-integrations.ts +107 -1
  57. package/src/routes/api-keys.ts +38 -21
  58. package/src/routes/automations.ts +68 -17
  59. package/src/routes/browser-sessions.ts +21 -1
  60. package/src/routes/claude-subscription-oauth.ts +114 -0
  61. package/src/routes/codex.ts +17 -7
  62. package/src/routes/connections.ts +21 -0
  63. package/src/routes/editable-artifacts.ts +63 -2
  64. package/src/routes/enrollments.ts +17 -0
  65. package/src/routes/knowledge.ts +29 -12
  66. package/src/routes/scheduled-tasks.ts +19 -1
  67. package/src/routes/session-artifact-associations.ts +87 -0
  68. package/src/routes/session-history-imports.ts +280 -0
  69. package/src/routes/sessions.ts +92 -9
  70. package/src/routes/usage-allowances.ts +371 -0
  71. package/src/routes/workspace-integrations.ts +171 -3
  72. package/src/routes/workspaces.ts +43 -9
  73. package/src/sandbox/channel-a.ts +1 -0
  74. package/src/sandbox/enrollment.ts +66 -3
  75. package/src/sandbox/viewer.ts +1 -0
  76. package/src/workspace-webhook-dispatch.ts +4 -0
@@ -1,3 +1,3 @@
1
1
  import type { AccessGrant } from "@opengeni/contracts";
2
2
  import { type ApiRouteDeps } from "@opengeni/core";
3
- export declare function withAccessGrantSessionRlsContext<T>(deps: ApiRouteDeps, grant: AccessGrant, fn: () => Promise<T>): Promise<T>;
3
+ export declare function withAccessGrantSessionRlsContext<T>(deps: Pick<ApiRouteDeps, "db">, grant: AccessGrant, fn: () => Promise<T>): Promise<T>;
package/dist/app.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { type AccessGrant, type ErrorCode } from "@opengeni/contracts";
1
+ import { type Settings } from "@opengeni/config";
2
+ import { type AccessGrant, type ErrorCode, type FirstPartyMcpToolName, type Session } from "@opengeni/contracts";
2
3
  import { Hono } from "hono";
3
4
  import type { ApiRouteDeps, AppDependencies } from "@opengeni/core";
4
5
  export { allowedCorsOrigin } from "./http/cors.js";
@@ -20,6 +21,14 @@ export declare function createAppComposition(deps: AppDependencies): {
20
21
  };
21
22
  export declare function appendVary(current: string | null, value: string): string;
22
23
  export declare function workspaceActorContextExempt(method: string, pathname: string): boolean;
24
+ /** Configured SDK credentials cannot regain tools from widened legacy columns. */
25
+ export declare function configuredCodemodeSessionProxyTools(settings: Pick<Settings, "defaultFirstPartyMcpTools" | "allowedFirstPartyMcpTools">, session: Pick<Session, "agent">): FirstPartyMcpToolName[] | null;
26
+ /**
27
+ * Permissions span capabilities: project_create grants sessions:create,
28
+ * and runtime titling grants sessions:control. Fence the endpoint family
29
+ * too, without changing null-config routing or ordinary REST authorization.
30
+ */
31
+ export declare function assertConfiguredCodemodeSessionProxyPath(session: Pick<Session, "id" | "agent">, path: string, method: string): void;
23
32
  export declare function httpStatusForError(error: unknown): number;
24
33
  export declare function errorCodeForStatus(status: number): ErrorCode;
25
34
  /**
package/dist/app.js CHANGED
@@ -5,6 +5,8 @@ import {
5
5
  apiContractAdmission,
6
6
  apiRequestBodyLimitBytes,
7
7
  appendVary,
8
+ assertConfiguredCodemodeSessionProxyPath,
9
+ configuredCodemodeSessionProxyTools,
8
10
  createApp,
9
11
  createAppComposition,
10
12
  errorCodeForStatus,
@@ -26,7 +28,8 @@ import {
26
28
  withDefaultEnabledCapabilityMcpTools,
27
29
  workflowIdForSession,
28
30
  workspaceActorContextExempt
29
- } from "./chunk-WL3TES6Q.js";
31
+ } from "./chunk-2QCRFD6U.js";
32
+ import "./chunk-OGQDXVXY.js";
30
33
  export {
31
34
  API_MAX_REQUEST_BODY_BYTES,
32
35
  REFUSED_API_CONTRACT_REVISIONS,
@@ -34,6 +37,8 @@ export {
34
37
  apiContractAdmission,
35
38
  apiRequestBodyLimitBytes,
36
39
  appendVary,
40
+ assertConfiguredCodemodeSessionProxyPath,
41
+ configuredCodemodeSessionProxyTools,
37
42
  createApp,
38
43
  createAppComposition,
39
44
  errorCodeForStatus,
@@ -1,61 +1 @@
1
- import type { InteractionPlacement, NetworkRouteConfiguration, NetworkRouteConsistency } from "@opengeni/contracts";
2
- type BrowserControllerAuthorityScope = {
3
- rootSecret: string;
4
- accountId: string;
5
- workspaceId: string;
6
- placement: InteractionPlacement;
7
- placementInstanceId: string;
8
- };
9
- type BrowserSessionAuthorityScope = BrowserControllerAuthorityScope & {
10
- browserSessionId: string;
11
- controllerGeneration: string;
12
- tokenGeneration: number;
13
- };
14
- type ComputerSessionAuthorityScope = BrowserControllerAuthorityScope & {
15
- computerSessionId: string;
16
- controllerGeneration: string;
17
- tokenGeneration: number;
18
- };
19
- /** Stable placement-admin authority. This token is installed owner-only inside
20
- * the exact placement and is never persisted or returned by the public API. */
21
- export declare function deriveBrowserControllerAdminToken(scope: BrowserControllerAuthorityScope): string;
22
- /** Deterministic controller credentials. The durable generations are the only
23
- * stored authority; plaintext tokens can be reconstructed only by API replicas
24
- * holding the deployment HMAC root. */
25
- export declare function deriveBrowserSessionControllerTokens(scope: BrowserSessionAuthorityScope): {
26
- controlToken: string;
27
- viewToken: string;
28
- };
29
- /** Secret-safe durable identity for one exact route launch. The digest binds
30
- * the route snapshot and proxy credential without making a password-verifier
31
- * hash available to database readers. */
32
- export declare function deriveBrowserNetworkRouteAuthorityDigest(scope: {
33
- rootSecret: string;
34
- accountId: string;
35
- workspaceId: string;
36
- browserSessionId: string;
37
- routeId: string;
38
- routeVersion: number;
39
- credentialVersion: number | null;
40
- configuration: NetworkRouteConfiguration;
41
- consistency: NetworkRouteConsistency;
42
- proxyCredential: {
43
- username: string;
44
- password: string;
45
- } | null;
46
- }): string;
47
- export declare function deriveBrowserViewGrantToken(scope: BrowserSessionAuthorityScope & {
48
- grantId: string;
49
- expiresAt: string;
50
- }): string;
51
- /** ComputerSession credentials share the placement controller root while using
52
- * resource-specific domains. Browser and computer authority cannot collide. */
53
- export declare function deriveComputerSessionControllerTokens(scope: ComputerSessionAuthorityScope): {
54
- controlToken: string;
55
- viewToken: string;
56
- };
57
- export declare function deriveComputerViewGrantToken(scope: ComputerSessionAuthorityScope & {
58
- grantId: string;
59
- expiresAt: string;
60
- }): string;
61
- export {};
1
+ export * from "@opengeni/interaction/browser-controller-authority";
@@ -1,27 +1 @@
1
- export type BrowserStateOperationScope = {
2
- accountId: string;
3
- workspaceId: string;
4
- browserSessionId: string;
5
- operationId: string;
6
- objectKey: string;
7
- };
8
- export type BrowserStateArtifactScope = {
9
- accountId: string;
10
- workspaceId: string;
11
- objectKey: string;
12
- artifactDigest: string;
13
- contentDigest: string;
14
- };
15
- /** Deterministic only within one idempotent publication operation. This lets a
16
- * control-plane retry present browserd with exactly the same secret authority
17
- * without storing a plaintext key or placing it in an operation row. */
18
- export declare function deriveBrowserStateDataKey(rootKey: Uint8Array, scopeInput: BrowserStateOperationScope): Buffer;
19
- /** Associated data for the encrypted profile object. It is reproducible from
20
- * durable non-secret artifact authority during restore. */
21
- export declare function browserStateArtifactAad(scopeInput: Pick<BrowserStateArtifactScope, "accountId" | "workspaceId" | "objectKey">): Buffer;
22
- /** Wrap a 32-byte artifact data key under the operator-held root key. The
23
- * ciphertext is bound to workspace, object, and both integrity digests. */
24
- export declare function wrapBrowserStateDataKey(rootKey: Uint8Array, dataKeyInput: Uint8Array, scopeInput: BrowserStateArtifactScope): string;
25
- export declare function unwrapBrowserStateDataKey(rootKey: Uint8Array, wrapped: string, scopeInput: BrowserStateArtifactScope): Buffer;
26
- export declare function browserStateObjectKey(workspaceIdInput: string, operationIdInput: string): string;
27
- export declare function browserStateManifestDigest(manifest: unknown): string;
1
+ export * from "@opengeni/interaction/browser-state-authority";