@opengeni/api-router 3.0.1 → 4.0.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.
- package/dist/admission-trace.d.ts +8 -0
- package/dist/app.js +1 -1
- package/dist/auth/managed-auth-attempt-context.d.ts +2 -0
- package/dist/auth/managed-auth-session-adapter.d.ts +2 -0
- package/dist/auth/managed-auth.d.ts +1 -0
- package/dist/auth/managed-sign-in-notifications.d.ts +4 -0
- package/dist/{chunk-AJ62T5QN.js → chunk-E7TZFJ65.js} +22300 -21113
- package/dist/{chunk-AJ62T5QN.js.map → chunk-E7TZFJ65.js.map} +1 -1
- package/dist/connection-ownership.d.ts +1 -2
- package/dist/fatal-process-boundary.d.ts +1 -1
- package/dist/index.js +24 -6
- package/dist/index.js.map +1 -1
- package/dist/integrations/atlassian.d.ts +8 -3
- package/dist/integrations/fiken.d.ts +3 -1
- package/dist/integrations/github-lens-connect.d.ts +5 -65
- package/dist/integrations/google-drive.d.ts +2 -0
- package/dist/integrations/integration-commit-authority.d.ts +13 -0
- package/dist/integrations/oauth-client.d.ts +119 -11
- package/dist/integrations/oauth-profiles.d.ts +8 -13
- package/dist/integrations/slack-interactions.d.ts +1 -1
- package/dist/mcp/capability-account-readiness.d.ts +7 -0
- package/dist/mcp/first-party-tool-permissions.d.ts +4 -0
- package/dist/mcp-oauth.d.ts +22 -1
- package/dist/routes/api-integrations.d.ts +1 -0
- package/dist/routes/codex.d.ts +28 -0
- package/dist/routes/managed-sign-in-methods.d.ts +6 -0
- package/dist/routes/organization-integration-policy.d.ts +3 -0
- package/dist/routes/sessions.d.ts +24 -2
- package/dist/scheduled-task-deletion.d.ts +3 -4
- package/dist/workspace-tool-gateway.d.ts +3 -1
- package/package.json +15 -15
- package/src/admission-trace.ts +14 -0
- package/src/app.ts +141 -94
- package/src/auth/managed-auth-attempt-context.ts +9 -0
- package/src/auth/managed-auth-session-adapter.ts +11 -0
- package/src/auth/managed-auth.ts +39 -2
- package/src/auth/managed-sign-in-notifications.ts +81 -0
- package/src/connection-ownership.ts +2 -9
- package/src/editable-artifact-production.ts +6 -0
- package/src/fatal-process-boundary.ts +17 -2
- package/src/index.ts +3 -4
- package/src/integrations/atlassian.ts +184 -76
- package/src/integrations/fiken.ts +57 -35
- package/src/integrations/github-app-connect.ts +51 -15
- package/src/integrations/github-lens-connect.ts +7 -28
- package/src/integrations/google-drive.ts +296 -125
- package/src/integrations/integration-commit-authority.ts +69 -0
- package/src/integrations/oauth-client.ts +231 -132
- package/src/integrations/oauth-profiles.ts +10 -45
- package/src/integrations/personal-github.ts +55 -31
- package/src/integrations/provider-oauth.ts +57 -82
- package/src/integrations/social-oauth.ts +83 -56
- package/src/mcp/capability-account-readiness.ts +17 -0
- package/src/mcp/editable-artifacts.ts +7 -2
- package/src/mcp/first-party-tool-permissions.ts +1 -0
- package/src/mcp/knowledge-entries.ts +25 -8
- package/src/mcp/server.ts +135 -43
- package/src/mcp-oauth.ts +336 -34
- package/src/routes/api-integrations.ts +116 -4
- package/src/routes/automations.ts +5 -13
- package/src/routes/billing.ts +52 -0
- package/src/routes/canonical-human-identities.ts +61 -0
- package/src/routes/capabilities.ts +51 -1
- package/src/routes/codex.ts +4 -2
- package/src/routes/connect.ts +90 -31
- package/src/routes/connections.ts +487 -307
- package/src/routes/files.ts +21 -12
- package/src/routes/github.ts +48 -19
- package/src/routes/insights.ts +17 -7
- package/src/routes/integration-facets.ts +66 -25
- package/src/routes/knowledge.ts +48 -1
- package/src/routes/managed-sign-in-methods.ts +433 -0
- package/src/routes/organization-integration-policy.ts +113 -0
- package/src/routes/organization-memberships.ts +22 -2
- package/src/routes/plugins.ts +42 -4
- package/src/routes/pr-review-github.ts +67 -57
- package/src/routes/pr-review.ts +74 -71
- package/src/routes/rigs.ts +32 -13
- package/src/routes/scheduled-tasks.ts +6 -6
- package/src/routes/sessions.ts +233 -11
- package/src/routes/skill-content.ts +19 -3
- package/src/routes/social.ts +24 -13
- package/src/sandbox/channel-a.ts +7 -1
- package/src/sandbox/rematerialize.ts +2 -1
- package/src/scheduled-task-deletion.ts +13 -3
- package/src/workspace-tool-gateway.ts +31 -31
- package/dist/connection-authority-owner.d.ts +0 -59
- package/dist/routes/connection-authorities.d.ts +0 -3
- package/dist/routes/host-mcp-bindings.d.ts +0 -5
- package/dist/routes/host-mcp-resolvers.d.ts +0 -3
- package/dist/routes/packs.d.ts +0 -3
- package/src/connection-authority-owner.ts +0 -61
- package/src/routes/connection-authorities.ts +0 -139
- package/src/routes/host-mcp-bindings.ts +0 -122
- package/src/routes/host-mcp-resolvers.ts +0 -41
- package/src/routes/packs.ts +0 -784
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
type AtlassianRequestAuthority = {
|
|
2
|
+
connectionUseContext?: Omit<AcceptedConnectionUseContext, "physicalRequestId" | "usePhase">;
|
|
3
|
+
};
|
|
4
|
+
import type { AcceptedConnectionUseContext } from "@opengeni/db";
|
|
1
5
|
import { ExternalActorContinuation } from "@opengeni/contracts/external-identities";
|
|
2
6
|
import type { AccessGrant, ScheduledTask } from "@opengeni/contracts";
|
|
3
7
|
import { AtlassianOAuthStartResponse, type AtlassianDisconnectRequest, type AtlassianLifecycleActionRequest, type AtlassianOAuthStartRequest } from "@opengeni/contracts/atlassian";
|
|
@@ -22,7 +26,7 @@ export declare function completeAtlassianOAuthCallback(deps: ApiRouteDeps, input
|
|
|
22
26
|
redirectTo: string;
|
|
23
27
|
exactReturn?: boolean;
|
|
24
28
|
}>;
|
|
25
|
-
export declare function browseAtlassianSources(deps: ApiRouteDeps, input: {
|
|
29
|
+
export declare function browseAtlassianSources(deps: ApiRouteDeps, input: AtlassianRequestAuthority & {
|
|
26
30
|
workspaceId: string;
|
|
27
31
|
subjectId: string;
|
|
28
32
|
connectionId: string;
|
|
@@ -30,6 +34,7 @@ export declare function browseAtlassianSources(deps: ApiRouteDeps, input: {
|
|
|
30
34
|
connection: {
|
|
31
35
|
id: string;
|
|
32
36
|
authorityId?: string | undefined;
|
|
37
|
+
connectionAuthorityGeneration?: number | undefined;
|
|
33
38
|
accountId: string;
|
|
34
39
|
workspaceId: string;
|
|
35
40
|
subjectId: string | null;
|
|
@@ -63,7 +68,7 @@ export declare function browseAtlassianSources(deps: ApiRouteDeps, input: {
|
|
|
63
68
|
webUrl: string;
|
|
64
69
|
}[];
|
|
65
70
|
}>;
|
|
66
|
-
export declare function searchAtlassianLive(deps: ApiRouteDeps, input: {
|
|
71
|
+
export declare function searchAtlassianLive(deps: ApiRouteDeps, input: AtlassianRequestAuthority & {
|
|
67
72
|
workspaceId: string;
|
|
68
73
|
subjectId: string;
|
|
69
74
|
connectionId: string;
|
|
@@ -91,7 +96,7 @@ export declare function searchAtlassianLive(deps: ApiRouteDeps, input: {
|
|
|
91
96
|
updatedAt: string | null;
|
|
92
97
|
url: string;
|
|
93
98
|
})[]>;
|
|
94
|
-
export declare function getAtlassianLiveItem(deps: ApiRouteDeps, input: {
|
|
99
|
+
export declare function getAtlassianLiveItem(deps: ApiRouteDeps, input: AtlassianRequestAuthority & {
|
|
95
100
|
workspaceId: string;
|
|
96
101
|
subjectId: string;
|
|
97
102
|
connectionId: string;
|
|
@@ -6,7 +6,9 @@ import { type Database } from "@opengeni/db";
|
|
|
6
6
|
import { type FetchLike } from "@opengeni/network";
|
|
7
7
|
import { HTTPException } from "hono/http-exception";
|
|
8
8
|
/** Shared native/embedded token adapter. Provider verification happens before
|
|
9
|
-
* persistence; the caller reauthorizes inside its durable commit transaction.
|
|
9
|
+
* persistence; the caller reauthorizes inside its durable commit transaction.
|
|
10
|
+
* That caller must acquire the organization policy fence for `fiken` BEFORE
|
|
11
|
+
* owner/tenancy locks and invoke the returned writer with that exact tx. */
|
|
10
12
|
export declare function prepareFikenTokenInstall(deps: ApiRouteDeps, grant: Pick<AccessGrant, "accountId" | "workspaceId" | "subjectId">, raw: unknown, expectedVersion?: number): Promise<(tx: Database) => Promise<ConnectionMetadata>>;
|
|
11
13
|
export type FikenOperation = "companies.list" | "contacts.list" | "contact.create" | "products.list" | "invoices.list" | "invoice.get" | "invoice_draft.create" | "bank_accounts.list" | "purchases.list" | "sales.list";
|
|
12
14
|
export declare class FikenProviderError extends Error {
|
|
@@ -1,71 +1,13 @@
|
|
|
1
1
|
import { type GitHubInstallationBindingProof } from "@opengeni/contracts";
|
|
2
2
|
import { type ApiRouteDeps } from "@opengeni/core";
|
|
3
3
|
import { type Database } from "@opengeni/db";
|
|
4
|
-
export declare function requireGitHubLensConnect(deps: ApiRouteDeps
|
|
5
|
-
installation: {
|
|
6
|
-
skillWrites?: {
|
|
7
|
-
operationId: string;
|
|
8
|
-
skillId: string;
|
|
9
|
-
revisionId: string;
|
|
10
|
-
outcome: "applied" | "pending" | "preserved";
|
|
11
|
-
decision?: "rejected" | undefined;
|
|
12
|
-
pendingReason?: "approval" | "source_finalization" | undefined;
|
|
13
|
-
skillReview?: {
|
|
14
|
-
sourceOperationId: string;
|
|
15
|
-
skillId: string;
|
|
16
|
-
revisionId: string;
|
|
17
|
-
expectedRevisionId: string | null;
|
|
18
|
-
expectedScopeVersion: number;
|
|
19
|
-
} | undefined;
|
|
20
|
-
replayed: boolean;
|
|
21
|
-
}[] | undefined;
|
|
22
|
-
skillPublications?: {
|
|
23
|
-
operationId: string;
|
|
24
|
-
skillId: string;
|
|
25
|
-
revisionId: string;
|
|
26
|
-
outcome: "applied" | "pending" | "preserved";
|
|
27
|
-
decision?: "rejected" | undefined;
|
|
28
|
-
pendingReason?: "approval" | "source_finalization" | undefined;
|
|
29
|
-
skillReview?: {
|
|
30
|
-
sourceOperationId: string;
|
|
31
|
-
skillId: string;
|
|
32
|
-
revisionId: string;
|
|
33
|
-
expectedRevisionId: string | null;
|
|
34
|
-
expectedScopeVersion: number;
|
|
35
|
-
} | undefined;
|
|
36
|
-
replayed: boolean;
|
|
37
|
-
sourceOperationId: string;
|
|
38
|
-
activationEventId: string | null;
|
|
39
|
-
}[] | undefined;
|
|
40
|
-
skillReleases?: {
|
|
41
|
-
skillId: string;
|
|
42
|
-
revisionId: string | null;
|
|
43
|
-
disposition: "deactivated" | "inactive" | "preserved";
|
|
44
|
-
eventId: string | null;
|
|
45
|
-
warning: string | null;
|
|
46
|
-
}[] | undefined;
|
|
47
|
-
id: string;
|
|
48
|
-
accountId: string;
|
|
49
|
-
workspaceId: string;
|
|
50
|
-
packId: string;
|
|
51
|
-
status: "active" | "disabled" | "installing" | "needs_attention";
|
|
52
|
-
version: number;
|
|
53
|
-
manifestSnapshot: Record<string, unknown> | null;
|
|
54
|
-
manifestDigest: string | null;
|
|
55
|
-
selectedRigId: string | null;
|
|
56
|
-
installedBySubjectId: string | null;
|
|
57
|
-
metadata: Record<string, unknown>;
|
|
58
|
-
enabledAt: string;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
};
|
|
4
|
+
export declare function requireGitHubLensConnect(deps: ApiRouteDeps): Promise<{
|
|
61
5
|
template: {
|
|
62
|
-
|
|
63
|
-
name: string;
|
|
64
|
-
description: string;
|
|
65
|
-
adapterId: string;
|
|
6
|
+
adapterId: "source-control.pull-request.v1";
|
|
66
7
|
eventTypes: string[];
|
|
8
|
+
configuration: {};
|
|
67
9
|
sessionTemplate: {
|
|
68
|
-
bundledSkillIds?: ("builtin:document-parsing" | "builtin:opengeni-documents" | "builtin:opengeni-presentations" | "builtin:opengeni-projects" | "builtin:opengeni-sites" | "builtin:opengeni-skills" | "builtin:opengeni-spreadsheets" | "builtin:opengeni-video-generation" | "builtin:opengeni-visualize")[] | undefined;
|
|
10
|
+
bundledSkillIds?: ("builtin:document-parsing" | "builtin:opengeni-client" | "builtin:opengeni-documents" | "builtin:opengeni-help" | "builtin:opengeni-presentations" | "builtin:opengeni-projects" | "builtin:opengeni-sites" | "builtin:opengeni-skills" | "builtin:opengeni-spreadsheets" | "builtin:opengeni-video-generation" | "builtin:opengeni-visualize")[] | undefined;
|
|
69
11
|
prompt: string;
|
|
70
12
|
instructions: string | null;
|
|
71
13
|
resources: ({
|
|
@@ -104,7 +46,7 @@ export declare function requireGitHubLensConnect(deps: ApiRouteDeps, workspaceId
|
|
|
104
46
|
eager?: boolean | undefined;
|
|
105
47
|
optional?: boolean | undefined;
|
|
106
48
|
}[];
|
|
107
|
-
firstPartyMcpTools: ("artifacts_archive" | "artifacts_create" | "artifacts_get_source" | "artifacts_list" | "artifacts_prepare_upload" | "artifacts_publish" | "artifacts_restore" | "artifacts_rollback" | "atlassian_get" | "atlassian_search" | "atlassian_sources_list" | "browser_act" | "browser_auth" | "browser_clipboard" | "browser_debug" | "browser_identity" | "browser_lifecycle" | "browser_observe" | "browser_open" | "browser_publish" | "browser_tabs" | "capability_authorization_request" | "capability_catalog_search" | "command_read" | "command_wait" | "company_profile_confirm" | "company_profile_propose" | "computer_act" | "computer_clipboard" | "computer_lifecycle" | "computer_observe" | "computer_open" | "computer_targets" | "connected_machine_remove" | "editable_artifact_apply" | "editable_artifact_create" | "editable_artifact_export" | "editable_artifact_export_status" | "editable_artifact_get" | "editable_artifact_import" | "editable_artifact_inspect" | "editable_artifact_list" | "environment_list" | "environment_set_variable" | "fiken_bank_accounts_list" | "fiken_companies_list" | "fiken_contact_create" | "fiken_contacts_list" | "fiken_invoice_draft_create" | "fiken_invoice_get" | "fiken_invoices_list" | "fiken_products_list" | "fiken_purchases_list" | "fiken_sales_list" | "github_connect_link" | "github_repositories_list" | "goal_complete" | "goal_pause" | "goal_progress" | "goal_resume" | "goal_set" | "goal_update" | "instruction_policy_get" | "instruction_policy_propose" | "instruction_policy_save" | "interaction_discover" | "interaction_request_human" | "knowledge_archive" | "knowledge_browse" | "knowledge_correct" | "knowledge_get" | "knowledge_propose" | "knowledge_retain_file" | "knowledge_retain_message" | "knowledge_save" | "knowledge_search" | "memory_correct" | "memory_save" | "memory_search" | "preference_propose" | "preference_registry_get" | "preference_registry_summary" | "project_create" | "project_delete" | "project_get" | "project_list" | "project_reorder" | "project_update" | "reddit_accounts_list" | "reddit_mentions_live" | "reddit_post_reply" | "reddit_posts_sync" | "reddit_search_live" | "reddit_thread_fetch" | "remember" | "remember_confirm" | "rig_get" | "rig_list" | "rig_promote" | "rig_propose_change" | "rig_verify" | "run_on" | "sandbox_attach" | "sandbox_file_publish" | "sandbox_provision" | "sandbox_swap" | "sandboxes_list" | "scheduled_task_runs_list" | "scheduled_tasks_create" | "scheduled_tasks_delete" | "scheduled_tasks_get" | "scheduled_tasks_list" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_update" | "session_create" | "session_events" | "session_get" | "session_human_input_respond" | "session_pause" | "session_resume" | "session_send_message" | "session_set_project" | "session_steer" | "session_wait" | "sessions_list" | "set_other_session_title" | "set_session_title" | "slack_bot_channel_history" | "slack_bot_delete_message" | "slack_bot_file_content" | "slack_bot_file_info" | "slack_bot_list_channels" | "slack_bot_list_files" | "slack_bot_list_users" | "slack_bot_post_message" | "slack_bot_search" | "slack_bot_thread_replies" | "social_connections_list" | "social_daily_analysis_context" | "social_mentions_live" | "social_post_reply" | "social_posts_recent" | "social_posts_sync" | "social_search_live" | "social_thread_fetch" | "task_note_archive" | "task_note_promote_instruction_policy" | "task_note_promote_knowledge" | "task_note_promote_preference" | "task_note_replace" | "task_note_save" | "task_notes_list" | "variable_set_get_variable" | "variable_set_list" | "variable_set_set_variable" | "wait_for_input" | "work_claim_release" | "work_claim_upsert" | "x_accounts_list" | "x_mentions_live" | "x_post_reply" | "x_posts_sync" | "x_search_live" | "x_thread_fetch")[];
|
|
49
|
+
firstPartyMcpTools: ("artifacts_archive" | "artifacts_create" | "artifacts_get_source" | "artifacts_list" | "artifacts_prepare_upload" | "artifacts_publish" | "artifacts_restore" | "artifacts_rollback" | "atlassian_get" | "atlassian_search" | "atlassian_sources_list" | "browser_act" | "browser_auth" | "browser_clipboard" | "browser_debug" | "browser_identity" | "browser_lifecycle" | "browser_observe" | "browser_open" | "browser_publish" | "browser_tabs" | "capability_authorization_request" | "capability_catalog_search" | "command_read" | "command_wait" | "company_profile_confirm" | "company_profile_propose" | "computer_act" | "computer_clipboard" | "computer_lifecycle" | "computer_observe" | "computer_open" | "computer_targets" | "connected_machine_remove" | "editable_artifact_apply" | "editable_artifact_create" | "editable_artifact_export" | "editable_artifact_export_status" | "editable_artifact_get" | "editable_artifact_import" | "editable_artifact_inspect" | "editable_artifact_list" | "environment_list" | "environment_set_variable" | "fiken_bank_accounts_list" | "fiken_companies_list" | "fiken_contact_create" | "fiken_contacts_list" | "fiken_invoice_draft_create" | "fiken_invoice_get" | "fiken_invoices_list" | "fiken_products_list" | "fiken_purchases_list" | "fiken_sales_list" | "github_connect_link" | "github_repositories_list" | "goal_complete" | "goal_pause" | "goal_progress" | "goal_resume" | "goal_set" | "goal_update" | "instruction_policy_get" | "instruction_policy_propose" | "instruction_policy_save" | "interaction_discover" | "interaction_request_human" | "knowledge_archive" | "knowledge_browse" | "knowledge_correct" | "knowledge_get" | "knowledge_prepare_save" | "knowledge_propose" | "knowledge_retain_file" | "knowledge_retain_message" | "knowledge_save" | "knowledge_search" | "memory_correct" | "memory_save" | "memory_search" | "preference_propose" | "preference_registry_get" | "preference_registry_summary" | "project_create" | "project_delete" | "project_get" | "project_list" | "project_reorder" | "project_update" | "reddit_accounts_list" | "reddit_mentions_live" | "reddit_post_reply" | "reddit_posts_sync" | "reddit_search_live" | "reddit_thread_fetch" | "remember" | "remember_confirm" | "rig_get" | "rig_list" | "rig_promote" | "rig_propose_change" | "rig_verify" | "run_on" | "sandbox_attach" | "sandbox_file_publish" | "sandbox_provision" | "sandbox_swap" | "sandboxes_list" | "scheduled_task_runs_list" | "scheduled_tasks_create" | "scheduled_tasks_delete" | "scheduled_tasks_get" | "scheduled_tasks_list" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_update" | "session_create" | "session_events" | "session_get" | "session_human_input_respond" | "session_pause" | "session_resume" | "session_send_message" | "session_set_project" | "session_steer" | "session_wait" | "sessions_list" | "set_other_session_title" | "set_session_title" | "slack_bot_channel_history" | "slack_bot_delete_message" | "slack_bot_file_content" | "slack_bot_file_info" | "slack_bot_list_channels" | "slack_bot_list_files" | "slack_bot_list_users" | "slack_bot_post_message" | "slack_bot_search" | "slack_bot_thread_replies" | "social_connections_list" | "social_daily_analysis_context" | "social_mentions_live" | "social_post_reply" | "social_posts_recent" | "social_posts_sync" | "social_search_live" | "social_thread_fetch" | "task_note_archive" | "task_note_promote_instruction_policy" | "task_note_promote_knowledge" | "task_note_promote_preference" | "task_note_replace" | "task_note_save" | "task_notes_list" | "variable_set_get_variable" | "variable_set_list" | "variable_set_set_variable" | "wait_for_input" | "work_claim_release" | "work_claim_upsert" | "x_accounts_list" | "x_mentions_live" | "x_post_reply" | "x_posts_sync" | "x_search_live" | "x_thread_fetch")[];
|
|
108
50
|
firstPartyMcpPermissions: ("account:admin" | "account:read" | "api_keys:manage" | "artifacts:publish" | "artifacts:read" | "billing:manage" | "billing:read" | "capabilities:manage" | "codemode:call" | "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" | "secrets:list" | "secrets:read" | "secrets:write" | "sessions:control" | "sessions:create" | "sessions:read" | "stream:acknowledge" | "stream:control" | "stream:view" | "terminal:attach" | "variable-sets:attach" | "variable-sets:list" | "variable-sets:manage" | "variable-sets:read" | "variable-sets:use" | "variable-sets:write" | "workspace:admin" | "workspace:create" | "workspace:read")[];
|
|
109
51
|
model: string | null;
|
|
110
52
|
reasoningEffort: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | null;
|
|
@@ -112,8 +54,6 @@ export declare function requireGitHubLensConnect(deps: ApiRouteDeps, workspaceId
|
|
|
112
54
|
policyRole: string | null;
|
|
113
55
|
metadata: Record<string, unknown>;
|
|
114
56
|
};
|
|
115
|
-
configuration: Record<string, unknown>;
|
|
116
|
-
connectionRequirement: string | null;
|
|
117
57
|
};
|
|
118
58
|
}>;
|
|
119
59
|
/** Separate Lens registration/source/automation domain, not a repository-access
|
|
@@ -57,6 +57,7 @@ export declare function browseGoogleDrive(deps: ApiRouteDeps, input: {
|
|
|
57
57
|
connection: {
|
|
58
58
|
id: string;
|
|
59
59
|
authorityId?: string | undefined;
|
|
60
|
+
connectionAuthorityGeneration?: number | undefined;
|
|
60
61
|
accountId: string;
|
|
61
62
|
workspaceId: string;
|
|
62
63
|
subjectId: string | null;
|
|
@@ -113,6 +114,7 @@ export declare function browseGoogleDriveFacetSource(deps: ApiRouteDeps, input:
|
|
|
113
114
|
connection: {
|
|
114
115
|
id: string;
|
|
115
116
|
authorityId?: string | undefined;
|
|
117
|
+
connectionAuthorityGeneration?: number | undefined;
|
|
116
118
|
accountId: string;
|
|
117
119
|
workspaceId: string;
|
|
118
120
|
subjectId: string | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AccessGrant, type Permission } from "@opengeni/contracts";
|
|
2
|
+
import { type Settings } from "@opengeni/config";
|
|
3
|
+
import { type AccessGrantAuthorization } from "@opengeni/core";
|
|
4
|
+
import type { Database } from "@opengeni/db";
|
|
5
|
+
export type IntegrationCommitGrant = AccessGrant & {
|
|
6
|
+
authorizeCommit: (tx: Database) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
/** Keep server-verified provenance alongside the grant across provider work.
|
|
9
|
+
* Call only inside the policy transaction, before persistence locks. */
|
|
10
|
+
export declare function integrationCommitGrant(authorization: AccessGrantAuthorization, permissions: readonly Permission[], request: {
|
|
11
|
+
settings: Settings;
|
|
12
|
+
authorizationHeader?: string | undefined;
|
|
13
|
+
}): Promise<IntegrationCommitGrant>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
|
-
import { OAuthStartResponse, type
|
|
2
|
+
import { OAuthStartResponse, type OAuthStartRequest } from "@opengeni/contracts";
|
|
3
3
|
import { ExternalActorContinuation } from "@opengeni/contracts/external-identities";
|
|
4
4
|
import type { Observability } from "@opengeni/observability";
|
|
5
|
-
import { type Database } from "@opengeni/db";
|
|
5
|
+
import { claimConnectOperation, finishConnectOperation, type Database } from "@opengeni/db";
|
|
6
6
|
import { type McpAuthorizationServerMetadata } from "@opengeni/network";
|
|
7
7
|
import { type OAuthProviderProfile } from "./oauth-profiles.js";
|
|
8
8
|
export declare const oauthStateTtlMs: number;
|
|
@@ -16,6 +16,8 @@ type OAuthClientDeps = {
|
|
|
16
16
|
oauthCallbackDeadlineMs?: number | undefined;
|
|
17
17
|
};
|
|
18
18
|
export type OAuthStartContext = {
|
|
19
|
+
/** Server-selected dedicated adapter identity; never copied from request metadata. */
|
|
20
|
+
integrationKey?: "gmail" | "slack-personal";
|
|
19
21
|
connectAttemptId?: string;
|
|
20
22
|
externalContinuation?: ExternalActorContinuation;
|
|
21
23
|
accountId: string;
|
|
@@ -38,16 +40,122 @@ type AuthorizationServerMetadata = McpAuthorizationServerMetadata;
|
|
|
38
40
|
export declare const OAUTH_START_DEADLINE_MS = 15000;
|
|
39
41
|
export declare const OAUTH_CALLBACK_DEADLINE_MS = 30000;
|
|
40
42
|
export type OAuthStartStage = "connection_lookup" | "mcp_challenge" | "protected_resource_metadata" | "authorization_server_metadata" | "client_registration";
|
|
43
|
+
/** Policy is the outermost lock. Receipt replay still runs normal authorization,
|
|
44
|
+
* but the DB calls authorizeAcquisition only for uncommitted progress. Provider
|
|
45
|
+
* requests must happen after this transaction, never inside either wrapper. */
|
|
46
|
+
export declare function claimOAuthAcquisition(db: Database, scope: Parameters<typeof claimConnectOperation>[1], input: Parameters<typeof claimConnectOperation>[2], integrationKey: string | null, acquiring?: boolean): Promise<{
|
|
47
|
+
status: "claimed";
|
|
48
|
+
attempt: import("@opengeni/contracts/connect").ConnectAttempt;
|
|
49
|
+
} | {
|
|
50
|
+
status: "replayed";
|
|
51
|
+
attempt: import("@opengeni/contracts/connect").ConnectAttempt;
|
|
52
|
+
}>;
|
|
53
|
+
type IntegrationSourceSelection = Record<string, unknown> & {
|
|
54
|
+
id: string;
|
|
55
|
+
syncEnabled: boolean;
|
|
56
|
+
readPolicy: "allow" | "ask" | "block";
|
|
57
|
+
};
|
|
58
|
+
/** Compare server-bound selections, not provider classification. Removing a
|
|
59
|
+
* source, disabling sync, or narrowing its read permission acquires no authority.
|
|
60
|
+
* Generation/timestamp bookkeeping does not turn an unchanged save into setup. */
|
|
61
|
+
export declare function integrationSourceSelectionRequiresAcquisition(previous: readonly IntegrationSourceSelection[], requested: readonly IntegrationSourceSelection[]): boolean;
|
|
62
|
+
export declare function finishOAuthAcquisition(db: Database, scope: Parameters<typeof finishConnectOperation>[1], input: Parameters<typeof finishConnectOperation>[2], integrationKey: string | null): Promise<{
|
|
63
|
+
id: string;
|
|
64
|
+
workspaceId: string;
|
|
65
|
+
providerId: string;
|
|
66
|
+
ownership: "personal" | "workspace";
|
|
67
|
+
revision: number;
|
|
68
|
+
state: "account_selection" | "cancelled" | "complete" | "connected_but_incomplete" | "credential_input" | "expired" | "failed" | "installing" | "preview" | "provider_wait" | "ready" | "requires_user_action" | "resource_selection" | "uncertain";
|
|
69
|
+
credentialsCommitted: boolean;
|
|
70
|
+
integrationInstalled: boolean;
|
|
71
|
+
completionRequirement: "connection" | "integration" | "provider_setup";
|
|
72
|
+
nextAction: {
|
|
73
|
+
type: "authorize";
|
|
74
|
+
url: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: "credentials";
|
|
77
|
+
fields: {
|
|
78
|
+
name: string;
|
|
79
|
+
label: string;
|
|
80
|
+
required: boolean;
|
|
81
|
+
secret: boolean;
|
|
82
|
+
options?: {
|
|
83
|
+
value: string;
|
|
84
|
+
label: string;
|
|
85
|
+
}[] | undefined;
|
|
86
|
+
}[];
|
|
87
|
+
} | {
|
|
88
|
+
type: "wait";
|
|
89
|
+
pollAfterMs: number;
|
|
90
|
+
userCode?: string | undefined;
|
|
91
|
+
verificationUrl?: string | undefined;
|
|
92
|
+
} | {
|
|
93
|
+
type: "select_account";
|
|
94
|
+
accounts: {
|
|
95
|
+
id: string;
|
|
96
|
+
providerId: string;
|
|
97
|
+
version?: number | undefined;
|
|
98
|
+
label: string;
|
|
99
|
+
ownership: "personal" | "workspace";
|
|
100
|
+
status: "auth_needed" | "connected" | "disabled";
|
|
101
|
+
}[];
|
|
102
|
+
} | {
|
|
103
|
+
type: "select_resources";
|
|
104
|
+
resources: {
|
|
105
|
+
id: string;
|
|
106
|
+
label: string;
|
|
107
|
+
kind: string;
|
|
108
|
+
}[];
|
|
109
|
+
cursor?: string | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
type: "preview";
|
|
112
|
+
previewId: string;
|
|
113
|
+
contentHash: string;
|
|
114
|
+
operations: {
|
|
115
|
+
id: string;
|
|
116
|
+
label: string;
|
|
117
|
+
kind: string;
|
|
118
|
+
}[];
|
|
119
|
+
} | {
|
|
120
|
+
type: "none";
|
|
121
|
+
};
|
|
122
|
+
expiresAt: string;
|
|
123
|
+
account?: {
|
|
124
|
+
id: string;
|
|
125
|
+
providerId: string;
|
|
126
|
+
version?: number | undefined;
|
|
127
|
+
label: string;
|
|
128
|
+
ownership: "personal" | "workspace";
|
|
129
|
+
status: "auth_needed" | "connected" | "disabled";
|
|
130
|
+
} | undefined;
|
|
131
|
+
installationTarget?: {
|
|
132
|
+
instanceKey: string;
|
|
133
|
+
displayName: string;
|
|
134
|
+
expectedInstanceVersion?: number | undefined;
|
|
135
|
+
} | undefined;
|
|
136
|
+
source?: {
|
|
137
|
+
kind: "definition";
|
|
138
|
+
definitionId: string;
|
|
139
|
+
} | {
|
|
140
|
+
kind: "openapi";
|
|
141
|
+
url: string;
|
|
142
|
+
baseUrl?: string | undefined;
|
|
143
|
+
} | {
|
|
144
|
+
kind: "graphql";
|
|
145
|
+
endpoint: string;
|
|
146
|
+
name?: string | undefined;
|
|
147
|
+
} | {
|
|
148
|
+
kind: "auto";
|
|
149
|
+
url: string;
|
|
150
|
+
baseUrl?: string | undefined;
|
|
151
|
+
} | undefined;
|
|
152
|
+
error?: {
|
|
153
|
+
code: string;
|
|
154
|
+
message: string;
|
|
155
|
+
retryable: boolean;
|
|
156
|
+
} | undefined;
|
|
157
|
+
}>;
|
|
41
158
|
export declare function startMcpOAuth(deps: OAuthClientDeps, context: OAuthStartContext): Promise<OAuthStartResponse>;
|
|
42
|
-
/** Ownership fence for the official Gmail profile, keyed by exact MCP URL. */
|
|
43
|
-
export declare function assertOfficialGmailPersonalOwnership(mcpUrl: string, ownership: ConnectionOwnership): void;
|
|
44
|
-
/**
|
|
45
|
-
* Slack's hosted MCP issues user tokens only. Sharing one human's grant as
|
|
46
|
-
* workspace authority made every shared agent act as a named employee; the
|
|
47
|
-
* OpenGeni workspace bot owns shared Slack access instead (bot-token search
|
|
48
|
-
* covers public channels, files, and users).
|
|
49
|
-
*/
|
|
50
|
-
export declare function assertHostedSlackMcpPersonalOwnership(hostedSlackMcp: boolean, ownership: ConnectionOwnership): void;
|
|
51
159
|
export declare function isHostedSlackMcpTarget(providerDomain: string, mcpUrl: string): boolean;
|
|
52
160
|
export declare function completeMcpOAuthCallback(deps: OAuthClientDeps, input: {
|
|
53
161
|
code?: string | undefined;
|
|
@@ -13,10 +13,9 @@ import { z } from "zod";
|
|
|
13
13
|
*
|
|
14
14
|
* Profiles come from two layers:
|
|
15
15
|
*
|
|
16
|
-
* 1. Built-in profiles
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* the fences never depend on catalog import state.
|
|
16
|
+
* 1. Built-in profiles pin known authorization servers and protocol quirks.
|
|
17
|
+
* Ownership defaults guide setup; users may choose personal or workspace.
|
|
18
|
+
* Authorization-server pins never depend on catalog import state.
|
|
20
19
|
* 2. A validated `oauthProfile` object on a global catalog row (curated
|
|
21
20
|
* overlay -> importer -> `capability_catalog_items.metadata`). A catalog
|
|
22
21
|
* profile applies only when no built-in matches, and it can only narrow the
|
|
@@ -76,10 +75,8 @@ export type OAuthProviderProfile = {
|
|
|
76
75
|
key: DeploymentManagedClientKey;
|
|
77
76
|
message: string;
|
|
78
77
|
};
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
/** Exact 422 message when an explicit disallowed ownership is requested. */
|
|
82
|
-
ownershipMessage?: string;
|
|
78
|
+
/** Suggested ownership; an explicit user choice always wins. */
|
|
79
|
+
defaultOwnership?: ConnectionOwnership;
|
|
83
80
|
/** Bind reconnect/dedupe to the exact mcpUrl, not just the provider domain. */
|
|
84
81
|
exactMcpBinding: boolean;
|
|
85
82
|
/** How an existing connection is chosen for reconnect coalescing. */
|
|
@@ -133,8 +130,6 @@ export declare function builtInOAuthProfileFor(input: {
|
|
|
133
130
|
}): OAuthProviderProfile | null;
|
|
134
131
|
/** Ownership an omitted request defaults to under a profile. */
|
|
135
132
|
export declare function defaultOwnershipFor(profile: OAuthProviderProfile): ConnectionOwnership;
|
|
136
|
-
/** Rejects an ownership outside the profile's allowed set with its exact message. */
|
|
137
|
-
export declare function assertOwnershipAllowed(profile: OAuthProviderProfile, ownership: ConnectionOwnership): void;
|
|
138
133
|
/** Enforces a profile's authorization-server origin pins with its exact message. */
|
|
139
134
|
export declare function assertAuthorizationServerPins(as: PinnableAuthorizationServer, pins: Pick<AuthorizationServerPins, "issuerOrigins" | "authorizationEndpointOrigins" | "tokenEndpointOrigins" | "message">): void;
|
|
140
135
|
/**
|
|
@@ -166,10 +161,10 @@ export declare const catalogOAuthProfileSchema: z.ZodObject<{
|
|
|
166
161
|
pinnedIssuerOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
167
162
|
pinnedEndpointOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
168
163
|
sendResourceParameter: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
-
|
|
164
|
+
defaultOwnership: z.ZodOptional<z.ZodEnum<{
|
|
170
165
|
personal: "personal";
|
|
171
166
|
workspace: "workspace";
|
|
172
|
-
}
|
|
167
|
+
}>>;
|
|
173
168
|
requestedScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
174
169
|
extraAuthorizeParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
175
170
|
}, z.core.$strict>;
|
|
@@ -190,6 +185,6 @@ export declare function catalogMcpUrlKey(value: string): string;
|
|
|
190
185
|
*
|
|
191
186
|
* A present-but-invalid profile fails closed with a 422: the row's operator
|
|
192
187
|
* declared constraints, and silently degrading to the default profile would
|
|
193
|
-
* drop an
|
|
188
|
+
* drop an origin pin on a JSON typo.
|
|
194
189
|
*/
|
|
195
190
|
export declare function oauthProfileFromCatalog(mcpUrl: string, raw: unknown): OAuthProviderProfile;
|
|
@@ -19,7 +19,7 @@ export declare const SLACK_SESSION_INSTRUCTIONS: string;
|
|
|
19
19
|
* selection at session creation while keeping Slack mutations out of the model
|
|
20
20
|
* surface; interaction delivery remains owned by the durable delivery pump.
|
|
21
21
|
*/
|
|
22
|
-
export declare const SLACK_TASK_FIRST_PARTY_MCP_TOOLS: ("artifacts_archive" | "artifacts_create" | "artifacts_get_source" | "artifacts_list" | "artifacts_prepare_upload" | "artifacts_publish" | "artifacts_restore" | "artifacts_rollback" | "atlassian_get" | "atlassian_search" | "atlassian_sources_list" | "browser_act" | "browser_auth" | "browser_clipboard" | "browser_debug" | "browser_identity" | "browser_lifecycle" | "browser_observe" | "browser_open" | "browser_publish" | "browser_tabs" | "capability_authorization_request" | "capability_catalog_search" | "command_read" | "command_wait" | "company_profile_confirm" | "company_profile_propose" | "computer_act" | "computer_clipboard" | "computer_lifecycle" | "computer_observe" | "computer_open" | "computer_targets" | "connected_machine_remove" | "editable_artifact_apply" | "editable_artifact_create" | "editable_artifact_export" | "editable_artifact_export_status" | "editable_artifact_get" | "editable_artifact_import" | "editable_artifact_inspect" | "editable_artifact_list" | "environment_list" | "environment_set_variable" | "fiken_bank_accounts_list" | "fiken_companies_list" | "fiken_contact_create" | "fiken_contacts_list" | "fiken_invoice_draft_create" | "fiken_invoice_get" | "fiken_invoices_list" | "fiken_products_list" | "fiken_purchases_list" | "fiken_sales_list" | "github_connect_link" | "github_repositories_list" | "goal_complete" | "goal_pause" | "goal_progress" | "goal_resume" | "goal_set" | "goal_update" | "instruction_policy_get" | "instruction_policy_propose" | "instruction_policy_save" | "interaction_discover" | "interaction_request_human" | "knowledge_archive" | "knowledge_browse" | "knowledge_correct" | "knowledge_get" | "knowledge_propose" | "knowledge_retain_file" | "knowledge_retain_message" | "knowledge_save" | "knowledge_search" | "memory_correct" | "memory_save" | "memory_search" | "preference_propose" | "preference_registry_get" | "preference_registry_summary" | "project_create" | "project_delete" | "project_get" | "project_list" | "project_reorder" | "project_update" | "reddit_accounts_list" | "reddit_mentions_live" | "reddit_post_reply" | "reddit_posts_sync" | "reddit_search_live" | "reddit_thread_fetch" | "remember" | "remember_confirm" | "rig_get" | "rig_list" | "rig_promote" | "rig_propose_change" | "rig_verify" | "run_on" | "sandbox_attach" | "sandbox_file_publish" | "sandbox_provision" | "sandbox_swap" | "sandboxes_list" | "scheduled_task_runs_list" | "scheduled_tasks_create" | "scheduled_tasks_delete" | "scheduled_tasks_get" | "scheduled_tasks_list" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_update" | "session_create" | "session_events" | "session_get" | "session_human_input_respond" | "session_pause" | "session_resume" | "session_send_message" | "session_set_project" | "session_steer" | "session_wait" | "sessions_list" | "set_other_session_title" | "set_session_title" | "slack_bot_channel_history" | "slack_bot_delete_message" | "slack_bot_file_content" | "slack_bot_file_info" | "slack_bot_list_channels" | "slack_bot_list_files" | "slack_bot_list_users" | "slack_bot_post_message" | "slack_bot_search" | "slack_bot_thread_replies" | "social_connections_list" | "social_daily_analysis_context" | "social_mentions_live" | "social_post_reply" | "social_posts_recent" | "social_posts_sync" | "social_search_live" | "social_thread_fetch" | "task_note_archive" | "task_note_promote_instruction_policy" | "task_note_promote_knowledge" | "task_note_promote_preference" | "task_note_replace" | "task_note_save" | "task_notes_list" | "variable_set_get_variable" | "variable_set_list" | "variable_set_set_variable" | "wait_for_input" | "work_claim_release" | "work_claim_upsert" | "x_accounts_list" | "x_mentions_live" | "x_post_reply" | "x_posts_sync" | "x_search_live" | "x_thread_fetch")[];
|
|
22
|
+
export declare const SLACK_TASK_FIRST_PARTY_MCP_TOOLS: ("artifacts_archive" | "artifacts_create" | "artifacts_get_source" | "artifacts_list" | "artifacts_prepare_upload" | "artifacts_publish" | "artifacts_restore" | "artifacts_rollback" | "atlassian_get" | "atlassian_search" | "atlassian_sources_list" | "browser_act" | "browser_auth" | "browser_clipboard" | "browser_debug" | "browser_identity" | "browser_lifecycle" | "browser_observe" | "browser_open" | "browser_publish" | "browser_tabs" | "capability_authorization_request" | "capability_catalog_search" | "command_read" | "command_wait" | "company_profile_confirm" | "company_profile_propose" | "computer_act" | "computer_clipboard" | "computer_lifecycle" | "computer_observe" | "computer_open" | "computer_targets" | "connected_machine_remove" | "editable_artifact_apply" | "editable_artifact_create" | "editable_artifact_export" | "editable_artifact_export_status" | "editable_artifact_get" | "editable_artifact_import" | "editable_artifact_inspect" | "editable_artifact_list" | "environment_list" | "environment_set_variable" | "fiken_bank_accounts_list" | "fiken_companies_list" | "fiken_contact_create" | "fiken_contacts_list" | "fiken_invoice_draft_create" | "fiken_invoice_get" | "fiken_invoices_list" | "fiken_products_list" | "fiken_purchases_list" | "fiken_sales_list" | "github_connect_link" | "github_repositories_list" | "goal_complete" | "goal_pause" | "goal_progress" | "goal_resume" | "goal_set" | "goal_update" | "instruction_policy_get" | "instruction_policy_propose" | "instruction_policy_save" | "interaction_discover" | "interaction_request_human" | "knowledge_archive" | "knowledge_browse" | "knowledge_correct" | "knowledge_get" | "knowledge_prepare_save" | "knowledge_propose" | "knowledge_retain_file" | "knowledge_retain_message" | "knowledge_save" | "knowledge_search" | "memory_correct" | "memory_save" | "memory_search" | "preference_propose" | "preference_registry_get" | "preference_registry_summary" | "project_create" | "project_delete" | "project_get" | "project_list" | "project_reorder" | "project_update" | "reddit_accounts_list" | "reddit_mentions_live" | "reddit_post_reply" | "reddit_posts_sync" | "reddit_search_live" | "reddit_thread_fetch" | "remember" | "remember_confirm" | "rig_get" | "rig_list" | "rig_promote" | "rig_propose_change" | "rig_verify" | "run_on" | "sandbox_attach" | "sandbox_file_publish" | "sandbox_provision" | "sandbox_swap" | "sandboxes_list" | "scheduled_task_runs_list" | "scheduled_tasks_create" | "scheduled_tasks_delete" | "scheduled_tasks_get" | "scheduled_tasks_list" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_update" | "session_create" | "session_events" | "session_get" | "session_human_input_respond" | "session_pause" | "session_resume" | "session_send_message" | "session_set_project" | "session_steer" | "session_wait" | "sessions_list" | "set_other_session_title" | "set_session_title" | "slack_bot_channel_history" | "slack_bot_delete_message" | "slack_bot_file_content" | "slack_bot_file_info" | "slack_bot_list_channels" | "slack_bot_list_files" | "slack_bot_list_users" | "slack_bot_post_message" | "slack_bot_search" | "slack_bot_thread_replies" | "social_connections_list" | "social_daily_analysis_context" | "social_mentions_live" | "social_post_reply" | "social_posts_recent" | "social_posts_sync" | "social_search_live" | "social_thread_fetch" | "task_note_archive" | "task_note_promote_instruction_policy" | "task_note_promote_knowledge" | "task_note_promote_preference" | "task_note_replace" | "task_note_save" | "task_notes_list" | "variable_set_get_variable" | "variable_set_list" | "variable_set_set_variable" | "wait_for_input" | "work_claim_release" | "work_claim_upsert" | "x_accounts_list" | "x_mentions_live" | "x_post_reply" | "x_posts_sync" | "x_search_live" | "x_thread_fetch")[];
|
|
23
23
|
export type NormalizedSlackInteraction = {
|
|
24
24
|
providerEventId: string;
|
|
25
25
|
providerMessageId: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { McpConnectionAccountBinding } from "@opengeni/contracts";
|
|
2
|
+
/** Canonical readiness comes only from routes present in this exact attempt,
|
|
3
|
+
* joined to this turn's accepted bindings. It never grants account access. */
|
|
4
|
+
export declare function capabilityAccountReadiness(availableRoutes: Iterable<string>, bindings: readonly McpConnectionAccountBinding[] | null): {
|
|
5
|
+
available: Set<string>;
|
|
6
|
+
accepted: Set<string>;
|
|
7
|
+
};
|
|
@@ -46,6 +46,10 @@ export declare const FIRST_PARTY_TOOL_AUTHORIZATION: {
|
|
|
46
46
|
sessionRequired: true;
|
|
47
47
|
allOf: "documents:search"[];
|
|
48
48
|
};
|
|
49
|
+
knowledge_prepare_save: {
|
|
50
|
+
sessionRequired: true;
|
|
51
|
+
allOf: "documents:search"[];
|
|
52
|
+
};
|
|
49
53
|
knowledge_get: {
|
|
50
54
|
sessionRequired: true;
|
|
51
55
|
allOf: "documents:search"[];
|
package/dist/mcp-oauth.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AccessGrant, type ToolGatewayCatalog, type ToolGatewayIdentity } from "@opengeni/contracts";
|
|
2
2
|
import { type ApiRouteDeps } from "@opengeni/core";
|
|
3
|
-
import { Hono } from "hono";
|
|
3
|
+
import { Hono, type Context } from "hono";
|
|
4
4
|
export type McpOAuthResource = {
|
|
5
5
|
resource: string;
|
|
6
6
|
workspaceId: string;
|
|
@@ -17,3 +17,24 @@ export declare function isMcpOAuthResourcePath(pathname: string): boolean;
|
|
|
17
17
|
export declare function mcpOAuthConsentToolIdentities(catalog: ToolGatewayCatalog): ToolGatewayIdentity[];
|
|
18
18
|
export declare function isMcpOAuthPublicProtocolPath(pathname: string): boolean;
|
|
19
19
|
export declare function mcpOAuthAuthenticateHeader(deps: ApiRouteDeps, pathname: string): string;
|
|
20
|
+
export declare function mcpOAuthRedirectUriCandidates(registered: string[], requested: string): string[];
|
|
21
|
+
export declare function completeAuthorizationRedirect(c: Context, redirectTo: string): Response;
|
|
22
|
+
export type McpOAuthConsentAccount = {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
export type McpOAuthConsentWorkspace = {
|
|
27
|
+
id: string;
|
|
28
|
+
accountId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
kind: "personal" | "shared";
|
|
31
|
+
};
|
|
32
|
+
export declare function renderMcpOAuthConsentPage(input: {
|
|
33
|
+
clientName: string;
|
|
34
|
+
requestToken: string;
|
|
35
|
+
accounts: McpOAuthConsentAccount[];
|
|
36
|
+
workspaces: McpOAuthConsentWorkspace[];
|
|
37
|
+
selectedWorkspaceId: string;
|
|
38
|
+
}): string;
|
|
39
|
+
export declare function renderMcpOAuthContinuePage(redirectTo: string): string;
|
|
40
|
+
export declare function renderMcpOAuthExpiredPage(message: string): string;
|
|
@@ -16,6 +16,7 @@ export declare function registerApiIntegrationRoutes(app: Hono, deps: ApiRouteDe
|
|
|
16
16
|
export declare function resolveForRoute(input: {
|
|
17
17
|
deps: ApiRouteDeps;
|
|
18
18
|
transport: ReturnType<typeof createPinnedIntegrationTransport>;
|
|
19
|
+
accountId: string;
|
|
19
20
|
workspaceId: string;
|
|
20
21
|
subjectId: string;
|
|
21
22
|
payload: PreviewApiIntegrationRequest | InstallApiIntegrationRequest;
|
package/dist/routes/codex.d.ts
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import { type CodexAccountStatus } from "@opengeni/db";
|
|
2
|
+
export declare function codexAccountJson(row: CodexAccountStatus, options?: {
|
|
3
|
+
appsCredentialId?: string | null;
|
|
4
|
+
canManageApps?: boolean;
|
|
5
|
+
humanSubjectId?: string | null;
|
|
6
|
+
}): {
|
|
7
|
+
id: string;
|
|
8
|
+
source: "organization" | "workspace";
|
|
9
|
+
chatgptAccountId: string | null;
|
|
10
|
+
label: string | null;
|
|
11
|
+
email: string | null;
|
|
12
|
+
plan: string | null;
|
|
13
|
+
status: string;
|
|
14
|
+
active: boolean;
|
|
15
|
+
expiresAt: Date | null;
|
|
16
|
+
lastRefreshAt: Date | null;
|
|
17
|
+
lastError: string | null;
|
|
18
|
+
fiveHour: import("@opengeni/codex").CodexUsageWindow | null;
|
|
19
|
+
weekly: import("@opengeni/codex").CodexUsageWindow | null;
|
|
20
|
+
usageCheckedAt: Date | null;
|
|
21
|
+
allocatorEnabled: boolean;
|
|
22
|
+
allocatorVersion: number;
|
|
23
|
+
allocatorUpdatedAt: Date | null;
|
|
24
|
+
resetCreditAvailableCount: number | null;
|
|
25
|
+
resetCreditsCheckedAt: Date | null;
|
|
26
|
+
exhaustedUntil: Date | null;
|
|
27
|
+
appsDesignated: boolean;
|
|
28
|
+
canEnableApps: boolean;
|
|
29
|
+
};
|
|
2
30
|
/**
|
|
3
31
|
* Derive the two distinct cached worker-readiness meanings exposed by the
|
|
4
32
|
* status route. `poolReady` means at least one effective-pool account passes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ApiRouteDeps } from "@opengeni/core";
|
|
2
|
+
import type { Context, Hono } from "hono";
|
|
3
|
+
export declare function admitManagedSignInMutation(context: Context, deps: ApiRouteDeps): Promise<void>;
|
|
4
|
+
export declare function registerManagedSignInMethodRoutes(app: Hono, deps: ApiRouteDeps): void;
|
|
5
|
+
/** Intercept only database-backed, product-issued explicit connect states. */
|
|
6
|
+
export declare function handleManagedSignInConnectCallback(context: Context, deps: ApiRouteDeps, provider: "google" | "github"): Promise<Response | null>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClientSessionEvent, SteerSessionMessageRequest, type SessionStatus, type WorkClaimSubjectFilter, type SessionGoalRevision, type SessionAuthorizationOperation } from "@opengeni/contracts";
|
|
2
|
-
import { type SessionDiscoveryCursor } from "@opengeni/db";
|
|
1
|
+
import { ClientSessionEvent, SessionScopeSubjectId, SteerSessionMessageRequest, type SessionStatus, type WorkClaimSubjectFilter, type SessionGoalRevision, type SessionAuthorizationOperation } from "@opengeni/contracts";
|
|
2
|
+
import { decodeSessionListCursor, type SessionDiscoveryCursor } from "@opengeni/db";
|
|
3
3
|
import type { Context, Hono } from "hono";
|
|
4
4
|
import type { ApiRouteDeps } from "@opengeni/core";
|
|
5
5
|
import { type ViewerServices } from "../sandbox/viewer.js";
|
|
@@ -13,6 +13,28 @@ export declare function goalProposalMatchesExpectedRevision(revision: Pick<Sessi
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function sessionAuthorizationOperationForHttp(method: string, pathname: string, sessionId: string): SessionAuthorizationOperation | null;
|
|
15
15
|
export declare function sessionTenancyHttpError(error: unknown): Error;
|
|
16
|
+
export declare function sessionListQuery(query: Record<string, string>, allowCursor?: boolean): {
|
|
17
|
+
originSiteId: string | undefined;
|
|
18
|
+
limit: string | undefined;
|
|
19
|
+
parentSessionId: string | null | undefined;
|
|
20
|
+
cursor: ReturnType<typeof decodeSessionListCursor> | undefined;
|
|
21
|
+
search: string | undefined;
|
|
22
|
+
pinsOnly: boolean;
|
|
23
|
+
archivedOnly: boolean;
|
|
24
|
+
sortBy: "updatedAt" | "createdAt" | "name" | undefined;
|
|
25
|
+
archiveStatus: "active" | "archived" | "all" | undefined;
|
|
26
|
+
channelId: string | null | undefined;
|
|
27
|
+
createdBy: {
|
|
28
|
+
kind: "subject" | "service";
|
|
29
|
+
subjectId: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
updatedFrom: Date | undefined;
|
|
32
|
+
updatedBefore: Date | undefined;
|
|
33
|
+
createdFrom: Date | undefined;
|
|
34
|
+
createdBefore: Date | undefined;
|
|
35
|
+
scopeSubjectId: SessionScopeSubjectId | undefined;
|
|
36
|
+
hasPageFilters: boolean;
|
|
37
|
+
};
|
|
16
38
|
export type AgentTopologyCursorEnvelope = {
|
|
17
39
|
cursor: SessionDiscoveryCursor;
|
|
18
40
|
parentSessionId: string | null | "all";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { ScheduledTask as ScheduledTaskValue } from "@opengeni/contracts";
|
|
1
|
+
import type { AccessGrant, ScheduledTask as ScheduledTaskValue } from "@opengeni/contracts";
|
|
2
2
|
import { type ApiRouteDeps } from "@opengeni/core";
|
|
3
3
|
import type { TemporalScheduleCleanupClaim } from "@opengeni/db";
|
|
4
4
|
/** Execute one exact connector obligation frozen into the tombstone outbox row. */
|
|
5
5
|
export declare function cleanupScheduledTaskConnectorAuthorization(deps: ApiRouteDeps, claim: TemporalScheduleCleanupClaim): Promise<void>;
|
|
6
6
|
/** Shared HTTP/MCP domain operation: authorize, tombstone, persist, then accelerate cleanup. */
|
|
7
|
-
export declare function deleteScheduledTaskWithDurableCleanup(deps: ApiRouteDeps,
|
|
8
|
-
|
|
7
|
+
export declare function deleteScheduledTaskWithDurableCleanup(deps: ApiRouteDeps, request: {
|
|
8
|
+
grant: AccessGrant;
|
|
9
9
|
taskId: string;
|
|
10
|
-
subjectId: string;
|
|
11
10
|
}): Promise<{
|
|
12
11
|
task: ScheduledTaskValue;
|
|
13
12
|
changed: boolean;
|
|
@@ -3,7 +3,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
3
3
|
import type { Settings } from "@opengeni/config";
|
|
4
4
|
import { ToolGatewayDeclarationsResponse, type AccessGrant, type ToolGatewayCatalog, type ToolGatewayIdentity } from "@opengeni/contracts";
|
|
5
5
|
import { type AccessGrantAuthorization, type ApiRouteDeps } from "@opengeni/core";
|
|
6
|
-
import { consumeToolGatewayApproval, getWorkspaceArtifactContentRef, issueToolGatewayApproval } from "@opengeni/db";
|
|
6
|
+
import { buildConnectionTokenResolver, consumeToolGatewayApproval, getWorkspaceArtifactContentRef, issueToolGatewayApproval } from "@opengeni/db";
|
|
7
7
|
import { type PreparedWorkspaceToolGatewayTools } from "@opengeni/runtime/workspace-tool-gateway";
|
|
8
8
|
import { type ToolGatewayDefinition } from "@opengeni/tool-gateway";
|
|
9
9
|
import type { Observability } from "@opengeni/observability";
|
|
@@ -33,6 +33,8 @@ export declare function prepareWorkspaceToolGatewayForGrant(routeDeps: ApiRouteD
|
|
|
33
33
|
serverId: string;
|
|
34
34
|
toolName: string;
|
|
35
35
|
}[]): Promise<PreparedWorkspaceToolGateway>;
|
|
36
|
+
/** Keep live caller authority independent of native connection acquisition and refresh. */
|
|
37
|
+
export declare function withWorkspaceConnectionAuthorization(resolve: ReturnType<typeof buildConnectionTokenResolver>, reauthorize?: () => Promise<void>): ReturnType<typeof buildConnectionTokenResolver>;
|
|
36
38
|
export declare function workspaceToolGatewayDefinitionFilter(settings: Pick<Settings, "allowedFirstPartyMcpTools">, allowedIdentities?: readonly ToolGatewayIdentity[]): (definition: ToolGatewayDefinition) => boolean;
|
|
37
39
|
export declare function workspaceToolGatewaySettingsForGrant(settings: Settings, grant: AccessGrant, allowedIdentities?: readonly {
|
|
38
40
|
serverId: string;
|