@opengeni/core 5.0.1 → 5.1.0-canary.36935312914001
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/access/index.d.ts +16 -1
- package/dist/application/external-workspace-members.d.ts +1 -1
- package/dist/dependencies.d.ts +9 -1
- package/dist/developer-setup-credential-ceiling.d.ts +10 -0
- package/dist/domain/automations.d.ts +8 -1
- package/dist/domain/knowledge-messages.d.ts +2 -2
- package/dist/domain/pr-review.d.ts +5 -2
- package/dist/domain/scheduled-tasks.d.ts +22 -1
- package/dist/domain/sessions.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +794 -380
- package/dist/index.js.map +1 -1
- package/dist/product-usage-metrics.d.ts +30 -0
- package/dist/user-presence.d.ts +32 -0
- package/package.json +12 -12
- package/src/access/index.ts +133 -4
- package/src/application/external-workspace-members.ts +3 -0
- package/src/dependencies.ts +9 -0
- package/src/developer-setup-credential-ceiling.ts +60 -0
- package/src/domain/automations.ts +75 -1
- package/src/domain/scheduled-tasks.ts +99 -15
- package/src/domain/sessions.ts +93 -47
- package/src/index.ts +2 -0
- package/src/product-usage-metrics.ts +101 -0
- package/src/user-presence.ts +134 -0
package/dist/access/index.d.ts
CHANGED
|
@@ -5,6 +5,19 @@ import { type Database } from "@opengeni/db";
|
|
|
5
5
|
import type { Context } from "hono";
|
|
6
6
|
import type { ManagedAuth } from "../managed-auth-type.js";
|
|
7
7
|
import type { ManagedAuthSessionAdapter } from "../managed-auth-session-sets.js";
|
|
8
|
+
import type { UserPresenceRecorder } from "../user-presence.js";
|
|
9
|
+
/** Only canonical authentication can prove setup-key provenance. */
|
|
10
|
+
export declare function isDeveloperSetupApiKeyContext(context: AccessContext): boolean;
|
|
11
|
+
/** Provenance from canonical raw-key or verified restricted-token authentication. */
|
|
12
|
+
export declare function isDeveloperSetupAuthorization(authorization: AccessGrantAuthorization | undefined): boolean;
|
|
13
|
+
/** Exact grant objects resolved under authenticated setup-only provenance. */
|
|
14
|
+
export declare function isDeveloperSetupGrant(grant: AccessGrant): boolean;
|
|
15
|
+
/** Setup-derived credentials cannot carry literal organization or key authority. */
|
|
16
|
+
export declare function isDeveloperSetupDelegatedPermissionAllowed(permission: Permission): boolean;
|
|
17
|
+
/** Canonical authentication provenance, including the backing key of asUser. */
|
|
18
|
+
export declare function requireApiKeyManagementContext(context: AccessContext): void;
|
|
19
|
+
/** Membership is not an escape hatch for minting durable credentials. */
|
|
20
|
+
export declare function requireApiKeyDelegationContext(context: AccessContext, permissions: Permission[]): void;
|
|
8
21
|
/** Creation audit only, never an authentication or delegation token. Metadata
|
|
9
22
|
* claiming to be external is insufficient; the exact resolver proof is needed. */
|
|
10
23
|
export declare function externalAttributionForAuthorization(authorization: AccessGrantAuthorization | undefined, grant: AccessGrant): ExternalActorAttribution | null;
|
|
@@ -24,7 +37,7 @@ export type AccountScopedApiKeyWorkspaceAuthority = Readonly<{
|
|
|
24
37
|
* shape alone is deliberately insufficient.
|
|
25
38
|
*/
|
|
26
39
|
export declare function accountScopedApiKeyWorkspaceAuthority(context: AccessContext): AccountScopedApiKeyWorkspaceAuthority | null;
|
|
27
|
-
/**
|
|
40
|
+
/** Classify stored scopes without changing the legacy full/read permission sets. */
|
|
28
41
|
export declare function organizationApiKeyAccess(permissions: Permission[]): OrganizationApiKeyAccess;
|
|
29
42
|
/**
|
|
30
43
|
* Opaque, request-local proof that the canonical access resolver authorized the
|
|
@@ -43,6 +56,8 @@ export type AccessDeps = {
|
|
|
43
56
|
settings: Settings;
|
|
44
57
|
managedAuth?: ManagedAuth | null;
|
|
45
58
|
managedAuthSessionAdapter?: ManagedAuthSessionAdapter | null;
|
|
59
|
+
/** Analytics only: notes canonical managed-cookie activity, never authority. */
|
|
60
|
+
userPresence?: UserPresenceRecorder | null;
|
|
46
61
|
};
|
|
47
62
|
/** null means this is not an authenticated external lane; [] means that lane
|
|
48
63
|
* has no readable inventory. Callers must not fall back from [] to service or
|
|
@@ -26,7 +26,7 @@ export declare function cancelExternalWorkspaceMemberGrantForRequest(c: Context,
|
|
|
26
26
|
export declare function updateExternalWorkspaceMemberForRequest(c: Context, deps: AccessDeps, organizationId: string, workspaceId: string, membershipId: string, input: unknown): Promise<{
|
|
27
27
|
subjectId: string;
|
|
28
28
|
organizationMembershipId: string;
|
|
29
|
-
permissions: ("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")[];
|
|
29
|
+
permissions: ("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" | "usage_allowances:manage" | "variable-sets:attach" | "variable-sets:list" | "variable-sets:manage" | "variable-sets:read" | "variable-sets:use" | "variable-sets:write" | "workspace:admin" | "workspace:create" | "workspace:read")[];
|
|
30
30
|
narrowed: boolean;
|
|
31
31
|
replay: boolean;
|
|
32
32
|
}>;
|
package/dist/dependencies.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Database, SessionWorkflowWakeDeliveryResult } from "@opengeni/db";
|
|
|
4
4
|
import type { DocumentServices } from "@opengeni/documents";
|
|
5
5
|
import type { EventBus } from "@opengeni/events";
|
|
6
6
|
import type { Observability } from "@opengeni/observability";
|
|
7
|
+
import type { UserPresenceRecorder } from "./user-presence.js";
|
|
7
8
|
import type { createObjectStorage } from "@opengeni/storage";
|
|
8
9
|
import type { ManagedAuth } from "./managed-auth-type.js";
|
|
9
10
|
import type { ManagedAuthSessionAdapter } from "./managed-auth-session-sets.js";
|
|
@@ -62,6 +63,8 @@ export type SessionWorkflowClient = {
|
|
|
62
63
|
agentRunUsageIdempotencyKey: string;
|
|
63
64
|
triggerWorkflowId: string;
|
|
64
65
|
initiator: TurnInitiator;
|
|
66
|
+
/** Server-frozen caller ceiling for this run, independent of task ownership. */
|
|
67
|
+
credentialRestriction?: "developer_setup";
|
|
65
68
|
triggerType?: Extract<ScheduledTaskTriggerType, "manual" | "initial" | "provider_event" | "retry" | "repair">;
|
|
66
69
|
}) => Promise<void>;
|
|
67
70
|
startRigVerification: (input: {
|
|
@@ -150,6 +153,11 @@ export type AppDependencies = {
|
|
|
150
153
|
documentIndexer?: DocumentIndexClient;
|
|
151
154
|
documentServices?: DocumentServices;
|
|
152
155
|
observability?: Observability;
|
|
156
|
+
/**
|
|
157
|
+
* Throttled server-side presence for canonical managed browser sessions
|
|
158
|
+
* (`createUserPresenceRecorder`). Analytics only; never an authorization input.
|
|
159
|
+
*/
|
|
160
|
+
userPresence?: UserPresenceRecorder | null;
|
|
153
161
|
readinessChecks?: Partial<Record<"db" | "nats" | "temporal", () => Promise<void> | void>>;
|
|
154
162
|
githubStateSecret?: string;
|
|
155
163
|
/**
|
|
@@ -231,7 +239,7 @@ export type ApiRouteDeps = AppDependencies & {
|
|
|
231
239
|
* the canonical admission path without constructing unrelated HTTP, document,
|
|
232
240
|
* or sandbox services. The public API still passes its `ApiRouteDeps` superset.
|
|
233
241
|
*/
|
|
234
|
-
export type AcceptSessionUserMessageDependencies = Pick<AppDependencies, "settings" | "catalogSourceSettings" | "db" | "bus" | "sessionAuthorization" | "schedulePromptPostCommit"> & {
|
|
242
|
+
export type AcceptSessionUserMessageDependencies = Pick<AppDependencies, "settings" | "catalogSourceSettings" | "db" | "bus" | "sessionAuthorization" | "schedulePromptPostCommit" | "observability"> & {
|
|
235
243
|
workflowClient: Pick<SessionWorkflowClient, "wakeSessionWorkflow">;
|
|
236
244
|
objectStorage: ObjectStorageDependency;
|
|
237
245
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AccessGrant, type Permission, type TurnExecutionPolicyV1 } from "@opengeni/contracts";
|
|
2
|
+
import { type AccessGrantAuthorization } from "./access/index.js";
|
|
3
|
+
/** The policy must be server-frozen, never supplied as request metadata. */
|
|
4
|
+
export declare function requireDeveloperSetupDelegatedPermissions(policy: TurnExecutionPolicyV1, permissions: readonly Permission[] | undefined): void;
|
|
5
|
+
/** Only pass server-owned persisted session/turn metadata, never request JSON. */
|
|
6
|
+
export declare function withDeveloperSetupCredentialRestriction(policy: TurnExecutionPolicyV1, source: {
|
|
7
|
+
grant?: AccessGrant;
|
|
8
|
+
authorization?: AccessGrantAuthorization | undefined;
|
|
9
|
+
trustedMetadata?: readonly unknown[];
|
|
10
|
+
}): TurnExecutionPolicyV1;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { AutomationAcceptedExecution, AutomationNormalizedEvent, AutomationSessionTemplate, type AutomationAdapterId, type AutomationSource, type AutomationTrigger } from "@opengeni/contracts";
|
|
1
|
+
import { AutomationAcceptedExecution, AutomationNormalizedEvent, AutomationSessionTemplate, type AccessGrant, type Permission, type AutomationAdapterId, type AutomationSource, type AutomationTrigger } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "@opengeni/db";
|
|
3
|
+
/** Canonical authenticated grant or exact server-owned originating policy only. */
|
|
4
|
+
export declare function automationCredentialRestrictionForGrant(db: Database, grant: AccessGrant): Promise<AutomationSessionTemplate["credentialRestriction"]>;
|
|
5
|
+
/** Explicit delegated scopes must stay within the frozen setup ceiling. */
|
|
6
|
+
export declare function requireAutomationCredentialRestrictionPermissions(restriction: AutomationSessionTemplate["credentialRestriction"], permissions: readonly Permission[]): void;
|
|
2
7
|
export type AutomationAdapterRenderResult = {
|
|
3
8
|
initialMessage: string;
|
|
4
9
|
sessionTemplate: AutomationSessionTemplate;
|
|
@@ -48,4 +53,6 @@ export declare function buildAutomationAcceptedExecution(input: {
|
|
|
48
53
|
eventId: string;
|
|
49
54
|
event: AutomationNormalizedEvent;
|
|
50
55
|
render: AutomationAdapterRenderResult;
|
|
56
|
+
/** Trusted caller restriction from the immutable stored event, not adapter JSON. */
|
|
57
|
+
credentialRestriction?: "developer_setup";
|
|
51
58
|
}): AutomationAcceptedExecution;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type Database, type KnowledgeContext } from "@opengeni/db";
|
|
2
2
|
/** Retain actual message bytes, never a model-authored reconstruction of a confirmation. */
|
|
3
3
|
export declare function retainKnowledgeMessage(db: Database, context: KnowledgeContext, messageId?: string): Promise<{
|
|
4
|
+
revisionId?: never;
|
|
4
5
|
retained: boolean;
|
|
5
6
|
reason: string;
|
|
6
7
|
entryId?: never;
|
|
7
|
-
revisionId?: never;
|
|
8
8
|
outcome?: never;
|
|
9
9
|
messageId?: never;
|
|
10
10
|
reused?: never;
|
|
11
11
|
} | {
|
|
12
|
+
revisionId?: never;
|
|
12
13
|
retained: boolean;
|
|
13
14
|
reason: string;
|
|
14
15
|
entryId: string;
|
|
15
|
-
revisionId?: never;
|
|
16
16
|
outcome?: never;
|
|
17
17
|
messageId?: never;
|
|
18
18
|
reused?: never;
|
|
@@ -49,7 +49,7 @@ export declare const PR_REVIEW_AUTOMATION_SETUP: {
|
|
|
49
49
|
optional?: boolean | undefined;
|
|
50
50
|
}[];
|
|
51
51
|
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_model" | "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_prepare_message" | "slack_bot_search" | "slack_bot_send_prepared_message" | "slack_bot_thread_replies" | "slack_bot_upload_file" | "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")[];
|
|
52
|
-
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")[];
|
|
52
|
+
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" | "usage_allowances:manage" | "variable-sets:attach" | "variable-sets:list" | "variable-sets:manage" | "variable-sets:read" | "variable-sets:use" | "variable-sets:write" | "workspace:admin" | "workspace:create" | "workspace:read")[];
|
|
53
53
|
model: string | null;
|
|
54
54
|
reasoningEffort: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | null;
|
|
55
55
|
sandboxBackend: "blaxel" | "cloudflare" | "daytona" | "docker" | "e2b" | "local" | "modal" | "none" | "opensandbox" | "runloop" | "selfhosted" | "vercel" | null;
|
|
@@ -76,6 +76,7 @@ export declare const PR_REVIEW_AUTOMATION_SETUP: {
|
|
|
76
76
|
instructions?: string | undefined;
|
|
77
77
|
renderer?: "markdown" | "opengeni" | undefined;
|
|
78
78
|
} | undefined;
|
|
79
|
+
credentialRestriction?: "developer_setup" | undefined;
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
82
|
export declare const prReviewAutomationAdapter: {
|
|
@@ -102,6 +103,7 @@ export declare const prReviewAutomationAdapter: {
|
|
|
102
103
|
subject: string | null;
|
|
103
104
|
resource: string | null;
|
|
104
105
|
payload: Record<string, unknown>;
|
|
106
|
+
credentialRestriction?: "developer_setup" | undefined;
|
|
105
107
|
};
|
|
106
108
|
validateSourceConfiguration: (configuration: Record<string, unknown>) => void;
|
|
107
109
|
validateTriggerConfiguration: (configuration: Record<string, unknown>) => void;
|
|
@@ -158,7 +160,7 @@ export declare const prReviewAutomationAdapter: {
|
|
|
158
160
|
optional?: boolean | undefined;
|
|
159
161
|
}[];
|
|
160
162
|
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_model" | "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_prepare_message" | "slack_bot_search" | "slack_bot_send_prepared_message" | "slack_bot_thread_replies" | "slack_bot_upload_file" | "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")[];
|
|
161
|
-
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")[];
|
|
163
|
+
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" | "usage_allowances:manage" | "variable-sets:attach" | "variable-sets:list" | "variable-sets:manage" | "variable-sets:read" | "variable-sets:use" | "variable-sets:write" | "workspace:admin" | "workspace:create" | "workspace:read")[];
|
|
162
164
|
model: string | null;
|
|
163
165
|
reasoningEffort: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | null;
|
|
164
166
|
sandboxBackend: "blaxel" | "cloudflare" | "daytona" | "docker" | "e2b" | "local" | "modal" | "none" | "opensandbox" | "runloop" | "selfhosted" | "vercel" | null;
|
|
@@ -185,6 +187,7 @@ export declare const prReviewAutomationAdapter: {
|
|
|
185
187
|
instructions?: string | undefined;
|
|
186
188
|
renderer?: "markdown" | "opengeni" | undefined;
|
|
187
189
|
} | undefined;
|
|
190
|
+
credentialRestriction?: "developer_setup" | undefined;
|
|
188
191
|
};
|
|
189
192
|
provenance: {
|
|
190
193
|
provider: "azure_devops" | "github" | "gitlab";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
2
|
import type { AccessGrant, ScheduledTask, ScheduledTaskAgentConfig, Session, ToolRef, SessionAuthorizationPort, SessionAuthorizationSurface, CreateScheduledTaskRequest as CreateScheduledTaskPayload, UpdateScheduledTaskRequest as UpdateScheduledTaskPayload } from "@opengeni/contracts";
|
|
3
|
-
import { type KnowledgeContext, type Database, type TemporalScheduleCleanupClaim, type UpdateScheduledTaskInput } from "@opengeni/db";
|
|
3
|
+
import { type KnowledgeContext, type Database, type ScheduledTaskCreatorPolicy, type SessionCommandActor, type TemporalScheduleCleanupClaim, type UpdateScheduledTaskInput } from "@opengeni/db";
|
|
4
4
|
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
5
5
|
import type { SessionWorkflowClient } from "../dependencies.js";
|
|
6
6
|
import type { ObjectStorageDependency } from "../dependencies.js";
|
|
@@ -33,6 +33,27 @@ export declare function createValidatedScheduledTask(input: {
|
|
|
33
33
|
/** Proves the bot may post in a newly chosen task Slack channel. */
|
|
34
34
|
verifySlackChannel?: ScheduledTaskSlackChannelVerifier | undefined;
|
|
35
35
|
}): Promise<ScheduledTask>;
|
|
36
|
+
/**
|
|
37
|
+
* Freeze authenticated credential restrictions for every creation lane, and
|
|
38
|
+
* the creating session's boundary onto an agent-created task so the
|
|
39
|
+
* sessions generated for it inherit exactly what the creator could see and
|
|
40
|
+
* do, never the deployment default. Tools are the session's effective
|
|
41
|
+
* model-visible selection under the deployment ceiling; permissions are the
|
|
42
|
+
* session's effective first-party set intersected with what the calling
|
|
43
|
+
* grant actually holds (a narrowly delegated spawn token cannot hand a
|
|
44
|
+
* schedule more than itself). The session access policy is copied from the
|
|
45
|
+
* projection when it exposes those facts; each absent fact is stored as null
|
|
46
|
+
* so a generated session keeps its own default for that key.
|
|
47
|
+
*/
|
|
48
|
+
export declare function frozenScheduledTaskCreatorPolicy(input: {
|
|
49
|
+
db: Database;
|
|
50
|
+
settings: Settings;
|
|
51
|
+
grant: AccessGrant;
|
|
52
|
+
authorization?: AccessGrantAuthorization | undefined;
|
|
53
|
+
actor: Extract<SessionCommandActor, {
|
|
54
|
+
type: "agent_attempt";
|
|
55
|
+
}> | null;
|
|
56
|
+
}): Promise<ScheduledTaskCreatorPolicy | null>;
|
|
36
57
|
/**
|
|
37
58
|
* Scheduled-task authority writes fail closed inside SECURITY DEFINER seams
|
|
38
59
|
* (42501): a non-human writer delegating resources, an authorizer without
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SessionRetryRequest, SessionRetryResponse, SessionTurnSurface } from "@opengeni/contracts";
|
|
2
|
+
import { type ProductUsageMetricsSink } from "../product-usage-metrics.js";
|
|
2
3
|
import { type Settings } from "@opengeni/config";
|
|
3
4
|
import type { CodeSearchDeploymentPolicy } from "@opengeni/contracts/code-search";
|
|
4
5
|
import { type AgentConfigCreator, type ResolvedAgentConfig, type UpdateSessionAgentRequest } from "@opengeni/contracts";
|
|
@@ -139,6 +140,11 @@ export declare function createAndStartSessionWithOutcome(input: {
|
|
|
139
140
|
initialMessage: string;
|
|
140
141
|
/** Content-free product surface the create request entered through. */
|
|
141
142
|
surface?: SessionTurnSurface | null;
|
|
143
|
+
/**
|
|
144
|
+
* Live product usage counters: a newly created session (never a replay)
|
|
145
|
+
* counts once, and its initial user message once unless deferred.
|
|
146
|
+
*/
|
|
147
|
+
metrics?: ProductUsageMetricsSink | null;
|
|
142
148
|
/** Create the session shell without an initial user event/agent turn. */
|
|
143
149
|
deferInitialTurn?: boolean;
|
|
144
150
|
modelContext?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from "./domain/knowledge.js";
|
|
|
7
7
|
export * from "./domain/knowledge-search.js";
|
|
8
8
|
export * from "./dependencies.js";
|
|
9
9
|
export * from "./workflow-wake-contract.js";
|
|
10
|
+
export * from "./user-presence.js";
|
|
11
|
+
export * from "./product-usage-metrics.js";
|
|
10
12
|
export * from "./sandbox-types.js";
|
|
11
13
|
export * from "./managed-auth-type.js";
|
|
12
14
|
export { getManagedAuthRequestActorAbortSignal, getManagedAuthRequestActorAdmissionStamp, getManagedAuthRequestActorEpoch, getManagedAuthRequestActorLeaseStamp, getManagedSession, configureManagedUserAdmission, assertManagedUserAdmission, ManagedAuthActorLeaseOutcomeUnknownError, markManagedAuthRequestActorTransitionApplied, releaseManagedAuthRequestActorLease, validateManagedAuthRequestActorLease, type ManagedAuthActorAdmissionStamp, type ManagedAuthActorMutationLeaseStamp, } from "./managed-session.js";
|