@opengeni/runtime 0.14.0 → 0.14.1
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/{chunk-3NUSY22C.js → chunk-HHWIZHQM.js} +26 -9
- package/dist/chunk-HHWIZHQM.js.map +1 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/sandbox/index.js +1 -1
- package/package.json +3 -3
- package/src/context-compaction.ts +0 -5
- package/src/index.ts +9 -3
- package/src/sandbox/toolspace-token.ts +36 -12
- package/dist/chunk-3NUSY22C.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Tool, Computer, AgentInputItem, Model, MCPServer, ModelProvider, Agent,
|
|
|
3
3
|
export { MaxTurnsExceededError, OpenAIChatCompletionsModel, OpenAIResponsesModel } from '@openai/agents';
|
|
4
4
|
import { Settings, ResolvedModelProvider, ConfiguredModel, ModelProviderApi } from '@opengeni/config';
|
|
5
5
|
export { collectSandboxEnvironment, parseExposedPorts } from '@opengeni/config';
|
|
6
|
-
import { HumanInputResponse, ReasoningEffort, GitCredentialProvider, GitCredentialTransport, SessionEventType, ResourceRef, ToolRef, Permission, McpServerConnectionRef, ToolAuthNeededPayload, RequestHumanInputToolInput } from '@opengeni/contracts';
|
|
6
|
+
import { HumanInputResponse, ReasoningEffort, GitCredentialProvider, GitCredentialTransport, SessionEventType, ResourceRef, ToolRef, Permission, FirstPartyMcpToolName, McpServerConnectionRef, ToolAuthNeededPayload, RequestHumanInputToolInput } from '@opengeni/contracts';
|
|
7
7
|
export { CAPABILITY_DESCRIPTORS, CapabilityDescriptor, DESKTOP_STREAM_PORT, StreamTokenPayload, StreamTokenPayload as StreamTokenPayloadType, TERMINAL_STREAM_PORT } from '@opengeni/contracts';
|
|
8
8
|
import { SandboxSessionLike, Capability, SandboxSessionState, Manifest, Capabilities, LocalDirLazySkillSource, SandboxClient } from '@openai/agents/sandbox';
|
|
9
9
|
import OpenAI from 'openai';
|
|
@@ -40,8 +40,6 @@ declare const USER_MESSAGE_TRUNCATION_MARKER = "\n[... middle truncated for cont
|
|
|
40
40
|
declare function isUserMessage(item: unknown): boolean;
|
|
41
41
|
/** True for our synthetic compaction summary item. */
|
|
42
42
|
declare function isCompactionSummary(item: unknown): boolean;
|
|
43
|
-
/** Platform-authored system context exists for one inference and is never persisted. */
|
|
44
|
-
declare function isEphemeralInternalContext(item: unknown): boolean;
|
|
45
43
|
/** Serialized-item estimate for pre-call accounting and retained user budgets. */
|
|
46
44
|
declare function estimateItemTokens(item: CompactionItem): number;
|
|
47
45
|
declare function estimateTokens(items: readonly CompactionItem[]): number;
|
|
@@ -1097,6 +1095,7 @@ type PrepareToolsOptions = {
|
|
|
1097
1095
|
subjectLabel?: string;
|
|
1098
1096
|
credentialSubjectId?: string;
|
|
1099
1097
|
firstPartyPermissions?: Permission[];
|
|
1098
|
+
firstPartyTools?: FirstPartyMcpToolName[];
|
|
1100
1099
|
resolveCredential?: (input: ResolveConnectionCredentialInput) => Promise<ResolveConnectionCredentialResult>;
|
|
1101
1100
|
onAuthNeeded?: (payload: ToolAuthNeededPayload) => Promise<void> | void;
|
|
1102
1101
|
/** Injectable final MCP transport for tests and embedded hosts. */
|
|
@@ -1458,4 +1457,4 @@ declare function azureOpenAIDefaultQuery(settings: Pick<Settings, "azureOpenaiAp
|
|
|
1458
1457
|
*/
|
|
1459
1458
|
declare function lazySkillSourceWithPackSkills(packSkills: PackSkill[], skillLibrarySkills?: PackSkill[]): LocalDirLazySkillSource;
|
|
1460
1459
|
|
|
1461
|
-
export { type AgentSegmentInput, type BuildAgentOptions, COMPACTION_PROMPT, COMPACTION_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, CodexSubscriptionUnavailableError, type CompactionDecision, type CompactionItem, CompactionNeededError, CompactionProviderResponseError, ComputerActionError, ComputerReadOnlyError, type ComputerToolMode, ComputerUnavailableError, type ComputerUseArgs, ComputerUseCapability, type ConnectedMcpServerBatches, type ContextRobustnessFilterOptions, DEFAULT_COMPACTION_THRESHOLD_RATIO, type EffectiveSkillSelection, EmptyCompactionSummaryError, GENESIS_TITLE_DIRECTIVE, type GitCredentialBindingSeed, type GitCredentialTokenWriterSession, type GitTokenSeeds, HUMAN_INPUT_TOOL_NAME, type HistoryItem, MAX_COMPACTION_THRESHOLD_RATIO, MAX_MODEL_USAGE_TOKEN_COUNT, MIN_COMPACTION_THRESHOLD_RATIO, type ModelCallUsageInput, type ModelCallUsageNormalization, type ModelCallUsageTelemetry, type ModelResponseUsage, MultiProviderModelProvider, type NormalizedRuntimeEvent, type OpenGeniRuntime, type PackSkill, type PackSkillFile, type PersistentSessionSettings, type PrepareInputOptions, type PrepareToolsOptions, type PreparedAgentInput, type PreparedAgentTools, type PreparedCompactionPromptInput, type ProductionRuntimeOverrides, type ResolveConnectionCredentialInput, type ResolveConnectionCredentialResult, type RigInstructionsContext, type RigSetupDescriptor, type RunAgentStreamOptions, RunCredentialSessionReady, RuntimeMetricsHooks, SUMMARY_BUFFER_TOKENS, SUMMARY_PREFIX, SandboxComputer, type SandboxComputerOptions, type SandboxFileDownload, type SandboxFileDownloadFailure, type SandboxFileDownloadMaterializationResult, type SandboxLifecycleCommandRunner, type SandboxLifecycleHook, type SandboxLifecycleHookContext, type SandboxLifecycleHookPhase, type SerializedHumanInputInterruption, TOOLSPACE_PROGRAMMATIC_DIRECTIVE, type ToolspaceTokenWriterSession, type TurnSandboxCommandArgs, TurnSandboxCommandCancelledError, type TurnSandboxCommandSession, type TurnToolCancellationController, type TurnToolCancellationFence, USER_MESSAGE_TRUNCATION_MARKER, type WorkspaceEnvironmentContext, WorkspaceModelPolicyBlockedError, agentsErrorRunState, appendGenesisTitleDirective, appendGitCredentialBindingInstructions, appendPersistentSessionSettings, appendSessionInstructions, appendToolspaceInstructions, appendTurnInstructions, appendWorkspaceMemory, applyMissingManifestEntries, azureCliLoginCommand, azureOpenAIDefaultQuery, boundModelToolOutputsFilterForSettings, buildAgentCapabilities, buildCompactionPromptInput, buildCompactionReplacementHistory, buildManifest, buildModelInstance, buildOpenAIClientFromSettings, buildOpenGeniAgent, buildProviderClient, buildSummaryItem, callModelInputFilterForSettings, clampCompactionThresholdRatio, compactionProviderFailureDiagnostics, compactionReplacementFingerprint, compactionResponseDiagnostics, compactionThresholdTokens, composeAgentInstructions, computerUse, configureOpenAI, configureRuntimeMetricsHooks, connectMcpServersInBatches, contextRobustnessFilterForSettings, coreInstructions, createProductionAgentRuntime, createTurnToolCancellationController, decideCompaction, effectiveSkillSelectionsForAgent, elideSupersededViewImagePairs, elideSupersededViewImagesFilter, ensureReadableStreamFrom, estimateCompleteModelInput, estimateItemTokens, estimateSerializedValueTokens, estimateTokens, extractResponseOutputText, findCompactionNeededError, gitCredentialBindingHash, gitCredentialBindingTokenRefreshCommand, gitProviderTokenRefreshCommand, hasModelGeneratedItem, isCompactionSummary,
|
|
1460
|
+
export { type AgentSegmentInput, type BuildAgentOptions, COMPACTION_PROMPT, COMPACTION_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, CodexSubscriptionUnavailableError, type CompactionDecision, type CompactionItem, CompactionNeededError, CompactionProviderResponseError, ComputerActionError, ComputerReadOnlyError, type ComputerToolMode, ComputerUnavailableError, type ComputerUseArgs, ComputerUseCapability, type ConnectedMcpServerBatches, type ContextRobustnessFilterOptions, DEFAULT_COMPACTION_THRESHOLD_RATIO, type EffectiveSkillSelection, EmptyCompactionSummaryError, GENESIS_TITLE_DIRECTIVE, type GitCredentialBindingSeed, type GitCredentialTokenWriterSession, type GitTokenSeeds, HUMAN_INPUT_TOOL_NAME, type HistoryItem, MAX_COMPACTION_THRESHOLD_RATIO, MAX_MODEL_USAGE_TOKEN_COUNT, MIN_COMPACTION_THRESHOLD_RATIO, type ModelCallUsageInput, type ModelCallUsageNormalization, type ModelCallUsageTelemetry, type ModelResponseUsage, MultiProviderModelProvider, type NormalizedRuntimeEvent, type OpenGeniRuntime, type PackSkill, type PackSkillFile, type PersistentSessionSettings, type PrepareInputOptions, type PrepareToolsOptions, type PreparedAgentInput, type PreparedAgentTools, type PreparedCompactionPromptInput, type ProductionRuntimeOverrides, type ResolveConnectionCredentialInput, type ResolveConnectionCredentialResult, type RigInstructionsContext, type RigSetupDescriptor, type RunAgentStreamOptions, RunCredentialSessionReady, RuntimeMetricsHooks, SUMMARY_BUFFER_TOKENS, SUMMARY_PREFIX, SandboxComputer, type SandboxComputerOptions, type SandboxFileDownload, type SandboxFileDownloadFailure, type SandboxFileDownloadMaterializationResult, type SandboxLifecycleCommandRunner, type SandboxLifecycleHook, type SandboxLifecycleHookContext, type SandboxLifecycleHookPhase, type SerializedHumanInputInterruption, TOOLSPACE_PROGRAMMATIC_DIRECTIVE, type ToolspaceTokenWriterSession, type TurnSandboxCommandArgs, TurnSandboxCommandCancelledError, type TurnSandboxCommandSession, type TurnToolCancellationController, type TurnToolCancellationFence, USER_MESSAGE_TRUNCATION_MARKER, type WorkspaceEnvironmentContext, WorkspaceModelPolicyBlockedError, agentsErrorRunState, appendGenesisTitleDirective, appendGitCredentialBindingInstructions, appendPersistentSessionSettings, appendSessionInstructions, appendToolspaceInstructions, appendTurnInstructions, appendWorkspaceMemory, applyMissingManifestEntries, azureCliLoginCommand, azureOpenAIDefaultQuery, boundModelToolOutputsFilterForSettings, buildAgentCapabilities, buildCompactionPromptInput, buildCompactionReplacementHistory, buildManifest, buildModelInstance, buildOpenAIClientFromSettings, buildOpenGeniAgent, buildProviderClient, buildSummaryItem, callModelInputFilterForSettings, clampCompactionThresholdRatio, compactionProviderFailureDiagnostics, compactionReplacementFingerprint, compactionResponseDiagnostics, compactionThresholdTokens, composeAgentInstructions, computerUse, configureOpenAI, configureRuntimeMetricsHooks, connectMcpServersInBatches, contextRobustnessFilterForSettings, coreInstructions, createProductionAgentRuntime, createTurnToolCancellationController, decideCompaction, effectiveSkillSelectionsForAgent, elideSupersededViewImagePairs, elideSupersededViewImagesFilter, ensureReadableStreamFrom, estimateCompleteModelInput, estimateItemTokens, estimateSerializedValueTokens, estimateTokens, extractResponseOutputText, findCompactionNeededError, gitCredentialBindingHash, gitCredentialBindingTokenRefreshCommand, gitProviderTokenRefreshCommand, hasModelGeneratedItem, isCompactionSummary, isUserMessage, latestCompactionReplacementFingerprint, lazySkillSourceWithPackSkills, manifestEnvironmentDrift, materializeSandboxFileDownloads, maxTurnsExceededRunState, mcpToolErrorOutput, modelCallUsageTelemetry, modelResponseUsageFromResponse, modelResponseUsageFromSdkEvent, modelUsageTokenCountOrNull, neutralizeToolSearchItemsInSerializedRunState, normalizeComputerCallsFilter, normalizeModelCallUsage, normalizeSdkEvent, normalizeToolOutputForEvent, oneShotGenesisTitleInputFilter, pinProvidedSessionManifestEnvironment, prefixedMcpToolName, prepareAgentTools, prepareCompactionPromptInput, prepareRunInput, refreshGitCredentialBindingTokenFiles, refreshGitProviderTokenFiles, refreshToolspaceTokenFile, renderCompactionPromptInputForChat, repositoryCloneCommand, repositoryUsesSandboxClone, repositoryWorkspaceSkillPathsOption, resolveTurnModel, rigInstructions, rigSetupScriptCommand, runAgentStream, runAzureCliLoginHook, runBeforeAgentStartHooks, runOwnedSandboxSetup, runRepositoryCloneHook, runRigSetupHook, runToolspaceTokenSeedHook, sandboxCommandExitCode, sandboxCommandOutput, sandboxCommandStillRunning, sandboxFileDownloadFailureNote, sandboxFileDownloadsForAgent, sandboxLifecycleHooksForIds, sandboxRunAs, sanitizeHistoryItemsForModel, serializeApprovals, serializeHumanInputRequests, stripProviderItemIdsFilter, stripReasoningEncryptedContent, stripReasoningIdentityFromSerializedRunState, summarizeForCompaction, toolspaceTokenSeedCommand, withManifestRefreshOnResume, withSandboxFileDownloads, withSandboxLifecycleHooks, withStructuredViewImageFunctionResults, workspaceEnvironmentInstructions };
|
package/dist/index.js
CHANGED
|
@@ -150,6 +150,7 @@ import {
|
|
|
150
150
|
serializeEstablishedSandboxEnvelope,
|
|
151
151
|
serializeReplacementSandboxEnvelope,
|
|
152
152
|
setSelfhostedApplyDiff,
|
|
153
|
+
shellToolspacePath,
|
|
153
154
|
startRecording,
|
|
154
155
|
stopRecording,
|
|
155
156
|
stripExecBanner,
|
|
@@ -175,7 +176,7 @@ import {
|
|
|
175
176
|
withToolspaceTokenEnvironment,
|
|
176
177
|
withToolspaceTokenSession,
|
|
177
178
|
wrapCapabilityToolsForTurnCancellation
|
|
178
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-HHWIZHQM.js";
|
|
179
180
|
import {
|
|
180
181
|
getSkillLibraryEntry,
|
|
181
182
|
isSkillLibraryEntryId,
|
|
@@ -267,6 +268,7 @@ import {
|
|
|
267
268
|
approvalIdentifier,
|
|
268
269
|
CAPABILITY_DESCRIPTORS as CAPABILITY_DESCRIPTORS2,
|
|
269
270
|
DEFAULT_FIRST_PARTY_MCP_PERMISSIONS,
|
|
271
|
+
DEFAULT_FIRST_PARTY_MCP_TOOLS,
|
|
270
272
|
assertUniqueResourceMountPaths,
|
|
271
273
|
gitCredentialBindingIdForRepository,
|
|
272
274
|
gitCredentialProviderForRepository,
|
|
@@ -7225,9 +7227,6 @@ function isUserMessage(item) {
|
|
|
7225
7227
|
function isCompactionSummary(item) {
|
|
7226
7228
|
return isUserMessage(item) && item[COMPACTION_SUMMARY_MARKER] === true;
|
|
7227
7229
|
}
|
|
7228
|
-
function isEphemeralInternalContext(item) {
|
|
7229
|
-
return itemType2(item) === "message" && itemRole(item) === "system";
|
|
7230
|
-
}
|
|
7231
7230
|
function estimateTextTokens(text) {
|
|
7232
7231
|
let asciiCodeUnits = 0;
|
|
7233
7232
|
let nonAsciiCodeUnits = 0;
|
|
@@ -10487,6 +10486,7 @@ async function signFirstPartyDelegatedBearer(settings, options) {
|
|
|
10487
10486
|
subjectId: options.subjectId ?? "worker:first-party-mcp",
|
|
10488
10487
|
...options.subjectLabel ? { subjectLabel: options.subjectLabel } : {},
|
|
10489
10488
|
permissions: options.firstPartyPermissions ?? [...DEFAULT_FIRST_PARTY_MCP_PERMISSIONS],
|
|
10489
|
+
firstPartyMcpTools: options.firstPartyTools ?? [...DEFAULT_FIRST_PARTY_MCP_TOOLS],
|
|
10490
10490
|
...options.sessionId ? { sessionId: options.sessionId } : {},
|
|
10491
10491
|
...options.turnId ? { turnId: options.turnId } : {},
|
|
10492
10492
|
...options.attemptId ? { attemptId: options.attemptId } : {},
|
|
@@ -12967,8 +12967,8 @@ function toolspaceTokenSeedCommand(options = {}) {
|
|
|
12967
12967
|
'if [ -n "${OPENGENI_TOOLSPACE_TOKEN_SEED:-}" ]; then',
|
|
12968
12968
|
' seed_umask="$(umask)"',
|
|
12969
12969
|
" umask 077",
|
|
12970
|
-
options.tokenFile ? ` token_file=${
|
|
12971
|
-
options.legacyTokenFile ? ` legacy_token_file=${
|
|
12970
|
+
options.tokenFile ? ` token_file=${shellToolspacePath(options.tokenFile)}` : ' token_file="${OPENGENI_TOOLSPACE_TOKEN_FILE:-$HOME/.opengeni/toolspace-token}"',
|
|
12971
|
+
options.legacyTokenFile ? ` legacy_token_file=${shellToolspacePath(options.legacyTokenFile)}` : ' legacy_token_file=""',
|
|
12972
12972
|
' mkdir -p "$(dirname "$token_file")"',
|
|
12973
12973
|
` printf '%s' "$OPENGENI_TOOLSPACE_TOKEN_SEED" > "$token_file.tmp.$$"`,
|
|
12974
12974
|
' mv -f "$token_file.tmp.$$" "$token_file"',
|
|
@@ -13800,7 +13800,6 @@ export {
|
|
|
13800
13800
|
hasPersistableSandboxProviderIdentity,
|
|
13801
13801
|
inspectRecordingArtifact,
|
|
13802
13802
|
isCompactionSummary,
|
|
13803
|
-
isEphemeralInternalContext,
|
|
13804
13803
|
isExecSessionLostBanner,
|
|
13805
13804
|
isProviderSandboxGoneDuringRoutedOperation,
|
|
13806
13805
|
isProviderSandboxNotFoundError,
|