@opengeni/api-router 4.1.0 → 4.1.2-canary.36199476632001
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 +7 -1
- package/dist/app.js +1 -1
- package/dist/auth/managed-auth-rate-limits.d.ts +167 -0
- package/dist/auth/managed-auth.d.ts +37 -1
- package/dist/auth/signup-funnel-metrics.d.ts +44 -0
- package/dist/{chunk-24C5LPNE.js → chunk-QDIBJSM4.js} +3277 -1509
- package/dist/{chunk-24C5LPNE.js.map → chunk-QDIBJSM4.js.map} +1 -1
- package/dist/http/cors.d.ts +12 -0
- package/dist/http/local-browser-boundary.d.ts +72 -0
- package/dist/http/metrics-listener.d.ts +22 -0
- package/dist/http/registered-route-label.d.ts +16 -0
- package/dist/http/request-source.d.ts +41 -3
- package/dist/http/user-content.d.ts +36 -0
- package/dist/http/websocket-upgrade-dispatch.d.ts +18 -0
- package/dist/index.js +90 -31
- package/dist/index.js.map +1 -1
- package/dist/integrations/github-lens-connect.d.ts +1 -1
- package/dist/integrations/oauth-client.d.ts +30 -0
- package/dist/integrations/slack-bot.d.ts +48 -2
- package/dist/integrations/slack-interactions.d.ts +1 -1
- package/dist/mcp/documents.d.ts +2 -0
- package/dist/mcp/first-party-tool-permissions.d.ts +12 -0
- package/dist/mcp/server.d.ts +35 -0
- package/dist/model-catalog.d.ts +9 -3
- package/dist/observability.d.ts +3 -1
- package/dist/routes/billing.d.ts +27 -0
- package/dist/routes/browser-sessions.d.ts +3 -0
- package/dist/routes/client-errors.d.ts +42 -0
- package/dist/routes/computer-sessions.d.ts +2 -0
- package/dist/routes/github-browser-pages.d.ts +12 -0
- package/dist/routes/insights.d.ts +26 -0
- package/dist/sandbox/auth-callout.d.ts +8 -0
- package/dist/sandbox-file-artifacts.d.ts +17 -1
- package/package.json +19 -19
- package/src/app.ts +124 -12
- package/src/auth/managed-auth-rate-limits.ts +252 -0
- package/src/auth/managed-auth.ts +137 -17
- package/src/auth/signup-funnel-metrics.ts +164 -0
- package/src/http/auth.ts +6 -0
- package/src/http/cors.ts +37 -5
- package/src/http/local-browser-boundary.ts +343 -0
- package/src/http/metrics-listener.ts +57 -0
- package/src/http/registered-route-label.ts +34 -0
- package/src/http/request-source.ts +154 -13
- package/src/http/sse.ts +36 -16
- package/src/http/user-content.ts +158 -0
- package/src/http/websocket-upgrade-dispatch.ts +29 -0
- package/src/index.ts +22 -8
- package/src/integrations/atlassian.ts +7 -3
- package/src/integrations/fiken.ts +9 -3
- package/src/integrations/github-app-connect.ts +12 -2
- package/src/integrations/google-drive.ts +7 -3
- package/src/integrations/oauth-client.ts +99 -12
- package/src/integrations/personal-github.ts +4 -2
- package/src/integrations/provider-oauth.ts +10 -3
- package/src/integrations/slack-bot.ts +43 -1
- package/src/integrations/social-oauth.ts +7 -2
- package/src/mcp/documents.ts +9 -2
- package/src/mcp/files.ts +5 -1
- package/src/mcp/first-party-tool-permissions.ts +6 -0
- package/src/mcp/knowledge-entries.ts +15 -2
- package/src/mcp/server.ts +191 -17
- package/src/mcp-oauth.ts +4 -6
- package/src/model-catalog.ts +30 -3
- package/src/observability.ts +15 -1
- package/src/routes/billing.ts +70 -9
- package/src/routes/browser-sessions.ts +169 -0
- package/src/routes/client-errors.ts +182 -0
- package/src/routes/company-brain.ts +4 -0
- package/src/routes/computer-sessions.ts +37 -9
- package/src/routes/connections.ts +7 -1
- package/src/routes/documents.ts +6 -1
- package/src/routes/editable-artifacts.ts +2 -1
- package/src/routes/enrollments.ts +2 -13
- package/src/routes/files.ts +17 -3
- package/src/routes/github-browser-pages.ts +162 -0
- package/src/routes/github.ts +122 -49
- package/src/routes/insights.ts +70 -6
- package/src/routes/knowledge.ts +24 -1
- package/src/routes/managed-auth-session-sets.ts +26 -6
- package/src/routes/managed-onboarding.ts +23 -19
- package/src/routes/organization-memberships.ts +3 -0
- package/src/routes/scheduled-tasks.ts +9 -2
- package/src/routes/sessions.ts +89 -0
- package/src/routes/workspace-artifacts.ts +9 -0
- package/src/routes/workspace-state.ts +4 -0
- package/src/routes/workspaces.ts +38 -15
- package/src/sandbox/auth-callout.ts +62 -11
- package/src/sandbox/channel-a.ts +8 -0
- package/src/sandbox/viewer.ts +16 -3
- package/src/sandbox-file-artifacts.ts +37 -26
- package/src/site-uploads.ts +8 -1
- package/src/workspace-tool-gateway.ts +1 -0
|
@@ -46,7 +46,7 @@ export declare function requireGitHubLensConnect(deps: ApiRouteDeps): Promise<{
|
|
|
46
46
|
eager?: boolean | undefined;
|
|
47
47
|
optional?: boolean | undefined;
|
|
48
48
|
}[];
|
|
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_enroll_token" | "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")[];
|
|
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_read" | "browser_screenshot" | "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_enroll_token" | "connected_machine_remove" | "custom_mcp_setup_request" | "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")[];
|
|
50
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")[];
|
|
51
51
|
model: string | null;
|
|
52
52
|
reasoningEffort: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | null;
|
|
@@ -6,6 +6,34 @@ import { claimConnectOperation, finishConnectOperation, type Database } from "@o
|
|
|
6
6
|
import { type McpAuthorizationServerMetadata } from "@opengeni/network";
|
|
7
7
|
import { type OAuthProviderProfile } from "./oauth-profiles.js";
|
|
8
8
|
export declare const oauthStateTtlMs: number;
|
|
9
|
+
/**
|
|
10
|
+
* Workspace-free landing for a callback whose state names no trustworthy
|
|
11
|
+
* workspace. The web app resolves it to the viewer's current workspace
|
|
12
|
+
* integrations page and keeps the callback outcome parameters.
|
|
13
|
+
*/
|
|
14
|
+
export declare const INTEGRATIONS_FALLBACK_PATH = "/integrations";
|
|
15
|
+
/** The web integrations page for one workspace (the Plugins surface). */
|
|
16
|
+
export declare function workspaceIntegrationsPath(workspaceId: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* The integrations page for a workspace id read from untrusted input (a URL
|
|
19
|
+
* parameter or an unverified-age state), or null unless it is a workspace UUID.
|
|
20
|
+
* A link target only: it grants nothing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function workspaceIntegrationsPathForUntrusted(candidate: unknown): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Where a callback returns, and why, when its own signed state is unusable.
|
|
25
|
+
*
|
|
26
|
+
* A correctly signed state still names its workspace, even when it is too old
|
|
27
|
+
* or its flow rejected it, so the browser returns to that workspace's
|
|
28
|
+
* integrations page; an aged one is reported as expired. Anything unsigned,
|
|
29
|
+
* tampered, or signed with another secret returns to
|
|
30
|
+
* {@link INTEGRATIONS_FALLBACK_PATH}. Display routing only: nothing here
|
|
31
|
+
* authorizes, resumes, or replays the callback.
|
|
32
|
+
*/
|
|
33
|
+
export declare function oauthStateFailureReturn(settings: Settings, rawState: string | undefined, nowMs?: number): {
|
|
34
|
+
returnPath: string;
|
|
35
|
+
reason: "state_expired" | "state_invalid";
|
|
36
|
+
};
|
|
9
37
|
export { OFFICIAL_GMAIL_MCP_SCOPES, OFFICIAL_GMAIL_MCP_URL, OFFICIAL_SLACK_MCP_URL, } from "./oauth-profiles.js";
|
|
10
38
|
export { OAUTH_MAX_RESPONSE_BYTES } from "@opengeni/network";
|
|
11
39
|
type OAuthClientDeps = {
|
|
@@ -160,6 +188,8 @@ export declare function isHostedSlackMcpTarget(providerDomain: string, mcpUrl: s
|
|
|
160
188
|
export declare function completeMcpOAuthCallback(deps: OAuthClientDeps, input: {
|
|
161
189
|
code?: string | undefined;
|
|
162
190
|
state?: string | undefined;
|
|
191
|
+
/** The provider's `error` parameter, for example `access_denied` on Cancel. */
|
|
192
|
+
error?: string | undefined;
|
|
163
193
|
requestUrl: string;
|
|
164
194
|
}): Promise<OAuthCallbackResult>;
|
|
165
195
|
export declare function integrationBaseUrl(publicBaseUrl: string | undefined, requestUrl: string): string;
|
|
@@ -4,6 +4,7 @@ import { type Database } from "@opengeni/db";
|
|
|
4
4
|
import { type FetchLike } from "@opengeni/network";
|
|
5
5
|
import { HTTPException } from "hono/http-exception";
|
|
6
6
|
export declare const SLACK_REACTION_IMAGE_MAX_BYTES: number;
|
|
7
|
+
export declare const SLACK_MCP_IMAGE_MAX_BYTES: number;
|
|
7
8
|
declare const SLACK_REACTION_CONTEXT_CHECKPOINT_VERSION = 1;
|
|
8
9
|
type SlackPayload = Record<string, unknown> & {
|
|
9
10
|
ok?: unknown;
|
|
@@ -680,7 +681,50 @@ export declare class OpenGeniSlackBotClient {
|
|
|
680
681
|
fileId: string;
|
|
681
682
|
parentFileId?: string;
|
|
682
683
|
offset?: number;
|
|
683
|
-
}): Promise<{
|
|
684
|
+
}): Promise<({
|
|
685
|
+
channel: {
|
|
686
|
+
id: string;
|
|
687
|
+
name: string;
|
|
688
|
+
isPrivate: boolean;
|
|
689
|
+
isMember: boolean;
|
|
690
|
+
isDirectMessage: boolean;
|
|
691
|
+
isMpim: boolean;
|
|
692
|
+
isArchived: boolean;
|
|
693
|
+
isShared: boolean;
|
|
694
|
+
isExternallyShared: boolean;
|
|
695
|
+
isOrgShared: boolean;
|
|
696
|
+
isPendingExternallyShared: boolean;
|
|
697
|
+
contextTeamId: string | null;
|
|
698
|
+
connectedTeamIds: string[] | null;
|
|
699
|
+
sharedTeamIds: string[] | null;
|
|
700
|
+
topic: string;
|
|
701
|
+
purpose: string;
|
|
702
|
+
numMembers: number | null;
|
|
703
|
+
};
|
|
704
|
+
file: {
|
|
705
|
+
id: string;
|
|
706
|
+
name: string;
|
|
707
|
+
title: string;
|
|
708
|
+
mimetype: string;
|
|
709
|
+
filetype: string;
|
|
710
|
+
mode: string;
|
|
711
|
+
size: number | null;
|
|
712
|
+
originatingHuddleId: string;
|
|
713
|
+
huddleTranscriptFileId: string;
|
|
714
|
+
};
|
|
715
|
+
image: Readonly<{
|
|
716
|
+
fileId: string;
|
|
717
|
+
filename: string;
|
|
718
|
+
contentType: "image/png" | "image/jpeg" | "image/webp";
|
|
719
|
+
bytes: Uint8Array;
|
|
720
|
+
}>;
|
|
721
|
+
contentType?: never;
|
|
722
|
+
offset?: never;
|
|
723
|
+
content?: never;
|
|
724
|
+
nextOffset?: never;
|
|
725
|
+
truncated?: never;
|
|
726
|
+
} | {
|
|
727
|
+
image?: never;
|
|
684
728
|
channel: {
|
|
685
729
|
id: string;
|
|
686
730
|
name: string;
|
|
@@ -716,7 +760,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
716
760
|
content: string;
|
|
717
761
|
nextOffset: number | null;
|
|
718
762
|
truncated: boolean;
|
|
719
|
-
} & {
|
|
763
|
+
}) & {
|
|
720
764
|
receipt: SlackBotReceipt;
|
|
721
765
|
}>;
|
|
722
766
|
/**
|
|
@@ -783,6 +827,8 @@ export declare class OpenGeniSlackBotClient {
|
|
|
783
827
|
private recordAudit;
|
|
784
828
|
private auditMetadata;
|
|
785
829
|
}
|
|
830
|
+
/** Full decode guards the model image block against header-only or corrupt files. */
|
|
831
|
+
export declare function validateSlackMcpImage(bytes: Uint8Array): Promise<void>;
|
|
786
832
|
export declare function createOpenGeniSlackBotClient(deps: {
|
|
787
833
|
db: Database;
|
|
788
834
|
settings: Settings;
|
|
@@ -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_enroll_token" | "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")[];
|
|
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_read" | "browser_screenshot" | "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_enroll_token" | "connected_machine_remove" | "custom_mcp_setup_request" | "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;
|
package/dist/mcp/documents.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
1
2
|
import type { DocumentServices } from "@opengeni/documents";
|
|
2
3
|
import { type KnowledgeContext, type Database } from "@opengeni/db";
|
|
3
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -5,4 +6,5 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
5
6
|
* chunk/base retrieval is retired: it cannot bypass pending Knowledge review. */
|
|
6
7
|
export declare function buildDocumentsMcpServer(db: Database, accountId: string, workspaceId: string, documentServices: DocumentServices, options: {
|
|
7
8
|
knowledge: KnowledgeContext;
|
|
9
|
+
settings?: Settings;
|
|
8
10
|
}): McpServer;
|
|
@@ -271,6 +271,14 @@ export declare const FIRST_PARTY_TOOL_AUTHORIZATION: {
|
|
|
271
271
|
sessionRequired: true;
|
|
272
272
|
allOf: "sessions:read"[];
|
|
273
273
|
};
|
|
274
|
+
browser_read: {
|
|
275
|
+
sessionRequired: true;
|
|
276
|
+
allOf: "sessions:read"[];
|
|
277
|
+
};
|
|
278
|
+
browser_screenshot: {
|
|
279
|
+
sessionRequired: true;
|
|
280
|
+
allOf: "sessions:read"[];
|
|
281
|
+
};
|
|
274
282
|
browser_act: {
|
|
275
283
|
sessionRequired: true;
|
|
276
284
|
allOf: "sessions:control"[];
|
|
@@ -351,6 +359,10 @@ export declare const FIRST_PARTY_TOOL_AUTHORIZATION: {
|
|
|
351
359
|
sessionRequired: true;
|
|
352
360
|
allOf: "workspace:read"[];
|
|
353
361
|
};
|
|
362
|
+
custom_mcp_setup_request: {
|
|
363
|
+
sessionRequired: true;
|
|
364
|
+
allOf: "workspace:read"[];
|
|
365
|
+
};
|
|
354
366
|
github_connect_link: {
|
|
355
367
|
allOf: "github:use"[];
|
|
356
368
|
};
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type AccessGrant, type GitHubRepository, type ResourceRef, type Session
|
|
|
2
2
|
import { listSessionDiscoverySummaries, type SessionDiscoveryCursor, type SessionDiscoveryOrderBy, type MemoryAgentScope } from "@opengeni/db";
|
|
3
3
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
4
|
import type { ApiRouteDeps } from "@opengeni/core";
|
|
5
|
+
import { type OpenGeniSlackBotClient } from "../integrations/slack-bot.js";
|
|
5
6
|
export type McpServerOptions = {
|
|
6
7
|
requestOrigin?: string | null;
|
|
7
8
|
workspaceMemoryEnabled?: boolean | undefined;
|
|
@@ -14,6 +15,40 @@ export type McpServerOptions = {
|
|
|
14
15
|
*/
|
|
15
16
|
sessionMemory?: MemoryAgentScope | null | undefined;
|
|
16
17
|
};
|
|
18
|
+
export declare function slackBotFileContentResult(result: Awaited<ReturnType<OpenGeniSlackBotClient["fileContent"]>>): {
|
|
19
|
+
content: {
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}[];
|
|
23
|
+
structuredContent: {
|
|
24
|
+
kind: "text";
|
|
25
|
+
fileId: string;
|
|
26
|
+
contentType: string;
|
|
27
|
+
content: string;
|
|
28
|
+
sizeBytes: null;
|
|
29
|
+
nextOffset: number | null;
|
|
30
|
+
};
|
|
31
|
+
} | {
|
|
32
|
+
structuredContent: {
|
|
33
|
+
kind: "image";
|
|
34
|
+
fileId: string;
|
|
35
|
+
contentType: "image/jpeg" | "image/png" | "image/webp";
|
|
36
|
+
content: null;
|
|
37
|
+
sizeBytes: number;
|
|
38
|
+
nextOffset: null;
|
|
39
|
+
};
|
|
40
|
+
content: ({
|
|
41
|
+
type: "text";
|
|
42
|
+
text: string;
|
|
43
|
+
mimeType?: never;
|
|
44
|
+
data?: never;
|
|
45
|
+
} | {
|
|
46
|
+
text?: never;
|
|
47
|
+
type: "image";
|
|
48
|
+
mimeType: "image/jpeg" | "image/png" | "image/webp";
|
|
49
|
+
data: string;
|
|
50
|
+
})[];
|
|
51
|
+
};
|
|
17
52
|
export declare function buildOpenGeniMcpServer(deps: ApiRouteDeps, grant: AccessGrant, options?: McpServerOptions): McpServer;
|
|
18
53
|
/** Only a prompt explicitly supplied through the human/API channel may redirect a user-paused goal. */
|
|
19
54
|
export declare function isHumanDirectedTurn(turn: {
|
package/dist/model-catalog.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ConfiguredModel } from "@opengeni/config";
|
|
2
|
-
import { ClientModel, type WorkspaceModelCatalogResponse as WorkspaceModelCatalogResponseType } from "@opengeni/contracts";
|
|
3
|
-
import { type WorkspaceModelSelectionInput } from "@opengeni/core";
|
|
2
|
+
import { ClientModel, type DefaultModelSelection, type WorkspaceModelCatalogResponse as WorkspaceModelCatalogResponseType } from "@opengeni/contracts";
|
|
3
|
+
import { type WorkspaceModelSelection, type WorkspaceModelSelectionInput } from "@opengeni/core";
|
|
4
4
|
export { MODEL_CREDENTIAL_READINESS_OBSERVATION_MAX_AGE_MS, type ModelAvailabilityObservation, type ModelCredentialReadinessObservation, } from "@opengeni/core";
|
|
5
5
|
/** Static, client-safe definition projection. No provider secret is reachable. */
|
|
6
6
|
export declare function projectClientModel(model: ConfiguredModel): ClientModel;
|
|
@@ -12,4 +12,10 @@ export declare function projectClientModel(model: ConfiguredModel): ClientModel;
|
|
|
12
12
|
* successful typed resolver observation; credential health and provider health
|
|
13
13
|
* are separate inputs and neither is fabricated.
|
|
14
14
|
*/
|
|
15
|
-
export declare function buildWorkspaceModelCatalog(input: WorkspaceModelSelectionInput): WorkspaceModelCatalogResponseType;
|
|
15
|
+
export declare function buildWorkspaceModelCatalog(input: WorkspaceModelSelectionInput, defaults?: WorkspaceModelCatalogDefaults): WorkspaceModelCatalogResponseType;
|
|
16
|
+
/** Resolved new-chat defaults published beside the catalog rows. */
|
|
17
|
+
export type WorkspaceModelCatalogDefaults = {
|
|
18
|
+
defaultSelection: DefaultModelSelection;
|
|
19
|
+
creditsSelection: DefaultModelSelection | null;
|
|
20
|
+
};
|
|
21
|
+
export declare function projectWorkspaceModelCatalog(selections: readonly WorkspaceModelSelection[], defaults?: WorkspaceModelCatalogDefaults): WorkspaceModelCatalogResponseType;
|
package/dist/observability.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EventBusOptions, type EventLogger } from "@opengeni/events";
|
|
2
2
|
import type { Observability } from "@opengeni/observability";
|
|
3
|
+
/** Logger plus the closed-label subscription-termination counter for NATS connections. */
|
|
4
|
+
export declare function observabilityEventBusOptions(observability: Observability): Pick<EventBusOptions, "logger" | "onSubscriptionTerminated">;
|
|
3
5
|
export declare function observabilityEventLogger(observability: Observability): EventLogger;
|
package/dist/routes/billing.d.ts
CHANGED
|
@@ -18,4 +18,31 @@ export declare function stripeBillingPortalSessionCreateParams(input: {
|
|
|
18
18
|
publicBaseUrl?: string | undefined;
|
|
19
19
|
returnUrl?: string | undefined;
|
|
20
20
|
}): Stripe.BillingPortal.SessionCreateParams;
|
|
21
|
+
export type StripeCheckoutCreditDecision = {
|
|
22
|
+
action: "grant";
|
|
23
|
+
credit: CheckoutCreditMetadata;
|
|
24
|
+
} | {
|
|
25
|
+
action: "ignore";
|
|
26
|
+
reason: "foreign_checkout" | "not_payment_mode" | "payment_not_paid";
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Decides whether a Checkout Session webhook grants OpenGeni credits.
|
|
30
|
+
*
|
|
31
|
+
* Sessions created outside OpenGeni on the same Stripe account carry no
|
|
32
|
+
* `opengeni_` metadata and are acknowledged without effect. An OpenGeni
|
|
33
|
+
* session with malformed credit metadata still throws so the failure stays
|
|
34
|
+
* visible. Credits are granted only once Stripe reports the payment `paid`:
|
|
35
|
+
* on `checkout.session.completed` for immediate methods, or on
|
|
36
|
+
* `checkout.session.async_payment_succeeded` for delayed methods, whose
|
|
37
|
+
* completion event arrives `unpaid`. Both events carry the same session
|
|
38
|
+
* metadata, so the ledger idempotency key grants at most once.
|
|
39
|
+
*/
|
|
40
|
+
export declare function stripeCheckoutCreditDecision(session: Stripe.Checkout.Session): StripeCheckoutCreditDecision;
|
|
41
|
+
export type CheckoutCreditMetadata = {
|
|
42
|
+
accountId: string;
|
|
43
|
+
amountMicros: number;
|
|
44
|
+
idempotencyKey: string;
|
|
45
|
+
amountUsd?: string;
|
|
46
|
+
packageId?: string;
|
|
47
|
+
};
|
|
21
48
|
export declare function stripeCustomerProvider(input: ApiRouteDeps | Stripe.Event): "stripe:live" | "stripe:test";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InteractionActor, type AccessGrant, type FileAsset } from "@opengeni/contracts";
|
|
2
2
|
import { type ApiRouteDeps, type ResolvedSessionAuthorization } from "@opengeni/core";
|
|
3
|
+
import { type BrowserControlScreenshotOptions, type BrowserControlFrame } from "@opengeni/runtime/sandbox";
|
|
3
4
|
import type { Hono } from "hono";
|
|
4
5
|
export declare function registerBrowserSessionRoutes(app: Hono, deps: ApiRouteDeps): void;
|
|
5
6
|
export declare function browserNeedsStandaloneDisplayStack(input: {
|
|
@@ -7,6 +8,8 @@ export declare function browserNeedsStandaloneDisplayStack(input: {
|
|
|
7
8
|
linkedComputer: boolean;
|
|
8
9
|
nativeBrowserControl: boolean;
|
|
9
10
|
}): boolean;
|
|
11
|
+
export declare function parseBrowserScreenshotOptions(query: URLSearchParams): BrowserControlScreenshotOptions;
|
|
12
|
+
export declare function browserScreenshotResponse(frame: Pick<BrowserControlFrame, "data" | "mediaType" | "metadataHeader">): Response;
|
|
10
13
|
export declare function interactionActorForGrant(grant: AccessGrant): ReturnType<typeof InteractionActor.parse>;
|
|
11
14
|
/** Resolve Drive authority from the same immutable session authorization that
|
|
12
15
|
* admitted the browser action. Agent-attempt subjects are technical worker
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import { CLIENT_ERROR_KINDS, CLIENT_ERROR_REPORT_MAX_BYTES, CLIENT_ERRORS_PATH, type ClientErrorKind } from "@opengeni/contracts/client-error-report";
|
|
3
|
+
import type { Observability } from "@opengeni/observability";
|
|
4
|
+
import type { Hono } from "hono";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
export { CLIENT_ERROR_KINDS, CLIENT_ERROR_REPORT_MAX_BYTES, CLIENT_ERRORS_PATH, type ClientErrorKind, };
|
|
7
|
+
export declare const ClientErrorReport: z.ZodObject<{
|
|
8
|
+
kind: z.ZodEnum<{
|
|
9
|
+
chunk_load: "chunk_load";
|
|
10
|
+
route_error: "route_error";
|
|
11
|
+
unhandled_rejection: "unhandled_rejection";
|
|
12
|
+
window_error: "window_error";
|
|
13
|
+
}>;
|
|
14
|
+
route: z.ZodString;
|
|
15
|
+
revision: z.ZodString;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export type ClientErrorReport = z.infer<typeof ClientErrorReport>;
|
|
18
|
+
export type ClientErrorAdmission = {
|
|
19
|
+
admit(kind: ClientErrorKind): boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* One token bucket per closed kind bounds counter inflation and log volume
|
|
23
|
+
* from any caller, including an anonymous one, without per-client state.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createClientErrorAdmission(options?: {
|
|
26
|
+
capacity?: number;
|
|
27
|
+
refillPerSecond?: number;
|
|
28
|
+
now?: () => number;
|
|
29
|
+
}): ClientErrorAdmission;
|
|
30
|
+
export declare function parseClientErrorReport(body: string | null): ClientErrorReport | null;
|
|
31
|
+
/**
|
|
32
|
+
* The exact beacon request. The app-wide request-body limit skips it because
|
|
33
|
+
* the route enforces its own 512-byte limit on the streamed body; the generic
|
|
34
|
+
* ceiling would otherwise buffer a chunked body of many megabytes on an
|
|
35
|
+
* anonymous route before this one could refuse it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isClientErrorReportRequest(method: string, pathname: string): boolean;
|
|
38
|
+
export declare function registerClientErrorRoutes(app: Hono, deps: {
|
|
39
|
+
observability: Observability;
|
|
40
|
+
settings: Pick<Settings, "corsAllowOriginRegex" | "publicBaseUrl" | "webBaseUrl">;
|
|
41
|
+
admission?: ClientErrorAdmission;
|
|
42
|
+
}): void;
|
|
@@ -11,6 +11,8 @@ type ComputerFrameCaptureClient = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function validateComputerFrameForApi(frame: Pick<ComputerControlFrame, "data" | "mediaType" | "metadataHeader">, expected: ExpectedComputerFrameEvidence): ComputerControlFrame;
|
|
13
13
|
export declare function captureModelComputerFrame(sessionClient: ComputerFrameCaptureClient, expected: ExpectedComputerFrameEvidence): Promise<ComputerControlFrame>;
|
|
14
|
+
/** One validated screen frame, served as sandboxed, non-embeddable user content. */
|
|
15
|
+
export declare function computerScreenshotResponse(frame: Pick<ComputerControlFrame, "data" | "mediaType" | "metadataHeader">): Response;
|
|
14
16
|
/** Public ComputerSession resource surface. Physical app/window authority stays
|
|
15
17
|
* in the same placement controller used by BrowserSession; this route owns only
|
|
16
18
|
* durable authorization, placement fencing, lifecycle receipts, and routing. */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GitHubInstallationBindingCandidate } from "@opengeni/contracts";
|
|
2
|
+
export declare function githubInstallationChooserHtml(candidates: GitHubInstallationBindingCandidate[], state: string, workspaceId: string, baseUrl: string): string;
|
|
3
|
+
export declare function githubSetupSuccessHtml(account: string, returnUrl: string): string;
|
|
4
|
+
export declare function githubSetupPendingHtml(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Why a GitHub browser step could not continue. Browser navigation (a stale
|
|
7
|
+
* page-load link, GitHub's Cancel button, a non-owner) must land on a readable
|
|
8
|
+
* page with a way back, never on a raw JSON error body.
|
|
9
|
+
*/
|
|
10
|
+
export type GitHubConnectFailure = "expired" | "cancelled" | "not_owner" | "forbidden" | "policy_denied" | "signed_out" | "failed";
|
|
11
|
+
export declare function githubConnectFailureHtml(failure: GitHubConnectFailure, returnUrl: string, detail?: string | null): string;
|
|
12
|
+
export declare function githubSuccessHtml(envLines: string[]): string;
|
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
import { type ApiRouteDeps, type WorkspaceInsightsFilterField } from "@opengeni/core";
|
|
2
2
|
import type { Hono } from "hono";
|
|
3
3
|
export declare function normalizeWorkspaceInsightsQueryFilter(value: string | null | undefined, field: WorkspaceInsightsFilterField): string | null;
|
|
4
|
+
/**
|
|
5
|
+
* Share one in-flight computation between identical concurrent callers.
|
|
6
|
+
*
|
|
7
|
+
* A reload, a second tab, or a retried fetch joins the rollup already running
|
|
8
|
+
* instead of starting another multi-second aggregate on the database.
|
|
9
|
+
* Authorization and filter validation still run per request before a caller
|
|
10
|
+
* may join; the map only ever holds running work. The caller supplies the
|
|
11
|
+
* complete sharing key, which must identify everything the result depends on.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createInFlightCoalescer<T>(): {
|
|
14
|
+
run: (key: string, work: () => Promise<T>) => Promise<T>;
|
|
15
|
+
readonly size: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Insights rows are filtered by the database RLS actor (private sessions are
|
|
19
|
+
* visible only to their owner), so two administrators of one workspace can
|
|
20
|
+
* legitimately receive different responses. The actor identity is part of
|
|
21
|
+
* the key; requests share work only when every visibility input is equal.
|
|
22
|
+
*/
|
|
23
|
+
export declare function workspaceInsightsCoalesceKey(input: {
|
|
24
|
+
workspaceId: string;
|
|
25
|
+
range: string;
|
|
26
|
+
provider: string | null;
|
|
27
|
+
model: string | null;
|
|
28
|
+
rlsActor: string | null;
|
|
29
|
+
}): string;
|
|
4
30
|
export declare function registerInsightsRoutes(app: Hono, deps: ApiRouteDeps): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LogThrottle } from "@opengeni/observability";
|
|
1
2
|
import { type NatsCalloutConfig, type Settings } from "@opengeni/config";
|
|
2
3
|
import { type Database } from "@opengeni/db";
|
|
3
4
|
import { type ResponderConnection } from "@opengeni/events";
|
|
@@ -11,7 +12,14 @@ export interface AuthCalloutDeps {
|
|
|
11
12
|
settings: Settings;
|
|
12
13
|
callout: NatsCalloutConfig;
|
|
13
14
|
observability?: Observability;
|
|
15
|
+
/** Bounds repeated denial warnings; defaults to one process-wide throttle. */
|
|
16
|
+
denialWarningThrottle?: LogThrottle;
|
|
14
17
|
}
|
|
18
|
+
/** A stale or revoked machine re-dials on its reconnect backoff forever, so an
|
|
19
|
+
* unthrottled denial warning repeats every few seconds per machine. Log each
|
|
20
|
+
* distinct machine's first denial, then at most once per interval with the
|
|
21
|
+
* count of denials it hid. The denial decision itself is never throttled. */
|
|
22
|
+
export declare const AUTH_CALLOUT_DENIAL_WARNING_INTERVAL_MS = 60000;
|
|
15
23
|
/**
|
|
16
24
|
* The pure validate→scoped-JWT decision, isolated from the NATS transport so it is
|
|
17
25
|
* unit-testable. Given the raw authorization-request JWT bytes, returns the signed
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SandboxFileArtifactReceipt, type AccessGrant, type Session } from "@opengeni/contracts";
|
|
2
2
|
import { type ApiRouteDeps, type AccessGrantAuthorization } from "@opengeni/core";
|
|
3
3
|
import { getFile } from "@opengeni/db";
|
|
4
|
+
import { type SandboxChannelAService } from "@opengeni/runtime/sandbox";
|
|
4
5
|
/** Original bytes inherit the already-authorized source session's ownership. */
|
|
5
6
|
export declare function publishSandboxFileArtifact(deps: ApiRouteDeps, input: Parameters<typeof publishSandboxFileArtifactInScope>[1]): Promise<SandboxFileArtifactReceipt>;
|
|
6
7
|
declare function publishSandboxFileArtifactInScope(deps: ApiRouteDeps, input: {
|
|
@@ -10,7 +11,22 @@ declare function publishSandboxFileArtifactInScope(deps: ApiRouteDeps, input: {
|
|
|
10
11
|
path: string;
|
|
11
12
|
signal?: AbortSignal | undefined;
|
|
12
13
|
}): Promise<SandboxFileArtifactReceipt>;
|
|
13
|
-
|
|
14
|
+
/** Use the root captured by the same fenced Channel-A service that reads bytes,
|
|
15
|
+
* not the session's placement-home label or a caller-supplied root. */
|
|
16
|
+
export declare function readSandboxArtifactFile(service: Pick<SandboxChannelAService, "capabilities" | "fsRead">, value: string, maxBytes: number): Promise<{
|
|
17
|
+
path: string;
|
|
18
|
+
sandboxPath: string;
|
|
19
|
+
read: {
|
|
20
|
+
path: string;
|
|
21
|
+
encoding: "base64" | "utf8";
|
|
22
|
+
content: string;
|
|
23
|
+
sizeBytes: number;
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
isBinary: boolean;
|
|
26
|
+
revision: number;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export declare function sandboxArtifactRelativePath(value: string, workspaceRoot?: string): string;
|
|
14
30
|
export declare function sandboxArtifactSafeFilename(filename: string): string;
|
|
15
31
|
export declare function sandboxFileContentType(filename: string): string;
|
|
16
32
|
export declare function sandboxArtifactIdentity(input: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/api-router",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2-canary.36199476632001",
|
|
4
4
|
"description": "OpenGeni HTTP surface: the Hono adapter/router (createApp), routes, MCP HTTP transport, and HTTP access adapters over @opengeni/core. An engine-distribution surface — its runtime closure includes engine-internal packages.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,24 +43,24 @@
|
|
|
43
43
|
"@hono/zod-validator": "^0.7.6",
|
|
44
44
|
"@llamaindex/liteparse": "2.14.2",
|
|
45
45
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
46
|
-
"@opengeni/agent-proto": "^0.6.0",
|
|
47
|
-
"@opengeni/artifact-tool": "^0.3.
|
|
48
|
-
"@opengeni/capabilities": "^0.3.4",
|
|
49
|
-
"@opengeni/codemode": "^0.6.
|
|
50
|
-
"@opengeni/codex": "^0.2.
|
|
51
|
-
"@opengeni/config": "^2.1.
|
|
52
|
-
"@opengeni/contracts": "^5.1.
|
|
53
|
-
"@opengeni/core": "^4.0.
|
|
54
|
-
"@opengeni/db": "^6.0.
|
|
55
|
-
"@opengeni/documents": "^0.8.
|
|
56
|
-
"@opengeni/events": "^0.4.
|
|
57
|
-
"@opengeni/github": "^0.7.
|
|
58
|
-
"@opengeni/network": "^0.3.1",
|
|
59
|
-
"@opengeni/observability": "^0.8.
|
|
60
|
-
"@opengeni/runtime": "^4.0.
|
|
61
|
-
"@opengeni/storage": "^0.2.
|
|
62
|
-
"@opengeni/tool-gateway": "^0.1.
|
|
63
|
-
"@opengeni/xai-subscription": "^0.1.4",
|
|
46
|
+
"@opengeni/agent-proto": "^0.6.0-canary.36199476632001",
|
|
47
|
+
"@opengeni/artifact-tool": "^0.3.32-canary.36199476632001",
|
|
48
|
+
"@opengeni/capabilities": "^0.3.4-canary.36199476632001",
|
|
49
|
+
"@opengeni/codemode": "^0.6.2-canary.36199476632001",
|
|
50
|
+
"@opengeni/codex": "^0.2.26-canary.36199476632001",
|
|
51
|
+
"@opengeni/config": "^2.1.1-canary.36199476632001",
|
|
52
|
+
"@opengeni/contracts": "^5.1.1-canary.36199476632001",
|
|
53
|
+
"@opengeni/core": "^4.0.3-canary.36199476632001",
|
|
54
|
+
"@opengeni/db": "^6.0.3-canary.36199476632001",
|
|
55
|
+
"@opengeni/documents": "^0.8.34-canary.36199476632001",
|
|
56
|
+
"@opengeni/events": "^0.4.32-canary.36199476632001",
|
|
57
|
+
"@opengeni/github": "^0.7.16-canary.36199476632001",
|
|
58
|
+
"@opengeni/network": "^0.3.1-canary.36199476632001",
|
|
59
|
+
"@opengeni/observability": "^0.8.32-canary.36199476632001",
|
|
60
|
+
"@opengeni/runtime": "^4.0.3-canary.36199476632001",
|
|
61
|
+
"@opengeni/storage": "^0.2.133-canary.36199476632001",
|
|
62
|
+
"@opengeni/tool-gateway": "^0.1.13-canary.36199476632001",
|
|
63
|
+
"@opengeni/xai-subscription": "^0.1.4-canary.36199476632001",
|
|
64
64
|
"@temporalio/client": "^1.17.0",
|
|
65
65
|
"better-auth": "^1.6.14",
|
|
66
66
|
"hono": "^4.12.18",
|