@opengeni/core 0.12.5 → 0.12.7
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/index.d.ts +20 -4
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/access/index.ts +3 -0
- package/src/dependencies.ts +4 -2
- package/src/domain/capabilities.ts +36 -1
- package/src/domain/sessions.ts +45 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Settings } from '@opengeni/config';
|
|
2
|
-
import { ScheduledTask, Document, GitHubAppApiPort, ConnectionCredentialsPort, SessionAuthorizationPort, Permission, AccessContext, AccessGrant, SessionAuthorizationActor, SessionAuthorizationTarget, SessionAuthorizationOperation, SessionAuthorizationSurface, SessionAuthorizationListScope, LimitAction, LimitDecision,
|
|
2
|
+
import { ScheduledTask, TurnInitiator, Document, GitHubAppApiPort, ConnectionCredentialsPort, SessionAuthorizationPort, Permission, AccessContext, AccessGrant, SessionAuthorizationActor, SessionAuthorizationTarget, SessionAuthorizationOperation, SessionAuthorizationSurface, SessionAuthorizationListScope, LimitAction, LimitDecision, TurnInitiatorContext, SessionTurnSource, CapabilityCatalogItem, CapabilityInstallation, CapabilityCatalogResponse, CreateCapabilityCatalogItemRequest, EnableCapabilityRequest, VariableSet, Rig, RigVersion, CreateRigRequest, RigDefinitionEditPayload, RigChange, ProposeRigChangeRequest, UpdateRigRequest, CapabilityPack, SocialConnection, ScheduledTaskAgentConfig, ToolRef, ResourceRef, SessionEffectiveToolPolicy, SessionToolPolicy, Session, CreateScheduledTaskRequest, UpdateScheduledTaskRequest, SessionSpawnDenial, ReasoningEffort, SessionMcpCredentialUpdateInput, SessionEvent, SessionTurn, SessionSkill, TurnExecutionPolicyV1, GoalSpec, FirstPartyMcpToolName, SessionMcpServerMetadata, CreateSessionResponse, SessionMcpApprovalPolicy, UpdateSessionMcpApprovalPolicyResponse, UpdateSessionToolPolicyRequest, ConnectionMetadata, OpenGeniSlackBotConnectionMetadata, WorkspaceMember, NewSessionDraft, SessionControlRequest, SessionControlResponse, WorkspaceInferenceControlRequest, WorkspaceInferenceControlResponse, DeleteSessionQueueItemRequest, SessionQueueMutationResponse, EditSessionQueueItemRequest, ComposerDraft, MoveSessionQueueItemRequest, SaveComposerDraftRequest, SteerSessionQueueItemRequest } from '@opengeni/contracts';
|
|
3
3
|
export { mergeToolRefs, stableJson } from '@opengeni/contracts';
|
|
4
4
|
import * as _opengeni_db from '@opengeni/db';
|
|
5
5
|
import { Database, SandboxRecord, EnabledMcpCapabilityServer, UpdateScheduledTaskInput, SessionCommandActor, CreateSessionMcpServerInput, UpdateSessionMcpServerCredentialsInput, ConnectionMetadataWithVerification } from '@opengeni/db';
|
|
@@ -106,8 +106,9 @@ type SessionWorkflowClient = {
|
|
|
106
106
|
}) => Promise<void>;
|
|
107
107
|
triggerScheduledTask: (input: {
|
|
108
108
|
task: ScheduledTask;
|
|
109
|
-
agentRunUsageIdempotencyKey
|
|
110
|
-
triggerWorkflowId
|
|
109
|
+
agentRunUsageIdempotencyKey: string;
|
|
110
|
+
triggerWorkflowId: string;
|
|
111
|
+
initiator: TurnInitiator;
|
|
111
112
|
}) => Promise<void>;
|
|
112
113
|
startRigVerification: (input: {
|
|
113
114
|
workspaceId: string;
|
|
@@ -534,6 +535,13 @@ declare function disableCapability(input: {
|
|
|
534
535
|
capabilityId: string;
|
|
535
536
|
}): Promise<CapabilityInstallation>;
|
|
536
537
|
declare function settingsWithEnabledCapabilityMcpServers(db: Database, workspaceId: string, settings: Settings): Promise<Settings>;
|
|
538
|
+
/**
|
|
539
|
+
* Register Codex Apps as an optional runtime MCP when the deployment enables
|
|
540
|
+
* it. Registration only makes the server selectable; the session tool policy
|
|
541
|
+
* decides whether the model sees it, and Codex credential resolution
|
|
542
|
+
* independently decides whether calls can authenticate.
|
|
543
|
+
*/
|
|
544
|
+
declare function settingsWithCodexAppsMcpServer(settings: Settings): Settings;
|
|
537
545
|
declare function settingsWithMcpCapabilityServers(settings: Settings, enabled: EnabledMcpCapabilityServer[]): Settings;
|
|
538
546
|
declare function discoverMcpRegistryCapabilities(input: {
|
|
539
547
|
query?: string;
|
|
@@ -795,6 +803,13 @@ declare class SessionSpawnDeniedError extends Error {
|
|
|
795
803
|
readonly denial: SessionSpawnDenial;
|
|
796
804
|
constructor(denial: SessionSpawnDenial);
|
|
797
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* Resolve per-session first-party tool visibility without consulting
|
|
808
|
+
* authorization. Top-level omission uses the minimal runtime default (stored
|
|
809
|
+
* as null); child omission snapshots the parent's exact effective selection.
|
|
810
|
+
* Explicit [] is authoritative and must never widen.
|
|
811
|
+
*/
|
|
812
|
+
declare function resolveFirstPartyMcpToolsForCreate(requested: FirstPartyMcpToolName[] | undefined, parentStored: FirstPartyMcpToolName[] | null | undefined): FirstPartyMcpToolName[] | null;
|
|
798
813
|
declare function sessionSpawnDenialEnvelope(error: SessionSpawnDeniedError): {
|
|
799
814
|
readonly error: {
|
|
800
815
|
readonly code: "nested_agent_depth_exceeded" | "nested_agent_depth_override_forbidden";
|
|
@@ -854,6 +869,7 @@ declare function createAndStartSession(input: {
|
|
|
854
869
|
goal?: GoalSpec | null;
|
|
855
870
|
instructions?: string | null;
|
|
856
871
|
firstPartyMcpPermissions?: Permission[] | null;
|
|
872
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[] | null;
|
|
857
873
|
mcpServers?: CreateSessionMcpServerInput[];
|
|
858
874
|
sessionMcpServers?: SessionMcpServerMetadata[];
|
|
859
875
|
parentSessionId?: string | null;
|
|
@@ -1170,4 +1186,4 @@ declare function controlHumanWorkspace(deps: {
|
|
|
1170
1186
|
declare function getHumanComposerDraft(deps: SessionAuthorizationCommandDeps, context: HumanSessionCommandContext): Promise<ComposerDraft>;
|
|
1171
1187
|
declare function saveHumanComposerDraft(deps: SessionAuthorizationCommandDeps, context: HumanSessionCommandContext, input: SaveComposerDraftRequest): Promise<ComposerDraft>;
|
|
1172
1188
|
|
|
1173
|
-
export { type AcceptSessionUserMessageDependencies, type AccessDeps, type AgentSessionCommandContext, type ApiRouteDeps, type ApiSandboxClient, type ApiSandboxSession, type AppDependencies, type ChannelARoutingServices, type DocumentIndexClient, type FleetContext, type FleetListResult, type FleetLiveness, type FleetReadinessHold, type FleetSandboxEntry, type FleetServices, type FleetSwapResult, type HumanSessionCommandContext, type LimitCheckInput, type LimitDependencies, MARKETING_SOCIAL_PACK_ID, MAX_CHECKS_PER_RIG, MAX_CREDENTIAL_HOOKS_PER_RIG, MAX_DEFAULT_VARIABLE_SETS_PER_RIG, MAX_ENVIRONMENTS_PER_WORKSPACE, MAX_RIGS_PER_WORKSPACE, MAX_VARIABLES_PER_ENVIRONMENT, type ManagedAuth, type McpCapabilityProbe, type McpCapabilityProbeInput, type McpCapabilityProbeResult, type ObjectStorageDependency, type ProvisionResult, type ResolvedSessionAuthorization, type ResolvedSessionToolPolicy, type ResumeBoxByIdInput, type ResumedSandboxSession, type RigServices, type RigVerificationClassification, type RunOnOp, type RunOnResult, SESSION_AUTHORIZATION_DEFAULT_REAUTHORIZE_MS, SESSION_WORKFLOW_WAKE_DISPATCHER_PERIOD_MS, SESSION_WORKFLOW_WAKE_DISPATCHER_SCHEDULE_ID, SESSION_WORKFLOW_WAKE_DISPATCHER_WORKFLOW_TYPE, SessionAuthorizationDeniedError, type SessionAuthorizationDependencies, SessionAuthorizationUnavailableError, SessionSpawnDeniedError, type SessionToolPolicyInput, type SessionWorkflowClient, acceptSessionUserMessage, activateRigVersionForApi, appendRigSetupCommand, applyCapabilityEnablement, assertAllowedEnvironmentVariableName, assertAllowedVariableSetVariableName, assertConfiguredModel, assertPackSandboxImageCompatible, assertToolRefsSubset, assertWorkspaceDeletable, assertWorkspaceMemberRemovable, assertWorkspaceModelPolicyAllows, availableToolRefs, buildCapabilityCatalog, buildFleetContextForSession, buildMarketingDailyAnalysisAgentConfig, canonicalConfiguredModel, checkLimit, classifyRigVerificationOutcome, controlAgentSessionWorkstream, controlHumanSessionWorkstream, controlHumanWorkspace, createAndStartSession, createCatalogItem, createRigForApi, createRigVersionForApi, createSessionForRequest, createValidatedScheduledTask, deleteHumanQueuePrompt, deleteRigForApi, disableCapability, discoverMcpRegistryCapabilities, editHumanQueuePrompt, enableCapability, enabledCapabilityMcpToolRefs, getActorNewSessionDraft, getCapabilityPack, getHumanComposerDraft, hasPermission, hasReservedOpenGeniSlackBotMetadata, hasReservedOpenGeniSlackBotSessionMetadata, isAuthoritativeGitHubRepositorySelectionError, isBuiltInCapabilityPack, isOpenGeniSlackBotConnection, isTrustedScheduledSlackBotSession, isUserMember, listCapabilityPacks, listFleet, listRigChangesForApi, listRigVersionsForApi, listWorkspaceCapabilityPacks, manualScheduledTaskTriggerUsageKey, manualScheduledTaskTriggerWorkflowId, memberCanAdminister, mergeResourceRefs, moveHumanQueuePrompt, normalizeResources, officialMcpRegistryUrl, openGeniSlackBotMetadata, postUserMessageTurn, promoteSetupAppendChange, promoteVerifiedDefinitionEditChangeForApi, proposeRigChangeForApi, provisionSandbox, readSessionLineage, reasoningEffortForSession, recordRigAuditEvent, recordVariableSetAuditEvent, recordWorkspaceUsage, relayConfigFromSettings, relayDialBaseFromSettings, requireAccessContext, requireAccessGrant, requireEnvironmentEncryption, requireLimit, requireOpenGeniSlackBotConnection, requirePermission, requireQueuedTurnForApi, requireRigChangeForApi, requireRigForApi, requireScheduledTaskForApi, requireSessionAuthorization, requireSessionAuthorizationListScope, requireVariableSetEncryption, requireVariableSetForApi, resolveCapabilityPack, resolveMemberSubjectId, resolveSessionToolPolicy, restoreScheduledTask, rigActorForGrant, routingEnabled, runOnSandbox, saveActorNewSessionDraft, saveHumanComposerDraft, scheduledSlackBotConnectionId, scheduledTaskTemporalScheduleId, scheduledTaskToolsProvided, scheduledTaskTriggerToken, sendAgentSessionMessage, sessionSpawnDenialEnvelope, sessionToolPolicyAllowsDefaultNativeTools, sessionWithEffectiveToolPolicy, settingsWithEnabledCapabilityMcpServers, settingsWithMcpCapabilityServers, settingsWithSessionMcpServerMetadata, steerAgentSession, steerHumanQueuePrompt, swapActiveSandbox, syncCreatedScheduledTask, syncUpdatedScheduledTask, updateRigForApi, updateSessionMcpApprovalPolicy, updateSessionTitle, updateSessionToolPolicy, validateFileResources, validateGitHubRepositorySelection, validateGitHubRepositorySelectionShape, validateGitHubRepositorySelectionShapes, validateMcpCapabilityConnection, validateOpenGeniSlackBotConnectionSelection, validateToolRefs, validateToolRefsForSessionPolicy, validateVariableSetAttachment, validatedScheduledTaskUpdate, withDefaultEnabledCapabilityMcpTools, workflowIdForSession, workspaceSessionToolPolicyDefaultServerIds, workspaceSessionToolPolicyServerIds, wrapChannelABoxWithRouting };
|
|
1189
|
+
export { type AcceptSessionUserMessageDependencies, type AccessDeps, type AgentSessionCommandContext, type ApiRouteDeps, type ApiSandboxClient, type ApiSandboxSession, type AppDependencies, type ChannelARoutingServices, type DocumentIndexClient, type FleetContext, type FleetListResult, type FleetLiveness, type FleetReadinessHold, type FleetSandboxEntry, type FleetServices, type FleetSwapResult, type HumanSessionCommandContext, type LimitCheckInput, type LimitDependencies, MARKETING_SOCIAL_PACK_ID, MAX_CHECKS_PER_RIG, MAX_CREDENTIAL_HOOKS_PER_RIG, MAX_DEFAULT_VARIABLE_SETS_PER_RIG, MAX_ENVIRONMENTS_PER_WORKSPACE, MAX_RIGS_PER_WORKSPACE, MAX_VARIABLES_PER_ENVIRONMENT, type ManagedAuth, type McpCapabilityProbe, type McpCapabilityProbeInput, type McpCapabilityProbeResult, type ObjectStorageDependency, type ProvisionResult, type ResolvedSessionAuthorization, type ResolvedSessionToolPolicy, type ResumeBoxByIdInput, type ResumedSandboxSession, type RigServices, type RigVerificationClassification, type RunOnOp, type RunOnResult, SESSION_AUTHORIZATION_DEFAULT_REAUTHORIZE_MS, SESSION_WORKFLOW_WAKE_DISPATCHER_PERIOD_MS, SESSION_WORKFLOW_WAKE_DISPATCHER_SCHEDULE_ID, SESSION_WORKFLOW_WAKE_DISPATCHER_WORKFLOW_TYPE, SessionAuthorizationDeniedError, type SessionAuthorizationDependencies, SessionAuthorizationUnavailableError, SessionSpawnDeniedError, type SessionToolPolicyInput, type SessionWorkflowClient, acceptSessionUserMessage, activateRigVersionForApi, appendRigSetupCommand, applyCapabilityEnablement, assertAllowedEnvironmentVariableName, assertAllowedVariableSetVariableName, assertConfiguredModel, assertPackSandboxImageCompatible, assertToolRefsSubset, assertWorkspaceDeletable, assertWorkspaceMemberRemovable, assertWorkspaceModelPolicyAllows, availableToolRefs, buildCapabilityCatalog, buildFleetContextForSession, buildMarketingDailyAnalysisAgentConfig, canonicalConfiguredModel, checkLimit, classifyRigVerificationOutcome, controlAgentSessionWorkstream, controlHumanSessionWorkstream, controlHumanWorkspace, createAndStartSession, createCatalogItem, createRigForApi, createRigVersionForApi, createSessionForRequest, createValidatedScheduledTask, deleteHumanQueuePrompt, deleteRigForApi, disableCapability, discoverMcpRegistryCapabilities, editHumanQueuePrompt, enableCapability, enabledCapabilityMcpToolRefs, getActorNewSessionDraft, getCapabilityPack, getHumanComposerDraft, hasPermission, hasReservedOpenGeniSlackBotMetadata, hasReservedOpenGeniSlackBotSessionMetadata, isAuthoritativeGitHubRepositorySelectionError, isBuiltInCapabilityPack, isOpenGeniSlackBotConnection, isTrustedScheduledSlackBotSession, isUserMember, listCapabilityPacks, listFleet, listRigChangesForApi, listRigVersionsForApi, listWorkspaceCapabilityPacks, manualScheduledTaskTriggerUsageKey, manualScheduledTaskTriggerWorkflowId, memberCanAdminister, mergeResourceRefs, moveHumanQueuePrompt, normalizeResources, officialMcpRegistryUrl, openGeniSlackBotMetadata, postUserMessageTurn, promoteSetupAppendChange, promoteVerifiedDefinitionEditChangeForApi, proposeRigChangeForApi, provisionSandbox, readSessionLineage, reasoningEffortForSession, recordRigAuditEvent, recordVariableSetAuditEvent, recordWorkspaceUsage, relayConfigFromSettings, relayDialBaseFromSettings, requireAccessContext, requireAccessGrant, requireEnvironmentEncryption, requireLimit, requireOpenGeniSlackBotConnection, requirePermission, requireQueuedTurnForApi, requireRigChangeForApi, requireRigForApi, requireScheduledTaskForApi, requireSessionAuthorization, requireSessionAuthorizationListScope, requireVariableSetEncryption, requireVariableSetForApi, resolveCapabilityPack, resolveFirstPartyMcpToolsForCreate, resolveMemberSubjectId, resolveSessionToolPolicy, restoreScheduledTask, rigActorForGrant, routingEnabled, runOnSandbox, saveActorNewSessionDraft, saveHumanComposerDraft, scheduledSlackBotConnectionId, scheduledTaskTemporalScheduleId, scheduledTaskToolsProvided, scheduledTaskTriggerToken, sendAgentSessionMessage, sessionSpawnDenialEnvelope, sessionToolPolicyAllowsDefaultNativeTools, sessionWithEffectiveToolPolicy, settingsWithCodexAppsMcpServer, settingsWithEnabledCapabilityMcpServers, settingsWithMcpCapabilityServers, settingsWithSessionMcpServerMetadata, steerAgentSession, steerHumanQueuePrompt, swapActiveSandbox, syncCreatedScheduledTask, syncUpdatedScheduledTask, updateRigForApi, updateSessionMcpApprovalPolicy, updateSessionTitle, updateSessionToolPolicy, validateFileResources, validateGitHubRepositorySelection, validateGitHubRepositorySelectionShape, validateGitHubRepositorySelectionShapes, validateMcpCapabilityConnection, validateOpenGeniSlackBotConnectionSelection, validateToolRefs, validateToolRefsForSessionPolicy, validateVariableSetAttachment, validatedScheduledTaskUpdate, withDefaultEnabledCapabilityMcpTools, workflowIdForSession, workspaceSessionToolPolicyDefaultServerIds, workspaceSessionToolPolicyServerIds, wrapChannelABoxWithRouting };
|
package/dist/index.js
CHANGED
|
@@ -829,6 +829,7 @@ async function delegatedAccessContext(c, deps, mode, token = bearerToken(c)) {
|
|
|
829
829
|
metadata: {
|
|
830
830
|
delegated: true,
|
|
831
831
|
...payload.sessionId ? { sessionId: payload.sessionId } : {},
|
|
832
|
+
...payload.firstPartyMcpTools !== void 0 ? { firstPartyMcpTools: payload.firstPartyMcpTools } : {},
|
|
832
833
|
// Caller identity: the turn that minted this token. Tools classify the
|
|
833
834
|
// CALLER from this instead of re-reading the live active pointer.
|
|
834
835
|
...payload.turnId ? { turnId: payload.turnId } : {},
|
|
@@ -1189,6 +1190,12 @@ import { environmentsEncryptionKeyBytes as environmentsEncryptionKeyBytes2 } fro
|
|
|
1189
1190
|
import {
|
|
1190
1191
|
CapabilityCatalogItem
|
|
1191
1192
|
} from "@opengeni/contracts";
|
|
1193
|
+
import {
|
|
1194
|
+
CODEX_APPS_MCP_SERVER_ID,
|
|
1195
|
+
CODEX_APPS_MCP_SERVER_NAME,
|
|
1196
|
+
CODEX_APPS_MCP_URL,
|
|
1197
|
+
CODEX_APPS_STARTUP_TIMEOUT_MS
|
|
1198
|
+
} from "@opengeni/codex";
|
|
1192
1199
|
import {
|
|
1193
1200
|
decryptVariableSetValue,
|
|
1194
1201
|
decryptedCapabilityHeaders,
|
|
@@ -2029,7 +2036,26 @@ async function disableCapability(input) {
|
|
|
2029
2036
|
}
|
|
2030
2037
|
async function settingsWithEnabledCapabilityMcpServers(db, workspaceId, settings) {
|
|
2031
2038
|
const enabled = await listEnabledMcpCapabilityServers(db, workspaceId);
|
|
2032
|
-
return settingsWithMcpCapabilityServers(settings, enabled);
|
|
2039
|
+
return settingsWithCodexAppsMcpServer(settingsWithMcpCapabilityServers(settings, enabled));
|
|
2040
|
+
}
|
|
2041
|
+
function settingsWithCodexAppsMcpServer(settings) {
|
|
2042
|
+
if (!settings.codexConnectedAppsEnabled || settings.mcpServers.some((server) => server.id === CODEX_APPS_MCP_SERVER_ID)) {
|
|
2043
|
+
return settings;
|
|
2044
|
+
}
|
|
2045
|
+
return {
|
|
2046
|
+
...settings,
|
|
2047
|
+
mcpServers: [
|
|
2048
|
+
...settings.mcpServers,
|
|
2049
|
+
{
|
|
2050
|
+
id: CODEX_APPS_MCP_SERVER_ID,
|
|
2051
|
+
name: CODEX_APPS_MCP_SERVER_NAME,
|
|
2052
|
+
url: CODEX_APPS_MCP_URL,
|
|
2053
|
+
timeoutMs: CODEX_APPS_STARTUP_TIMEOUT_MS,
|
|
2054
|
+
// Availability is credential-specific, so discover on every run.
|
|
2055
|
+
cacheToolsList: false
|
|
2056
|
+
}
|
|
2057
|
+
]
|
|
2058
|
+
};
|
|
2033
2059
|
}
|
|
2034
2060
|
function settingsWithMcpCapabilityServers(settings, enabled) {
|
|
2035
2061
|
if (enabled.length === 0) {
|
|
@@ -3351,6 +3377,7 @@ import {
|
|
|
3351
3377
|
import {
|
|
3352
3378
|
CreateSessionRequest,
|
|
3353
3379
|
DEFAULT_FIRST_PARTY_MCP_PERMISSIONS,
|
|
3380
|
+
DEFAULT_FIRST_PARTY_MCP_TOOLS,
|
|
3354
3381
|
OPENGENI_SLACK_BOT_SESSION_METADATA_KEY as OPENGENI_SLACK_BOT_SESSION_METADATA_KEY2,
|
|
3355
3382
|
SessionSpawnDenial,
|
|
3356
3383
|
ServiceTurnInitiator,
|
|
@@ -3473,6 +3500,11 @@ var SessionSpawnDeniedError = class extends Error {
|
|
|
3473
3500
|
this.denial = denial;
|
|
3474
3501
|
}
|
|
3475
3502
|
};
|
|
3503
|
+
function resolveFirstPartyMcpToolsForCreate(requested, parentStored) {
|
|
3504
|
+
if (requested !== void 0) return [...requested];
|
|
3505
|
+
if (parentStored === void 0) return null;
|
|
3506
|
+
return [...parentStored ?? DEFAULT_FIRST_PARTY_MCP_TOOLS];
|
|
3507
|
+
}
|
|
3476
3508
|
function sessionSpawnDeniedMessage(denial) {
|
|
3477
3509
|
if (denial.code === "nested_agent_depth_override_forbidden") {
|
|
3478
3510
|
return `requested nested-agent depth limit ${denial.requestedMaxNestedAgentDepthOverride ?? "unknown"} exceeds inherited limit ${denial.effectiveMaxNestedAgentDepth}; workspace:admin is required to increase it`;
|
|
@@ -3777,6 +3809,7 @@ async function createAndStartSession(input) {
|
|
|
3777
3809
|
rigId: input.rigId ?? null,
|
|
3778
3810
|
rigVersionId: input.rigVersionId ?? null,
|
|
3779
3811
|
firstPartyMcpPermissions: input.firstPartyMcpPermissions ?? null,
|
|
3812
|
+
firstPartyMcpTools: input.firstPartyMcpTools ?? null,
|
|
3780
3813
|
instructions: input.instructions ?? null,
|
|
3781
3814
|
parentSessionId: input.parentSessionId ?? null,
|
|
3782
3815
|
createIdempotencyKey: input.createIdempotencyKey,
|
|
@@ -3821,6 +3854,7 @@ async function createAndStartSession(input) {
|
|
|
3821
3854
|
rigId: input.rigId ?? null,
|
|
3822
3855
|
rigVersionId: input.rigVersionId ?? null,
|
|
3823
3856
|
firstPartyMcpPermissions: input.firstPartyMcpPermissions ?? null,
|
|
3857
|
+
firstPartyMcpTools: input.firstPartyMcpTools ?? null,
|
|
3824
3858
|
instructions: input.instructions ?? null,
|
|
3825
3859
|
parentSessionId: input.parentSessionId ?? null,
|
|
3826
3860
|
sandboxGroupId: input.sandboxGroupId ?? null,
|
|
@@ -4216,6 +4250,21 @@ async function createSessionForRequest(deps, grant, workspaceId, rawPayload) {
|
|
|
4216
4250
|
message: "goal-bearing sessions require goals:manage in the resulting first-party MCP permission set"
|
|
4217
4251
|
});
|
|
4218
4252
|
}
|
|
4253
|
+
const firstPartyMcpTools = resolveFirstPartyMcpToolsForCreate(
|
|
4254
|
+
payload.firstPartyMcpTools,
|
|
4255
|
+
parentSession ? parentSession.firstPartyMcpTools : void 0
|
|
4256
|
+
);
|
|
4257
|
+
if (payload.goal) {
|
|
4258
|
+
const effectiveTools = firstPartyMcpTools ?? [...DEFAULT_FIRST_PARTY_MCP_TOOLS];
|
|
4259
|
+
const missingGoalTools = ["goal_update", "goal_complete", "goal_pause"].filter(
|
|
4260
|
+
(name) => !effectiveTools.includes(name)
|
|
4261
|
+
);
|
|
4262
|
+
if (missingGoalTools.length > 0) {
|
|
4263
|
+
throw new HTTPException10(422, {
|
|
4264
|
+
message: `goal-bearing sessions require first-party MCP tools: ${missingGoalTools.join(", ")}`
|
|
4265
|
+
});
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4219
4268
|
const sandboxChoice = payload.sandbox ?? (parentSessionId ? "shared" : "new");
|
|
4220
4269
|
let sandboxGroupId = null;
|
|
4221
4270
|
let inheritedBackend;
|
|
@@ -4362,6 +4411,7 @@ async function createSessionForRequest(deps, grant, workspaceId, rawPayload) {
|
|
|
4362
4411
|
// time. Not surfaced as an event.
|
|
4363
4412
|
instructions: payload.instructions ?? null,
|
|
4364
4413
|
firstPartyMcpPermissions,
|
|
4414
|
+
firstPartyMcpTools,
|
|
4365
4415
|
mcpServers: sessionMcpServers.dbServers,
|
|
4366
4416
|
sessionMcpServers: sessionMcpServers.metadata,
|
|
4367
4417
|
parentSessionId,
|
|
@@ -5832,6 +5882,7 @@ export {
|
|
|
5832
5882
|
requireVariableSetEncryption,
|
|
5833
5883
|
requireVariableSetForApi,
|
|
5834
5884
|
resolveCapabilityPack,
|
|
5885
|
+
resolveFirstPartyMcpToolsForCreate,
|
|
5835
5886
|
resolveMemberSubjectId,
|
|
5836
5887
|
resolveSessionToolPolicy,
|
|
5837
5888
|
restoreScheduledTask,
|
|
@@ -5848,6 +5899,7 @@ export {
|
|
|
5848
5899
|
sessionSpawnDenialEnvelope,
|
|
5849
5900
|
sessionToolPolicyAllowsDefaultNativeTools,
|
|
5850
5901
|
sessionWithEffectiveToolPolicy,
|
|
5902
|
+
settingsWithCodexAppsMcpServer,
|
|
5851
5903
|
settingsWithEnabledCapabilityMcpServers,
|
|
5852
5904
|
settingsWithMcpCapabilityServers,
|
|
5853
5905
|
settingsWithSessionMcpServerMetadata,
|