@opengeni/core 0.28.0 → 1.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/README.md +1 -1
- package/dist/access/external-actor-authority.d.ts +47 -0
- package/dist/access/index.d.ts +182 -3
- package/dist/access/service-initiator.d.ts +3 -0
- package/dist/application/api-integration-servers.d.ts +20 -0
- package/dist/application/archived-session-imports.d.ts +6 -0
- package/dist/application/composer-submit.d.ts +24 -0
- package/dist/application/connect-authority.d.ts +13 -0
- package/dist/application/connect-operation.d.ts +31 -0
- package/dist/application/external-continuation.d.ts +15 -0
- package/dist/application/external-identity-lifecycle.d.ts +20 -0
- package/dist/application/external-link-work-admission.d.ts +12 -0
- package/dist/application/external-workspace-members.d.ts +34 -0
- package/dist/application/modal-native-worker-host-transport.d.ts +297 -0
- package/dist/application/new-session-drafts.d.ts +39 -2
- package/dist/application/sandbox-recovery.d.ts +58 -0
- package/dist/application/session-commands.d.ts +26 -13
- package/dist/application/session-mcp-credential-rotation.d.ts +29 -0
- package/dist/application/session-tenancy.d.ts +19 -0
- package/dist/application/user-resource-grants.d.ts +20 -0
- package/dist/billing/limits.d.ts +11 -0
- package/dist/canonical-human-identities.d.ts +7 -2
- package/dist/canonical-human-identities.js +17 -4
- package/dist/canonical-human-identities.js.map +1 -1
- package/dist/{chunk-6WKPWE5S.js → chunk-2MKMRGSY.js} +108 -24
- package/dist/chunk-2MKMRGSY.js.map +1 -0
- package/dist/{chunk-NYPMQ7NO.js → chunk-GVO3N37G.js} +205 -37
- package/dist/chunk-GVO3N37G.js.map +1 -0
- package/dist/{chunk-JJU6I5XD.js → chunk-LCQXNR62.js} +36 -10
- package/dist/chunk-LCQXNR62.js.map +1 -0
- package/dist/chunk-MM6N7CTO.js +387 -0
- package/dist/chunk-MM6N7CTO.js.map +1 -0
- package/dist/chunk-QO5GVFFO.js +235 -0
- package/dist/chunk-QO5GVFFO.js.map +1 -0
- package/dist/codex-model-availability.d.ts +14 -0
- package/dist/default-session-model.d.ts +139 -0
- package/dist/dependencies.d.ts +87 -4
- package/dist/developer-setup-credential-ceiling.d.ts +10 -0
- package/dist/domain/agent-config-resolution.d.ts +49 -0
- package/dist/domain/automations.d.ts +58 -0
- package/dist/domain/capabilities.d.ts +22 -4
- package/dist/domain/company-profile-agent-admin.d.ts +25 -0
- package/dist/domain/connection-account-selection-error.d.ts +8 -0
- package/dist/domain/connector-tool-permissions.d.ts +36 -0
- package/dist/domain/direct-model-provider.d.ts +3 -0
- package/dist/domain/editable-artifacts/agent-application.d.ts +10 -1
- package/dist/domain/editable-artifacts/durable-export.d.ts +22 -1
- package/dist/domain/editable-artifacts/ports.d.ts +10 -0
- package/dist/domain/editable-artifacts/service.d.ts +4 -3
- package/dist/domain/environments.d.ts +5 -9
- package/dist/domain/external-creation-attribution.d.ts +6 -0
- package/dist/domain/file-owner.d.ts +8 -0
- package/dist/domain/github-action-policies.d.ts +36 -0
- package/dist/domain/github-repository-bindings.d.ts +117 -0
- package/dist/domain/github-skill-source.d.ts +5 -0
- package/dist/domain/governed-learning-slack-publication.d.ts +45 -0
- package/dist/domain/insights-timing.d.ts +16 -0
- package/dist/domain/insights-usage.d.ts +27 -0
- package/dist/domain/insights.d.ts +28 -1
- package/dist/domain/knowledge-files.d.ts +20 -0
- package/dist/domain/knowledge-messages.d.ts +39 -0
- package/dist/domain/knowledge-messages.test.d.ts +1 -0
- package/dist/domain/knowledge-preparation.d.ts +10 -0
- package/dist/domain/knowledge-preparation.test.d.ts +1 -0
- package/dist/domain/knowledge-search.d.ts +15 -0
- package/dist/domain/knowledge-search.test.d.ts +1 -0
- package/dist/domain/knowledge.d.ts +9 -0
- package/dist/domain/mcp-account-bindings.d.ts +19 -0
- package/dist/domain/mcp-account-routes.d.ts +21 -0
- package/dist/domain/native-mcp-connection-admission.d.ts +3 -0
- package/dist/domain/organization-integration-catalog.d.ts +15 -0
- package/dist/domain/organization-membership-lifecycle.d.ts +1 -0
- package/dist/domain/personal-connection-delegations.d.ts +87 -4
- package/dist/domain/pr-review.d.ts +249 -0
- package/dist/domain/resources.d.ts +24 -3
- package/dist/domain/scheduled-task-access.d.ts +247 -0
- package/dist/domain/scheduled-tasks.d.ts +103 -6
- package/dist/domain/session-connection-accounts.d.ts +16 -0
- package/dist/domain/session-file-access.d.ts +4 -0
- package/dist/domain/session-native-connection-replacement.d.ts +14 -0
- package/dist/domain/session-start-timing.d.ts +7 -0
- package/dist/domain/session-tool-policy.d.ts +93 -4
- package/dist/domain/sessions.d.ts +275 -28
- package/dist/domain/skill-imports.d.ts +1 -0
- package/dist/domain/skill-search.d.ts +30 -0
- package/dist/domain/skills.d.ts +117 -0
- package/dist/domain/slack-bot.d.ts +46 -1
- package/dist/domain/workspace-members.d.ts +8 -1
- package/dist/editable-artifact-live/application.d.ts +12 -3
- package/dist/editable-artifact-live/ports.d.ts +0 -1
- package/dist/editable-artifact-live/server.d.ts +5 -2
- package/dist/editable-artifact-live/ticket.d.ts +2 -2
- package/dist/editable-artifact-live/types.d.ts +14 -2
- package/dist/editable-artifact-live.js +2 -2
- package/dist/editable-artifacts.js +10 -4
- package/dist/index.d.ts +49 -3
- package/dist/index.js +18826 -6847
- package/dist/index.js.map +1 -1
- package/dist/managed-auth-session-sets.d.ts +131 -0
- package/dist/managed-auth-session-sets.js +51 -0
- package/dist/managed-auth-session-sets.js.map +1 -0
- package/dist/managed-session.d.ts +98 -11
- package/dist/model-catalog.d.ts +117 -0
- package/dist/product-usage-metrics.d.ts +30 -0
- package/dist/rigs/index.d.ts +22 -5
- package/dist/rigs/provider-images.d.ts +1 -1
- package/dist/sandbox/fleet.d.ts +59 -10
- package/dist/sandbox/routing.d.ts +22 -2
- package/dist/sandbox/runtime-settings.d.ts +56 -0
- package/dist/session-authorization.d.ts +38 -1
- package/dist/site-session-origin.d.ts +9 -0
- package/dist/transcription.d.ts +12 -1
- package/dist/turn-surface.d.ts +18 -0
- package/dist/user-presence.d.ts +32 -0
- package/package.json +18 -11
- package/src/access/external-actor-authority.ts +94 -0
- package/src/access/index.ts +1386 -44
- package/src/access/service-initiator.ts +50 -0
- package/src/application/api-integration-servers.ts +215 -0
- package/src/application/archived-session-imports.ts +161 -0
- package/src/application/composer-submit.ts +77 -0
- package/src/application/connect-authority.ts +77 -0
- package/src/application/connect-operation.ts +80 -0
- package/src/application/external-continuation.ts +129 -0
- package/src/application/external-identity-lifecycle.ts +48 -0
- package/src/application/external-link-work-admission.ts +90 -0
- package/src/application/external-workspace-members.ts +232 -0
- package/src/application/modal-native-worker-host-transport.ts +263 -0
- package/src/application/new-session-drafts.ts +222 -29
- package/src/application/sandbox-recovery.ts +78 -0
- package/src/application/session-commands.ts +430 -73
- package/src/application/session-mcp-credential-rotation.ts +217 -0
- package/src/application/session-tenancy.ts +445 -0
- package/src/application/user-resource-grants.ts +154 -0
- package/src/billing/limits.ts +103 -24
- package/src/canonical-human-identities.ts +22 -3
- package/src/codex-model-availability.ts +136 -0
- package/src/default-session-model.ts +656 -0
- package/src/dependencies.ts +97 -5
- package/src/developer-setup-credential-ceiling.ts +60 -0
- package/src/domain/agent-config-resolution.ts +148 -0
- package/src/domain/automations.ts +270 -0
- package/src/domain/capabilities.ts +244 -151
- package/src/domain/company-profile-agent-admin.ts +56 -0
- package/src/domain/connection-account-selection-error.ts +19 -0
- package/src/domain/connector-tool-permissions.ts +371 -0
- package/src/domain/direct-model-provider.ts +62 -0
- package/src/domain/editable-artifacts/agent-application.ts +61 -15
- package/src/domain/editable-artifacts/durable-export.ts +100 -5
- package/src/domain/editable-artifacts/in-memory.ts +6 -0
- package/src/domain/editable-artifacts/ports.ts +11 -0
- package/src/domain/editable-artifacts/service.ts +32 -1
- package/src/domain/editable-artifacts/snapshot-compaction.ts +9 -5
- package/src/domain/editable-artifacts/snapshot-verifier-genesis.ts +10 -8
- package/src/domain/editable-artifacts/snapshot-verifier.ts +10 -3
- package/src/domain/environments.ts +25 -45
- package/src/domain/external-creation-attribution.ts +22 -0
- package/src/domain/file-owner.ts +67 -0
- package/src/domain/github-action-policies.ts +169 -0
- package/src/domain/github-repository-bindings.ts +295 -0
- package/src/domain/github-skill-source.ts +233 -0
- package/src/domain/governed-learning-slack-publication.ts +157 -0
- package/src/domain/insights-timing.ts +95 -0
- package/src/domain/insights-usage.ts +67 -0
- package/src/domain/insights.ts +270 -169
- package/src/domain/knowledge-files.ts +46 -0
- package/src/domain/knowledge-messages.test.ts +91 -0
- package/src/domain/knowledge-messages.ts +106 -0
- package/src/domain/knowledge-preparation.test.ts +276 -0
- package/src/domain/knowledge-preparation.ts +147 -0
- package/src/domain/knowledge-search.test.ts +561 -0
- package/src/domain/knowledge-search.ts +256 -0
- package/src/domain/knowledge.ts +133 -0
- package/src/domain/mcp-account-bindings.ts +171 -0
- package/src/domain/mcp-account-routes.ts +121 -0
- package/src/domain/native-mcp-connection-admission.ts +14 -0
- package/src/domain/organization-integration-catalog.ts +88 -0
- package/src/domain/organization-membership-lifecycle.ts +10 -0
- package/src/domain/personal-connection-delegations.ts +758 -115
- package/src/domain/pr-review.ts +687 -0
- package/src/domain/resources.ts +182 -25
- package/src/domain/scheduled-task-access.ts +1052 -0
- package/src/domain/scheduled-tasks.ts +1952 -215
- package/src/domain/session-connection-accounts.ts +67 -0
- package/src/domain/session-file-access.ts +47 -0
- package/src/domain/session-native-connection-replacement.ts +64 -0
- package/src/domain/session-start-timing.ts +55 -0
- package/src/domain/session-tool-policy.ts +443 -19
- package/src/domain/sessions.ts +3417 -619
- package/src/domain/skill-imports.ts +137 -17
- package/src/domain/skill-search.ts +221 -0
- package/src/domain/skills.ts +104 -0
- package/src/domain/slack-bot.ts +128 -3
- package/src/domain/workspace-members.ts +34 -2
- package/src/editable-artifact-live/application.ts +29 -4
- package/src/editable-artifact-live/ports.ts +0 -1
- package/src/editable-artifact-live/server.ts +167 -13
- package/src/editable-artifact-live/ticket.ts +87 -6
- package/src/editable-artifact-live/types.ts +16 -2
- package/src/editable-artifact-live/wire.ts +0 -10
- package/src/index.ts +69 -4
- package/src/managed-auth-session-sets.ts +371 -0
- package/src/managed-session.ts +520 -2
- package/src/model-catalog.ts +873 -0
- package/src/product-usage-metrics.ts +101 -0
- package/src/rigs/index.ts +179 -63
- package/src/rigs/provider-images.ts +2 -3
- package/src/sandbox/fleet.ts +471 -59
- package/src/sandbox/routing.ts +160 -33
- package/src/sandbox/runtime-settings.ts +281 -0
- package/src/session-authorization.ts +262 -78
- package/src/site-session-origin.ts +22 -0
- package/src/transcription.ts +13 -1
- package/src/turn-surface.ts +45 -0
- package/src/user-presence.ts +134 -0
- package/dist/chunk-6WKPWE5S.js.map +0 -1
- package/dist/chunk-IBOEYG6N.js +0 -34
- package/dist/chunk-IBOEYG6N.js.map +0 -1
- package/dist/chunk-JJU6I5XD.js.map +0 -1
- package/dist/chunk-NYPMQ7NO.js.map +0 -1
- package/dist/domain/durable-learning-slack-publication.d.ts +0 -72
- package/dist/domain/packs.d.ts +0 -55
- package/src/domain/durable-learning-slack-publication.ts +0 -202
- package/src/domain/packs.ts +0 -556
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { AccessGrant,
|
|
3
|
-
import { type Database, type UpdateScheduledTaskInput } from "@opengeni/db";
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
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 ScheduledTaskCreatorPolicy, type SessionCommandActor, type TemporalScheduleCleanupClaim, type UpdateScheduledTaskInput } from "@opengeni/db";
|
|
4
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
4
5
|
import type { SessionWorkflowClient } from "../dependencies.js";
|
|
5
6
|
import type { ObjectStorageDependency } from "../dependencies.js";
|
|
7
|
+
import { type ScheduledTaskSlackChannelVerifier } from "./slack-bot.js";
|
|
6
8
|
/**
|
|
7
9
|
* Whether a raw scheduled-task payload explicitly set agentConfig.tools.
|
|
8
10
|
* Zod's `.default([])` erases the distinction between "absent" and
|
|
@@ -12,17 +14,61 @@ import type { ObjectStorageDependency } from "../dependencies.js";
|
|
|
12
14
|
* verbatim.
|
|
13
15
|
*/
|
|
14
16
|
export declare function scheduledTaskToolsProvided(rawPayload: unknown): boolean;
|
|
17
|
+
/** Resolve the target's current tool policy before choosing its owner's accounts. */
|
|
18
|
+
export declare function scheduledConnectionTools(db: Database, workspaceId: string, settings: Settings, target: Session | null, taskTools: ToolRef[], subjectId?: string): Promise<ToolRef[]>;
|
|
19
|
+
export declare function scheduledConnectionSurfaceEligibility(settings: Settings, target: Pick<Session, "firstPartyMcpTools" | "firstPartyMcpPermissions"> | null): {
|
|
20
|
+
googleDrivePublicationEnabled: boolean;
|
|
21
|
+
atlassianEnabled: boolean;
|
|
22
|
+
};
|
|
15
23
|
export declare function createValidatedScheduledTask(input: {
|
|
16
24
|
settings: Settings;
|
|
17
25
|
db: Database;
|
|
18
26
|
objectStorage: ObjectStorageDependency;
|
|
19
27
|
grant: AccessGrant;
|
|
28
|
+
authorization?: AccessGrantAuthorization;
|
|
20
29
|
payload: CreateScheduledTaskPayload;
|
|
21
30
|
toolsProvided?: boolean;
|
|
22
|
-
variableSetPreauthorized?: boolean;
|
|
23
31
|
sessionAuthorization?: SessionAuthorizationPort | null | undefined;
|
|
24
32
|
authorizationSurface?: SessionAuthorizationSurface | undefined;
|
|
33
|
+
/** Proves the bot may post in a newly chosen task Slack channel. */
|
|
34
|
+
verifySlackChannel?: ScheduledTaskSlackChannelVerifier | undefined;
|
|
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>;
|
|
57
|
+
/**
|
|
58
|
+
* Scheduled-task authority writes fail closed inside SECURITY DEFINER seams
|
|
59
|
+
* (42501): a non-human writer delegating resources, an authorizer without
|
|
60
|
+
* active workspace membership, or a foreign human retaining another subject's
|
|
61
|
+
* grants. Those are caller-resolvable conflicts, not server faults.
|
|
62
|
+
*/
|
|
63
|
+
export declare function withScheduledTaskAuthorityWriteErrors<T>(run: () => Promise<T>): Promise<T>;
|
|
64
|
+
/** API/MCP-facing update that maps authority-write denials to 409. */
|
|
65
|
+
export declare function updateScheduledTaskForApi(db: Database, grant: AccessGrant, taskId: string, update: UpdateScheduledTaskInput, learning?: {
|
|
66
|
+
authorization: AccessGrantAuthorization;
|
|
67
|
+
request: NonNullable<UpdateScheduledTaskPayload["agentLearning"]>;
|
|
68
|
+
restoreState: ScheduledTaskRestoreState;
|
|
25
69
|
}): Promise<ScheduledTask>;
|
|
70
|
+
export declare function assertScheduledTaskMutationOwner(db: Database, grant: AccessGrant, taskId: string): Promise<void>;
|
|
71
|
+
export declare function triggerScheduledTaskForGrant(db: Database, grant: AccessGrant, workflowClient: SessionWorkflowClient, input: Parameters<SessionWorkflowClient["triggerScheduledTask"]>[0]): Promise<void>;
|
|
26
72
|
export declare function validateScheduledTaskTarget(input: {
|
|
27
73
|
db: Database;
|
|
28
74
|
sessionAuthorization?: SessionAuthorizationPort | null | undefined;
|
|
@@ -34,34 +80,78 @@ export declare function validateScheduledTaskTarget(input: {
|
|
|
34
80
|
rigId: string | null | undefined;
|
|
35
81
|
agentConfig: ScheduledTaskAgentConfig;
|
|
36
82
|
missingTargetStatus?: 404 | 422;
|
|
83
|
+
/** Leaving a cancelled chat still requires control, but not revivability. */
|
|
84
|
+
departingTarget?: boolean;
|
|
37
85
|
}): Promise<Session | null>;
|
|
86
|
+
export declare function validateScheduledTaskMachineTarget(input: {
|
|
87
|
+
settings: Settings;
|
|
88
|
+
db: Database;
|
|
89
|
+
grant: AccessGrant;
|
|
90
|
+
runMode: ScheduledTask["runMode"];
|
|
91
|
+
agentConfig: ScheduledTaskAgentConfig;
|
|
92
|
+
requireOnline?: boolean;
|
|
93
|
+
}): Promise<{
|
|
94
|
+
sandboxId: string;
|
|
95
|
+
enrollmentId: string;
|
|
96
|
+
sandboxOs: Session["sandboxOs"];
|
|
97
|
+
} | null>;
|
|
38
98
|
export declare function scheduledTaskForGrant(task: ScheduledTask, grant: AccessGrant): ScheduledTask;
|
|
39
99
|
export declare function scheduledTaskRunForGrant<T extends {
|
|
40
100
|
sessionId: string | null;
|
|
41
101
|
}>(run: T, grant: AccessGrant): T;
|
|
102
|
+
export declare function scheduledTaskAuthorityUpdateForGrant(grant: AccessGrant): Pick<UpdateScheduledTaskInput, "refreshPersonalResourceAuthority" | "authorityUpdatedBy" | "authorityUpdatedByContext" | "authorityUpdatedByActor">;
|
|
42
103
|
export declare function validatedScheduledTaskUpdate(input: {
|
|
43
104
|
settings: Settings;
|
|
44
105
|
db: Database;
|
|
45
106
|
objectStorage: ObjectStorageDependency;
|
|
46
107
|
grant: AccessGrant;
|
|
108
|
+
authorization?: AccessGrantAuthorization;
|
|
47
109
|
existing: ScheduledTask;
|
|
48
110
|
payload: UpdateScheduledTaskPayload;
|
|
49
111
|
/** See createValidatedScheduledTask; only consulted when agentConfig is updated. */
|
|
50
112
|
toolsProvided?: boolean;
|
|
51
113
|
sessionAuthorization?: SessionAuthorizationPort | null | undefined;
|
|
52
114
|
authorizationSurface?: SessionAuthorizationSurface | undefined;
|
|
115
|
+
/** Proves the bot may post in a newly chosen task Slack channel. */
|
|
116
|
+
verifySlackChannel?: ScheduledTaskSlackChannelVerifier | undefined;
|
|
53
117
|
}): Promise<UpdateScheduledTaskInput>;
|
|
54
118
|
export declare function requireScheduledTaskForApi(db: Database, workspaceId: string, taskId: string): Promise<ScheduledTask>;
|
|
55
119
|
export type ScheduledTaskRestoreState = {
|
|
56
120
|
task: ScheduledTask;
|
|
57
|
-
|
|
121
|
+
learning?: {
|
|
122
|
+
context: KnowledgeContext;
|
|
123
|
+
scope: "workspace" | "personal";
|
|
124
|
+
settings: import("@opengeni/contracts").AgentLearningOverridePatch;
|
|
125
|
+
expectedVersion: number;
|
|
126
|
+
};
|
|
58
127
|
};
|
|
59
|
-
export declare function captureScheduledTaskRestoreState(
|
|
128
|
+
export declare function captureScheduledTaskRestoreState(_db: Database, task: ScheduledTask): Promise<ScheduledTaskRestoreState>;
|
|
60
129
|
export declare function restoreScheduledTask(db: Database, previous: ScheduledTaskRestoreState): Promise<ScheduledTask>;
|
|
61
130
|
export declare class ScheduledTaskSyncError extends Error {
|
|
62
131
|
readonly persistenceRestored: boolean;
|
|
63
132
|
constructor(cause: unknown, persistenceRestored: boolean);
|
|
64
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* One deletion lifecycle shared by HTTP and first-party MCP adapters.
|
|
136
|
+
* Connector authorization is proven before the one-way tombstone. The same
|
|
137
|
+
* transaction detaches reclaimable task resources and persists both external
|
|
138
|
+
* cleanup obligations; best-effort processing is only an acceleration of that
|
|
139
|
+
* durable receipt.
|
|
140
|
+
*/
|
|
141
|
+
export declare function deleteScheduledTaskLifecycle(input: {
|
|
142
|
+
db: Database;
|
|
143
|
+
workspaceId: string;
|
|
144
|
+
taskId: string;
|
|
145
|
+
subjectId: string;
|
|
146
|
+
beforeDeleteCommit?: (tx: Database) => Promise<void>;
|
|
147
|
+
preflightConnectorAuthorization: (task: ScheduledTask) => Promise<void>;
|
|
148
|
+
cleanupConnectorAuthorization: (db: Database, task: ScheduledTask) => Promise<void>;
|
|
149
|
+
processCleanupClaims?: (claims: readonly TemporalScheduleCleanupClaim[]) => Promise<void>;
|
|
150
|
+
}): Promise<{
|
|
151
|
+
task: ScheduledTask;
|
|
152
|
+
changed: boolean;
|
|
153
|
+
cleanup: TemporalScheduleCleanupClaim | null;
|
|
154
|
+
}>;
|
|
65
155
|
export declare function syncCreatedScheduledTask(input: {
|
|
66
156
|
db: Database;
|
|
67
157
|
workflowClient: SessionWorkflowClient;
|
|
@@ -99,3 +189,10 @@ export declare function manualScheduledTaskTriggerWorkflowId(taskId: string, tri
|
|
|
99
189
|
* and the run dedupe together under retry.
|
|
100
190
|
*/
|
|
101
191
|
export declare function manualScheduledTaskTriggerUsageKey(workspaceId: string, taskId: string, triggerToken: string): string;
|
|
192
|
+
/**
|
|
193
|
+
* Static incident-telemetry admission validates only already-selected task
|
|
194
|
+
* authority. It never discovers a resource, reads a variable value, probes a
|
|
195
|
+
* provider, or treats ambient worker credentials as responder capability.
|
|
196
|
+
* Mutable rig/variable-set metadata is revalidated again at dispatch.
|
|
197
|
+
*/
|
|
198
|
+
export declare function validateIncidentTelemetryPreflightSelection(settings: Pick<Settings, "allowedFirstPartyMcpTools" | "defaultFirstPartyMcpTools">, agentConfig: ScheduledTaskAgentConfig): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AccessGrant } from "@opengeni/contracts";
|
|
2
|
+
import type { Settings } from "@opengeni/config";
|
|
3
|
+
import { type Database } from "@opengeni/db";
|
|
4
|
+
/** Freeze the authenticated request's eligible accounts before starting voice.
|
|
5
|
+
* The resulting lease snapshot, not a later participant or ambient connection,
|
|
6
|
+
* supplies authority to both live delegations and automatic transcript handoff. */
|
|
7
|
+
export declare function freezeSessionRealtimeConnectionAccounts(input: {
|
|
8
|
+
db: Database;
|
|
9
|
+
settings: Settings;
|
|
10
|
+
grant: AccessGrant;
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
mcpAccountBindings: import("@opengeni/contracts").McpConnectionAccountBinding[] | null;
|
|
15
|
+
personalConnectionDelegations: import("@opengeni/contracts").McpPersonalConnectionDelegation[];
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AccessGrant, FileAsset } from "@opengeni/contracts";
|
|
2
|
+
import type { SessionAuthorizationDependencies } from "../session-authorization.js";
|
|
3
|
+
/** A session attachment grant is never a generic file/Knowledge grant. */
|
|
4
|
+
export declare function readSessionAttachmentFiles(deps: SessionAuthorizationDependencies, grant: AccessGrant, sessionId: string, fileIds: readonly string[]): Promise<FileAsset[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConnectionMetadata, McpServerConnectionRef } from "@opengeni/contracts";
|
|
2
|
+
/** Selection is restricted to the caller's already-authorized inventory. This
|
|
3
|
+
* projection grants no execution authority: subsequent admission and physical
|
|
4
|
+
* credential use still validate the exact native account normally. */
|
|
5
|
+
export declare function nativeSessionConnectionReplacement(input: {
|
|
6
|
+
accountId: string;
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
subjectId: string | null;
|
|
9
|
+
serverUrl: string;
|
|
10
|
+
replacementServerUrl?: string;
|
|
11
|
+
currentRef: McpServerConnectionRef | null;
|
|
12
|
+
nativeConnectionId: string;
|
|
13
|
+
connections: ConnectionMetadata[];
|
|
14
|
+
}): McpServerConnectionRef;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Observability } from "@opengeni/observability";
|
|
2
|
+
type SessionStartPhase = "workspace_read" | "model_catalog_initial" | "default_model" | "model_catalog_effective" | "capability_settings" | "initiator_freeze" | "allowance" | "shell_insert" | "initialize" | "event_fanout" | "workflow_wake" | "session_reload";
|
|
3
|
+
export type SessionStartObservability = Pick<Observability, "startSpan">;
|
|
4
|
+
/** Content-free child spans around existing work; export is never joined and
|
|
5
|
+
* diagnostic failures cannot alter the lifecycle or its exact error. */
|
|
6
|
+
export declare function measureSessionStartPhase<T>(observability: SessionStartObservability | null | undefined, phase: SessionStartPhase, work: () => Promise<T>): Promise<T>;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type Session, type SessionEffectiveToolPolicy, type SessionToolPolicy, type ToolRef } from "@opengeni/contracts";
|
|
3
|
-
import type
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
import { type AgentToolEnvironment, type AgentMediaAttachment, type Session, type SessionTurn, type SessionEffectiveToolPolicy, type SessionToolPolicy, type ToolRef } from "@opengeni/contracts";
|
|
3
|
+
import { type Database } from "@opengeni/db";
|
|
4
4
|
export type ResolvedSessionToolPolicy = {
|
|
5
5
|
toolRefs: ToolRef[];
|
|
6
6
|
effectivePolicy: SessionEffectiveToolPolicy;
|
|
@@ -23,9 +23,98 @@ export declare function defaultSessionMcpServerIds(servers: Iterable<{
|
|
|
23
23
|
* `defaultMcpServerIds` is the current configured omitted-tools default.
|
|
24
24
|
*/
|
|
25
25
|
export declare function resolveSessionToolPolicy(input: SessionToolPolicyInput): ResolvedSessionToolPolicy;
|
|
26
|
+
/** Null is ordinary work; an empty list is a frozen scheduled selection. */
|
|
27
|
+
export declare function scheduledTurnMcpServerIds(turn: Pick<SessionTurn, "metadata">): string[] | null;
|
|
28
|
+
/**
|
|
29
|
+
* Execution's canonical turn selection. Ordinary turns use the durable session
|
|
30
|
+
* policy, not the queue's omitted-tools `[]`. Scheduled turns instead retain
|
|
31
|
+
* their frozen registry and refs, including an explicitly empty selection.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveTurnToolPolicy(input: Omit<SessionToolPolicyInput, "sessionTools"> & {
|
|
34
|
+
session: Pick<Session, "tools">;
|
|
35
|
+
turn: Pick<SessionTurn, "tools" | "metadata">;
|
|
36
|
+
}): ResolvedSessionToolPolicy;
|
|
37
|
+
/** Resolve availability and defaults from the same subject-scoped registry read. */
|
|
38
|
+
export declare function workspaceSessionToolPolicyContext(db: Database, workspaceId: string, settings: Settings, subjectId?: string): Promise<{
|
|
39
|
+
workspaceServerIds: string[];
|
|
40
|
+
workspaceDefaultServerIds: string[];
|
|
41
|
+
}>;
|
|
26
42
|
/** Current full runtime registry IDs, including configured static servers. */
|
|
27
43
|
export declare function workspaceSessionToolPolicyServerIds(db: Database, workspaceId: string, settings: Settings, subjectId?: string): Promise<string[]>;
|
|
28
44
|
/** Current omitted-tools defaults: every configured runtime MCP is on. */
|
|
29
45
|
export declare function workspaceSessionToolPolicyDefaultServerIds(db: Database, workspaceId: string, settings: Settings, subjectId?: string): Promise<string[]>;
|
|
46
|
+
/**
|
|
47
|
+
* The omitted-tools default for one resolved runtime registry and one
|
|
48
|
+
* workspace settings bag. Pure so a caller that already holds both never has
|
|
49
|
+
* to re-query the capability registry to agree with the worker and the
|
|
50
|
+
* composer on which connectors a `workspace_default` session executes with.
|
|
51
|
+
*/
|
|
52
|
+
export declare function workspaceSessionToolPolicyDefaultServerIdsFor(runtimeMcpServers: Iterable<{
|
|
53
|
+
id: string;
|
|
54
|
+
}>, workspaceSettings: unknown): string[];
|
|
55
|
+
/** Metadata only: no MCP listing, provider probes, account selection or credentials. */
|
|
56
|
+
export type SessionEffectiveToolsContext = {
|
|
57
|
+
settings: Settings;
|
|
58
|
+
humanInputEnabled: boolean;
|
|
59
|
+
hasWorkspaceSkills: boolean;
|
|
60
|
+
workspaceSettings?: unknown;
|
|
61
|
+
objectStorageAvailable: boolean;
|
|
62
|
+
activeSandboxBackends?: ReadonlyMap<string, Settings["sandboxBackend"]>;
|
|
63
|
+
/** Exact build options after adapter/credential resolution, keyed by session. No pool-readiness inference. */
|
|
64
|
+
mediaAttachments?: ReadonlyMap<string, AgentMediaAttachment>;
|
|
65
|
+
routerInHistory?: boolean;
|
|
66
|
+
routerHistorySessionIds?: ReadonlySet<string>;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Resolve one context for a response page, not one catalog per session. Legacy
|
|
70
|
+
* rows require no additional reads and never acquire an effectiveTools field.
|
|
71
|
+
*/
|
|
72
|
+
export declare function workspaceSessionEffectiveToolsContext(deps: {
|
|
73
|
+
db: Database;
|
|
74
|
+
settings: Settings;
|
|
75
|
+
objectStorage?: unknown;
|
|
76
|
+
}, workspaceId: string, subjectId: string, sessions: readonly Session[]): Promise<SessionEffectiveToolsContext>;
|
|
77
|
+
/** The server can prove attachment policy, not successful future provider calls. */
|
|
78
|
+
export declare function sessionEffectiveToolProjectionInput(session: Session & {
|
|
79
|
+
agent: NonNullable<Session["agent"]>;
|
|
80
|
+
}, toolRefs: readonly ToolRef[], context?: SessionEffectiveToolsContext): {
|
|
81
|
+
config: {
|
|
82
|
+
version: 1;
|
|
83
|
+
from: "all" | "none";
|
|
84
|
+
capabilities: {
|
|
85
|
+
webSearch: boolean;
|
|
86
|
+
humanInput: boolean;
|
|
87
|
+
skills: "manage" | "read" | false;
|
|
88
|
+
goals: boolean;
|
|
89
|
+
subagents: boolean;
|
|
90
|
+
knowledge: boolean;
|
|
91
|
+
schedules: boolean;
|
|
92
|
+
artifacts: boolean;
|
|
93
|
+
browser: boolean;
|
|
94
|
+
media: boolean;
|
|
95
|
+
workspaceFiles: boolean;
|
|
96
|
+
workspaceConnectors: boolean;
|
|
97
|
+
workspaceAdmin: boolean;
|
|
98
|
+
};
|
|
99
|
+
unavailable: ("artifacts" | "browser" | "goals" | "humanInput" | "knowledge" | "media" | "schedules" | "skills" | "subagents" | "webSearch" | "workspaceAdmin" | "workspaceConnectors" | "workspaceFiles")[];
|
|
100
|
+
identity: string | null;
|
|
101
|
+
renderer: "markdown" | "opengeni";
|
|
102
|
+
source: "deployment_default" | "inherited" | "legacy_conversion" | "request" | "workspace_default";
|
|
103
|
+
};
|
|
104
|
+
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_download_save" | "browser_downloads" | "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")[];
|
|
105
|
+
firstPartyModelNames: Map<"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_download_save" | "browser_downloads" | "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", string>;
|
|
106
|
+
mcpServerIds: string[];
|
|
107
|
+
productServerIds: ReadonlySet<string>;
|
|
108
|
+
environment: AgentToolEnvironment;
|
|
109
|
+
runtimeToolNames: ("apply_patch" | "code_search" | "exec_command" | "generate_image" | "generate_video" | "get_video_generation_capabilities" | "image_generation" | "knowledge_source_fetch" | "knowledge_source_read" | "list_models" | "operation_read" | "refresh_credentials" | "repository_skill_read" | "request_human_input" | "skill_checkout" | "skill_install" | "skill_publish" | "skill_read" | "skill_remove" | "skill_save" | "skill_search" | "tool_invoke" | "tool_list" | "tool_search" | "view_image" | "web_search" | "write_stdin" | "x_search")[];
|
|
110
|
+
hostedToolNames: ("apply_patch" | "code_search" | "exec_command" | "generate_image" | "generate_video" | "get_video_generation_capabilities" | "image_generation" | "knowledge_source_fetch" | "knowledge_source_read" | "list_models" | "operation_read" | "refresh_credentials" | "repository_skill_read" | "request_human_input" | "skill_checkout" | "skill_install" | "skill_publish" | "skill_read" | "skill_remove" | "skill_save" | "skill_search" | "tool_invoke" | "tool_list" | "tool_search" | "view_image" | "web_search" | "write_stdin" | "x_search")[];
|
|
111
|
+
sandboxToolNames: ("apply_patch" | "code_search" | "exec_command" | "generate_image" | "generate_video" | "get_video_generation_capabilities" | "image_generation" | "knowledge_source_fetch" | "knowledge_source_read" | "list_models" | "operation_read" | "refresh_credentials" | "repository_skill_read" | "request_human_input" | "skill_checkout" | "skill_install" | "skill_publish" | "skill_read" | "skill_remove" | "skill_save" | "skill_search" | "tool_invoke" | "tool_list" | "tool_search" | "view_image" | "web_search" | "write_stdin" | "x_search")[];
|
|
112
|
+
routerToolNames: ("apply_patch" | "code_search" | "exec_command" | "generate_image" | "generate_video" | "get_video_generation_capabilities" | "image_generation" | "knowledge_source_fetch" | "knowledge_source_read" | "list_models" | "operation_read" | "refresh_credentials" | "repository_skill_read" | "request_human_input" | "skill_checkout" | "skill_install" | "skill_publish" | "skill_read" | "skill_remove" | "skill_save" | "skill_search" | "tool_invoke" | "tool_list" | "tool_search" | "view_image" | "web_search" | "write_stdin" | "x_search")[];
|
|
113
|
+
upfrontToolNames: Set<string>;
|
|
114
|
+
mediaAttachment: AgentMediaAttachment | {
|
|
115
|
+
readonly image: null;
|
|
116
|
+
readonly video: false;
|
|
117
|
+
} | undefined;
|
|
118
|
+
};
|
|
30
119
|
/** Add a bounded, secret-safe effective projection to a session response. */
|
|
31
|
-
export declare function sessionWithEffectiveToolPolicy(session: Session, workspaceServerIds: Iterable<string>, workspaceDefaultServerIds?: Iterable<string
|
|
120
|
+
export declare function sessionWithEffectiveToolPolicy(session: Session, workspaceServerIds: Iterable<string>, workspaceDefaultServerIds?: Iterable<string>, effectiveToolsContext?: SessionEffectiveToolsContext): Session;
|