@constal/sdk 3.9.0 → 3.11.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/package.json +1 -1
- package/publish/api.json +6 -1
- package/publish/index.d.ts +27 -7
- package/publish/index.js +135 -65
package/package.json
CHANGED
package/publish/api.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@constal/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"exports": [
|
|
5
5
|
"AGENT_UI_DEFAULTS",
|
|
6
6
|
"Action",
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
"EVALUATION_LIMITS",
|
|
148
148
|
"EffectCeilingExceeded",
|
|
149
149
|
"EffectClass",
|
|
150
|
+
"EmptyJoin",
|
|
150
151
|
"EvalComparison",
|
|
151
152
|
"EvalDivergence",
|
|
152
153
|
"EvalMode",
|
|
@@ -213,6 +214,7 @@
|
|
|
213
214
|
"InvocationHandle",
|
|
214
215
|
"InvokableKind",
|
|
215
216
|
"InvokeOpts",
|
|
217
|
+
"JoinOutcome",
|
|
216
218
|
"JsonScalar",
|
|
217
219
|
"JsonValue",
|
|
218
220
|
"LabelRequest",
|
|
@@ -458,6 +460,7 @@
|
|
|
458
460
|
"agentSetupRequirements",
|
|
459
461
|
"agentUiBundleManifest",
|
|
460
462
|
"agentUiDeclaration",
|
|
463
|
+
"all",
|
|
461
464
|
"analyticsEvent",
|
|
462
465
|
"approximateTokens",
|
|
463
466
|
"authProvider",
|
|
@@ -536,6 +539,7 @@
|
|
|
536
539
|
"parseResourceName",
|
|
537
540
|
"policy",
|
|
538
541
|
"policyName",
|
|
542
|
+
"race",
|
|
539
543
|
"renderTrainingCompletion",
|
|
540
544
|
"resolveBindingOwner",
|
|
541
545
|
"resolveContainerImageSource",
|
|
@@ -557,6 +561,7 @@
|
|
|
557
561
|
"scopedResourceRef",
|
|
558
562
|
"scoreLevel",
|
|
559
563
|
"scorerName",
|
|
564
|
+
"select",
|
|
560
565
|
"selectableResourceLabels",
|
|
561
566
|
"setupAwait",
|
|
562
567
|
"setupCredentialReceipt",
|
package/publish/index.d.ts
CHANGED
|
@@ -655,7 +655,7 @@ interface ModelGatewayConfig {
|
|
|
655
655
|
providerAuth?: ModelCredentialHeader | null;
|
|
656
656
|
}
|
|
657
657
|
type NormalizedModelGatewayConfig = Omit<ModelGatewayConfig, "maxOutputTokens" | "temperature" | "gatewayAuth" | "providerAuth"> & {
|
|
658
|
-
maxOutputTokens: number;
|
|
658
|
+
maxOutputTokens: number | null;
|
|
659
659
|
temperature: number | null;
|
|
660
660
|
gatewayAuth: ModelCredentialHeader | null;
|
|
661
661
|
providerAuth: ModelCredentialHeader | null;
|
|
@@ -702,7 +702,7 @@ declare function modelPrompt(args: ModelInvocationArgs): string;
|
|
|
702
702
|
/** The messages of one turn: the static objective and context first, then each earlier exchange as its own message, then
|
|
703
703
|
* feedback about the previous attempt. Without history this is the single prompt message it always was. */
|
|
704
704
|
declare function modelMessages(args: ModelInvocationArgs): ModelHistoryMessage[];
|
|
705
|
-
declare function modelProtocolRequest(protocol: ModelGatewayProtocol, model: string, maxOutputTokens: number, temperature: number | null, args: ModelInvocationArgs): Record<string, unknown>;
|
|
705
|
+
declare function modelProtocolRequest(protocol: ModelGatewayProtocol, model: string, maxOutputTokens: number | null, temperature: number | null, args: ModelInvocationArgs): Record<string, unknown>;
|
|
706
706
|
declare function modelProtocolResult(protocol: ModelGatewayProtocol, raw: unknown, provider: string, model: string): ModelInvocationResult;
|
|
707
707
|
|
|
708
708
|
interface GatewayCredentialSlotSetup {
|
|
@@ -1756,8 +1756,10 @@ interface SandboxWorkspace {
|
|
|
1756
1756
|
exec(input: SandboxExecInput, opts?: InvokeOpts): InvocationHandle<SandboxCommandResult>;
|
|
1757
1757
|
/** Admit ordinary exec without waiting for exit. Readiness is observable via I/O. */
|
|
1758
1758
|
openProcess(input: SandboxExecInput, opts?: InvokeOpts): Promise<SandboxProcess>;
|
|
1759
|
-
/**
|
|
1760
|
-
resolveProcess(
|
|
1759
|
+
/** Find an active process by key, or reattach by ID, including after exit. Both require this Run's ownership. */
|
|
1760
|
+
resolveProcess(selector: string | {
|
|
1761
|
+
id: string;
|
|
1762
|
+
}, opts?: InvokeOpts): Promise<SandboxProcess | null>;
|
|
1761
1763
|
readFile(path: string, options?: SandboxReadFileOptions): Promise<SandboxReadFileResult>;
|
|
1762
1764
|
writeFile(path: string, content: string, options?: {
|
|
1763
1765
|
mode?: number;
|
|
@@ -2769,6 +2771,24 @@ interface AgentDef<S = unknown> {
|
|
|
2769
2771
|
}
|
|
2770
2772
|
type Agent<S = unknown> = AgentDef<S>;
|
|
2771
2773
|
|
|
2774
|
+
declare class EmptyJoin extends Error {
|
|
2775
|
+
constructor(message: string);
|
|
2776
|
+
}
|
|
2777
|
+
type JoinOutcome<T> = {
|
|
2778
|
+
ok: true;
|
|
2779
|
+
value: T;
|
|
2780
|
+
} | {
|
|
2781
|
+
ok: false;
|
|
2782
|
+
error: unknown;
|
|
2783
|
+
};
|
|
2784
|
+
declare function select<T>(handles: Handle<T>[]): Promise<{
|
|
2785
|
+
index: number;
|
|
2786
|
+
} & JoinOutcome<T>>;
|
|
2787
|
+
declare function all<T>(handles: Handle<T>[]): Promise<T[]>;
|
|
2788
|
+
declare function race<T>(handles: Handle<T>[], opts?: {
|
|
2789
|
+
win: "first" | "first-success";
|
|
2790
|
+
}): Promise<T>;
|
|
2791
|
+
|
|
2772
2792
|
interface SkillDescription {
|
|
2773
2793
|
id: string;
|
|
2774
2794
|
description?: string;
|
|
@@ -3251,7 +3271,7 @@ interface SetupSubmission {
|
|
|
3251
3271
|
}
|
|
3252
3272
|
/** A panel names its provider by CRN, or by a platform capability name the platform resolves to one published provider. */
|
|
3253
3273
|
declare function setupPanelProviderIsCrn(provider: string): boolean;
|
|
3254
|
-
/** Validates the
|
|
3274
|
+
/** Validates the presentation artifact consumed by trusted Console renderers. */
|
|
3255
3275
|
declare function setupScreen(value: unknown): SetupScreen;
|
|
3256
3276
|
/** Validates one response against the exact open screen revision and form schema. */
|
|
3257
3277
|
declare function setupSubmission(value: unknown, screen: SetupScreen): SetupSubmission;
|
|
@@ -4603,5 +4623,5 @@ declare class SessionDeleted extends Error {
|
|
|
4603
4623
|
constructor(session: string);
|
|
4604
4624
|
}
|
|
4605
4625
|
|
|
4606
|
-
export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseResourceName, policy, policyName, renderTrainingCompletion, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, sandboxControls, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerName, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
|
|
4607
|
-
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeliveryReceipt, AgentDeployPolicy, AgentResultDelivery, AgentSendOpts, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AgentUiDeclaration, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundOperation, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelContext, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, ChoiceAnswer, ChoiceQuestion, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ContainerImageReference, ContainerImageSelection, ContainerImageSource, ContainerRegistryRequest, ContainerRegistryResponse, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvaluationAnswer, EvaluationAnswerFor, EvaluationAnswers, EvaluationEntry, EvaluationInvocationArgs, EvaluationInvocationResult, EvaluationProtocol, EvaluationQuestion, EvaluationQuestions, EvaluationRecord, EvaluationSpec, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerEvent, ListSchedulesOptions, LoadedSkill, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelInvocationArgs, ModelInvocationResult, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, NoulAnswer, NoulQuestion, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandCollectionError, SandboxCommandExecution, SandboxCommandResult, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, SandboxWriteFileResult, Schedule, ScheduleCancellation, ScheduleDuration, ScheduleMissed, ScheduleOccurrence, ScheduleOccurrencePage, ScheduleOptions, SchedulePage, ScheduleState, ScheduleTarget, ScheduleTiming, ScheduleTrigger, ScheduleWhen, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreAnswer, ScoreQuestion, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Skill, SkillDescription, SkillLibrary, SkillSource, SortField, SpawnAttenuation, SpawnBudget, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingUsageUnits, TurnDraft, TurnGate, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
|
|
4626
|
+
export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, all, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseResourceName, policy, policyName, race, renderTrainingCompletion, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, sandboxControls, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
|
|
4627
|
+
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeliveryReceipt, AgentDeployPolicy, AgentResultDelivery, AgentSendOpts, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AgentUiDeclaration, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundOperation, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelContext, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, ChoiceAnswer, ChoiceQuestion, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ContainerImageReference, ContainerImageSelection, ContainerImageSource, ContainerRegistryRequest, ContainerRegistryResponse, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvaluationAnswer, EvaluationAnswerFor, EvaluationAnswers, EvaluationEntry, EvaluationInvocationArgs, EvaluationInvocationResult, EvaluationProtocol, EvaluationQuestion, EvaluationQuestions, EvaluationRecord, EvaluationSpec, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerEvent, ListSchedulesOptions, LoadedSkill, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelInvocationArgs, ModelInvocationResult, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, NoulAnswer, NoulQuestion, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandCollectionError, SandboxCommandExecution, SandboxCommandResult, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, SandboxWriteFileResult, Schedule, ScheduleCancellation, ScheduleDuration, ScheduleMissed, ScheduleOccurrence, ScheduleOccurrencePage, ScheduleOptions, SchedulePage, ScheduleState, ScheduleTarget, ScheduleTiming, ScheduleTrigger, ScheduleWhen, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreAnswer, ScoreQuestion, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Skill, SkillDescription, SkillLibrary, SkillSource, SortField, SpawnAttenuation, SpawnBudget, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingUsageUnits, TurnDraft, TurnGate, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
|
package/publish/index.js
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
+
// packages/sdk/src/joins.ts
|
|
2
|
+
var EmptyJoin = class extends Error {
|
|
3
|
+
constructor(message2) {
|
|
4
|
+
super(message2);
|
|
5
|
+
this.name = "EmptyJoin";
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
var settled = (handle) => Promise.resolve(handle.then(
|
|
9
|
+
() => void 0,
|
|
10
|
+
(error) => {
|
|
11
|
+
if (error && typeof error === "object" && ("durableSuspension" in error && error.durableSuspension === true || "durableInterruption" in error && error.durableInterruption === true)) throw error;
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
var bySeq = (handles) => handles.map((handle, index) => ({ handle, index })).filter((item) => item.handle.resolved).sort((left, right) => left.handle.seq - right.handle.seq);
|
|
16
|
+
async function admit(handles) {
|
|
17
|
+
await Promise.all(handles.map(async (handle) => {
|
|
18
|
+
const start = handle.start;
|
|
19
|
+
if (!start) return;
|
|
20
|
+
try {
|
|
21
|
+
await start.call(handle);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
if (!handle.resolved) throw error;
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
async function outcome(handle) {
|
|
28
|
+
try {
|
|
29
|
+
return { ok: true, value: await handle };
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (error && typeof error === "object" && ("durableSuspension" in error && error.durableSuspension === true || "durableInterruption" in error && error.durableInterruption === true)) throw error;
|
|
32
|
+
return { ok: false, error };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function select(handles) {
|
|
36
|
+
if (handles.length === 0) throw new EmptyJoin("select: no handles");
|
|
37
|
+
await admit(handles);
|
|
38
|
+
const first = bySeq(handles)[0];
|
|
39
|
+
if (first) {
|
|
40
|
+
return { index: first.index, ...await outcome(first.handle) };
|
|
41
|
+
}
|
|
42
|
+
await Promise.race(handles.map(settled));
|
|
43
|
+
return select(handles);
|
|
44
|
+
}
|
|
45
|
+
async function all(handles) {
|
|
46
|
+
await admit(handles);
|
|
47
|
+
if (handles.every((handle) => handle.resolved)) return Promise.all(handles);
|
|
48
|
+
await Promise.all(handles.filter((handle) => !handle.resolved).map(settled));
|
|
49
|
+
return all(handles);
|
|
50
|
+
}
|
|
51
|
+
async function race(handles, opts = { win: "first" }) {
|
|
52
|
+
if (handles.length === 0) throw new EmptyJoin("race: no handles");
|
|
53
|
+
await admit(handles);
|
|
54
|
+
const failures = [];
|
|
55
|
+
for (const { handle: winner } of bySeq(handles)) {
|
|
56
|
+
const result = await outcome(winner);
|
|
57
|
+
if (!result.ok && opts.win === "first-success") {
|
|
58
|
+
failures.push(result.error);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
for (const handle of handles) if (handle !== winner && !handle.resolved) await handle.cancel();
|
|
62
|
+
if (!result.ok) throw result.error;
|
|
63
|
+
return result.value;
|
|
64
|
+
}
|
|
65
|
+
if (handles.every((handle) => handle.resolved)) throw new AggregateError(failures, "race: every candidate failed");
|
|
66
|
+
await Promise.race(handles.filter((handle) => !handle.resolved).map(settled));
|
|
67
|
+
return race(handles, opts);
|
|
68
|
+
}
|
|
69
|
+
|
|
1
70
|
// packages/sdk/src/hash.ts
|
|
2
71
|
var encoder = new TextEncoder();
|
|
3
72
|
function canonicalNumber(value) {
|
|
@@ -269,7 +338,6 @@ var TYPES = /* @__PURE__ */ new Set(["null", "boolean", "object", "array", "numb
|
|
|
269
338
|
function validateJsonSchemaDefinition(schema, path = "$schema", depth = 0) {
|
|
270
339
|
if (schema === true || schema === false) return null;
|
|
271
340
|
if (!schema || typeof schema !== "object" || Array.isArray(schema)) return `${path} must be an object or boolean schema`;
|
|
272
|
-
if (depth > 32) return `${path} exceeds the schema depth limit`;
|
|
273
341
|
const rule = schema;
|
|
274
342
|
const unknown = Object.keys(rule).find((key) => !KEYWORDS.has(key) && !key.startsWith("x-"));
|
|
275
343
|
if (unknown) return `${path}.${unknown} is not supported`;
|
|
@@ -302,7 +370,7 @@ function validateJsonSchemaDefinition(schema, path = "$schema", depth = 0) {
|
|
|
302
370
|
if (error) return error;
|
|
303
371
|
}
|
|
304
372
|
if (rule.anyOf !== void 0) {
|
|
305
|
-
if (!Array.isArray(rule.anyOf) || rule.anyOf.length === 0
|
|
373
|
+
if (!Array.isArray(rule.anyOf) || rule.anyOf.length === 0) return `${path}.anyOf is invalid`;
|
|
306
374
|
for (const [index, child] of rule.anyOf.entries()) {
|
|
307
375
|
const error = validateJsonSchemaDefinition(child, `${path}.anyOf[${index}]`, depth + 1);
|
|
308
376
|
if (error) return error;
|
|
@@ -531,10 +599,10 @@ function resolveBindingOwner(scope2, context, required2 = true) {
|
|
|
531
599
|
return scope2 === "principal" ? { kind: "principal", principal: name } : { kind: "customer", customer: name };
|
|
532
600
|
}
|
|
533
601
|
function agentSetupRequirements(value, options = {}) {
|
|
534
|
-
if (!Array.isArray(value) || value.length < 1
|
|
602
|
+
if (!Array.isArray(value) || value.length < 1) throw new TypeError("Agent setup requirements are invalid");
|
|
535
603
|
const requirements = value.map((raw) => {
|
|
536
604
|
const item = record2(raw);
|
|
537
|
-
if (!item || typeof item.id !== "string" || !NAME2.test(item.id) || typeof item.title !== "string" || !item.title.trim() || item.
|
|
605
|
+
if (!item || typeof item.id !== "string" || !NAME2.test(item.id) || typeof item.title !== "string" || !item.title.trim() || item.description !== void 0 && typeof item.description !== "string" || item.optional !== void 0 && typeof item.optional !== "boolean" || Object.keys(item).some((key) => !["id", "title", "description", "optional", "resourceKind", "selector", "binding"].includes(key))) {
|
|
538
606
|
throw new TypeError("Agent setup requirement is invalid");
|
|
539
607
|
}
|
|
540
608
|
const selection = resourceSelector({ resourceKind: item.resourceKind, selector: item.selector === void 0 ? {} : item.selector }, RESOURCE_KINDS);
|
|
@@ -599,9 +667,9 @@ function agentUiDeclaration(value) {
|
|
|
599
667
|
if (!source) agentUiInvalid("expected an object");
|
|
600
668
|
agentUiKeys(source, ["id", "displayName", "description", "source", "channel", "access", "execution", "limits", "labels"]);
|
|
601
669
|
if (typeof source.id !== "string" || !AGENT_UI_ID.test(source.id)) agentUiInvalid("id");
|
|
602
|
-
if (typeof source.displayName !== "string" || !source.displayName.trim()
|
|
670
|
+
if (typeof source.displayName !== "string" || !source.displayName.trim()) agentUiInvalid("displayName");
|
|
603
671
|
const description = source.description ?? "";
|
|
604
|
-
if (typeof description !== "string"
|
|
672
|
+
if (typeof description !== "string") agentUiInvalid("description");
|
|
605
673
|
const directory = source.source;
|
|
606
674
|
if (typeof directory !== "string" || !directory || directory.length > 128 || directory.startsWith("/") || directory.includes("\\") || directory.split("/").some((part) => part === "" || part === "." || part === "..")) agentUiInvalid("source");
|
|
607
675
|
if (AGENT_UI_RESERVED_SOURCE_ROOTS.includes(directory.split("/")[0])) agentUiInvalid("source is a reserved directory");
|
|
@@ -822,7 +890,7 @@ function resourceCredentialBinding(value) {
|
|
|
822
890
|
function invocationCredentialUses(value) {
|
|
823
891
|
if (value === void 0) return {};
|
|
824
892
|
const source = record2(value);
|
|
825
|
-
if (!source
|
|
893
|
+
if (!source) throw new TypeError("invocation Credential selections are invalid");
|
|
826
894
|
const result = {};
|
|
827
895
|
for (const [slot, raw] of Object.entries(source).sort(([left], [right]) => left.localeCompare(right))) {
|
|
828
896
|
const use = record2(raw), consumer = record2(use?.consumer);
|
|
@@ -979,7 +1047,7 @@ function modelAdvertisedPricing(value) {
|
|
|
979
1047
|
return candidate;
|
|
980
1048
|
}
|
|
981
1049
|
function resourceNeed(need) {
|
|
982
|
-
if (!NAME2.test(need.binding) || !RESOURCE_KIND_SET.has(need.kind) || need.ops !== void 0 && (!Array.isArray(need.ops) || need.ops.length === 0 || need.ops.
|
|
1050
|
+
if (!NAME2.test(need.binding) || !RESOURCE_KIND_SET.has(need.kind) || need.ops !== void 0 && (!Array.isArray(need.ops) || need.ops.length === 0 || need.ops.some((op) => !OPERATION.test(op)))) throw new TypeError("resource need is invalid");
|
|
983
1051
|
return need;
|
|
984
1052
|
}
|
|
985
1053
|
function ipv4(value) {
|
|
@@ -1006,7 +1074,7 @@ var RESERVED_IPV4 = [
|
|
|
1006
1074
|
[ipv4("240.0.0.0"), 4]
|
|
1007
1075
|
];
|
|
1008
1076
|
function normalizeCidrs(values, allowPrivate) {
|
|
1009
|
-
if (!Array.isArray(values) || values.length === 0
|
|
1077
|
+
if (!Array.isArray(values) || values.length === 0) throw new TypeError("sandbox network CIDRs must contain at least one entry");
|
|
1010
1078
|
const entries = values.map((raw) => {
|
|
1011
1079
|
if (typeof raw !== "string") throw new TypeError("sandbox network CIDR is invalid");
|
|
1012
1080
|
const match = raw.trim().match(/^([^/]+)\/(0|[1-9]|[12][0-9]|3[0-2])$/u);
|
|
@@ -1032,7 +1100,7 @@ function normalizeCidrs(values, allowPrivate) {
|
|
|
1032
1100
|
return result.map((entry2) => entry2.text);
|
|
1033
1101
|
}
|
|
1034
1102
|
function normalizeDomains(values) {
|
|
1035
|
-
if (!Array.isArray(values) || values.length === 0
|
|
1103
|
+
if (!Array.isArray(values) || values.length === 0) throw new TypeError("sandbox network domains must contain at least one entry");
|
|
1036
1104
|
const domains = values.map((raw) => {
|
|
1037
1105
|
if (typeof raw !== "string" || raw !== raw.trim() || /[:/?#@]/u.test(raw)) throw new TypeError("sandbox network domain is invalid");
|
|
1038
1106
|
const wildcard2 = raw.startsWith("*.");
|
|
@@ -1049,9 +1117,9 @@ function normalizeDomains(values) {
|
|
|
1049
1117
|
}
|
|
1050
1118
|
return `${wildcard2 ? "*." : ""}${hostname}`;
|
|
1051
1119
|
}).sort();
|
|
1052
|
-
return [...new Set(domains)].filter((domain, index,
|
|
1120
|
+
return [...new Set(domains)].filter((domain, index, all2) => {
|
|
1053
1121
|
const bare = domain.startsWith("*.") ? domain.slice(2) : domain;
|
|
1054
|
-
return !
|
|
1122
|
+
return !all2.some((candidate, candidateIndex) => candidateIndex !== index && candidate.startsWith("*.") && (bare === candidate.slice(2) || bare.endsWith(`.${candidate.slice(2)}`)));
|
|
1055
1123
|
});
|
|
1056
1124
|
}
|
|
1057
1125
|
function normalizeSandboxNetworkPolicy(value, options = {}) {
|
|
@@ -1419,33 +1487,32 @@ function channelIngressRequest(value) {
|
|
|
1419
1487
|
|
|
1420
1488
|
// packages/sdk/src/setup-workflow.ts
|
|
1421
1489
|
var ID = /^[a-z0-9][a-z0-9-]{0,62}$/u;
|
|
1422
|
-
var MAX_SCREEN_BYTES = 262144;
|
|
1423
1490
|
function record3(value) {
|
|
1424
1491
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
1425
1492
|
}
|
|
1426
|
-
function text(value,
|
|
1427
|
-
return typeof value === "string" &&
|
|
1493
|
+
function text(value, allowEmpty = false) {
|
|
1494
|
+
return typeof value === "string" && (allowEmpty || value.trim().length > 0) ? value : null;
|
|
1428
1495
|
}
|
|
1429
1496
|
function exact(value, fields) {
|
|
1430
1497
|
return Object.keys(value).every((key) => fields.includes(key));
|
|
1431
1498
|
}
|
|
1432
1499
|
function action2(value) {
|
|
1433
1500
|
const source = record3(value);
|
|
1434
|
-
const id2 = text(source?.id
|
|
1435
|
-
const label = text(source?.label
|
|
1501
|
+
const id2 = text(source?.id);
|
|
1502
|
+
const label = text(source?.label);
|
|
1436
1503
|
if (!source || !id2 || !ID.test(id2) || !label || !["primary", "secondary", "danger"].includes(String(source.intent)) || !exact(source, ["id", "label", "intent"])) return null;
|
|
1437
1504
|
return { id: id2, label, intent: source.intent };
|
|
1438
1505
|
}
|
|
1439
1506
|
function actions(value) {
|
|
1440
|
-
if (!Array.isArray(value)
|
|
1507
|
+
if (!Array.isArray(value)) return null;
|
|
1441
1508
|
const parsed = value.map(action2);
|
|
1442
1509
|
if (parsed.some((item) => !item) || new Set(parsed.map((item) => item.id)).size !== parsed.length) return null;
|
|
1443
1510
|
return parsed;
|
|
1444
1511
|
}
|
|
1445
1512
|
function panelBase(source) {
|
|
1446
|
-
const id2 = text(source.id
|
|
1447
|
-
const title = text(source.title
|
|
1448
|
-
const description = text(source.description,
|
|
1513
|
+
const id2 = text(source.id);
|
|
1514
|
+
const title = text(source.title);
|
|
1515
|
+
const description = text(source.description, true);
|
|
1449
1516
|
const parsedActions = actions(source.actions);
|
|
1450
1517
|
return id2 && ID.test(id2) && title && description !== null && parsedActions ? { id: id2, title, description, actions: parsedActions } : null;
|
|
1451
1518
|
}
|
|
@@ -1457,12 +1524,12 @@ function panel(value) {
|
|
|
1457
1524
|
if (source.kind === "form") {
|
|
1458
1525
|
const schema = record3(source.schema);
|
|
1459
1526
|
const initialValues = source.initialValues === void 0 ? void 0 : record3(source.initialValues);
|
|
1460
|
-
if (!schema || validateJsonSchemaDefinition(schema, "$setup.current.schema") || schema.type !== "object" || schema.additionalProperties !== false ||
|
|
1527
|
+
if (!schema || validateJsonSchemaDefinition(schema, "$setup.current.schema") || schema.type !== "object" || schema.additionalProperties !== false || initialValues === null || initialValues && validateJsonSchema(initialValues, schema) || !exact(source, ["kind", "id", "title", "description", "actions", "schema", "initialValues"])) return null;
|
|
1461
1528
|
return { ...base, kind: "form", schema, ...initialValues ? { initialValues } : {} };
|
|
1462
1529
|
}
|
|
1463
1530
|
if (source.kind === "credential-interaction") {
|
|
1464
|
-
const provider = text(source.provider
|
|
1465
|
-
const credentialId = text(source.credentialId
|
|
1531
|
+
const provider = text(source.provider);
|
|
1532
|
+
const credentialId = text(source.credentialId);
|
|
1466
1533
|
if (!provider || !credentialId || !ID.test(credentialId) || !["connect", "reauthorize", "manage"].includes(String(source.operation)) || source.receipt !== void 0 && !["reference", "evidence"].includes(String(source.receipt)) || source.receipt !== void 0 && base.actions.filter((action3) => action3.intent === "primary").length !== 1 || (source.selection !== void 0 || source.configuration !== void 0) && source.receipt === void 0 || source.configuration !== void 0 && !record3(source.configuration) || !exact(source, ["kind", "id", "title", "description", "actions", "provider", "credentialId", "operation", "receipt", "selection", "configuration"])) return null;
|
|
1467
1534
|
if (setupPanelProviderIsCrn(provider)) {
|
|
1468
1535
|
try {
|
|
@@ -1500,18 +1567,18 @@ function panel(value) {
|
|
|
1500
1567
|
};
|
|
1501
1568
|
}
|
|
1502
1569
|
if (source.kind === "review") {
|
|
1503
|
-
if (!Array.isArray(source.sections) ||
|
|
1570
|
+
if (!Array.isArray(source.sections) || !exact(source, ["kind", "id", "title", "description", "actions", "sections"])) return null;
|
|
1504
1571
|
const sections = [];
|
|
1505
1572
|
for (const rawSection of source.sections) {
|
|
1506
1573
|
const section = record3(rawSection);
|
|
1507
|
-
const id2 = text(section?.id
|
|
1508
|
-
const title = text(section?.title
|
|
1509
|
-
if (!section || !id2 || !ID.test(id2) || !title || !Array.isArray(section.rows) ||
|
|
1574
|
+
const id2 = text(section?.id);
|
|
1575
|
+
const title = text(section?.title);
|
|
1576
|
+
if (!section || !id2 || !ID.test(id2) || !title || !Array.isArray(section.rows) || !exact(section, ["id", "title", "rows"])) return null;
|
|
1510
1577
|
const rows = [];
|
|
1511
1578
|
for (const rawRow of section.rows) {
|
|
1512
1579
|
const row = record3(rawRow);
|
|
1513
|
-
const label = text(row?.label
|
|
1514
|
-
const rowValue = text(row?.value,
|
|
1580
|
+
const label = text(row?.label);
|
|
1581
|
+
const rowValue = text(row?.value, true);
|
|
1515
1582
|
if (!row || !label || rowValue === null || row.tone !== void 0 && !["default", "muted", "warning"].includes(String(row.tone)) || !exact(row, ["label", "value", "tone"])) return null;
|
|
1516
1583
|
rows.push({ label, value: rowValue, ...row.tone ? { tone: row.tone } : {} });
|
|
1517
1584
|
}
|
|
@@ -1520,27 +1587,27 @@ function panel(value) {
|
|
|
1520
1587
|
return { ...base, kind: "review", sections };
|
|
1521
1588
|
}
|
|
1522
1589
|
if (source.kind === "progress") {
|
|
1523
|
-
if (!Array.isArray(source.progress) ||
|
|
1590
|
+
if (!Array.isArray(source.progress) || !exact(source, ["kind", "id", "title", "description", "actions", "progress"])) return null;
|
|
1524
1591
|
const progress = [];
|
|
1525
1592
|
for (const rawItem of source.progress) {
|
|
1526
1593
|
const item = record3(rawItem);
|
|
1527
|
-
const id2 = text(item?.id
|
|
1528
|
-
const label = text(item?.label
|
|
1529
|
-
const detail = item?.detail === void 0 ? void 0 : text(item.detail,
|
|
1594
|
+
const id2 = text(item?.id);
|
|
1595
|
+
const label = text(item?.label);
|
|
1596
|
+
const detail = item?.detail === void 0 ? void 0 : text(item.detail, true);
|
|
1530
1597
|
if (!item || !id2 || !ID.test(id2) || !label || detail === null || !["pending", "running", "complete", "failed"].includes(String(item.status)) || !exact(item, ["id", "label", "status", "detail"])) return null;
|
|
1531
1598
|
progress.push({ id: id2, label, status: item.status, ...detail === void 0 ? {} : { detail } });
|
|
1532
1599
|
}
|
|
1533
1600
|
return { ...base, kind: "progress", progress };
|
|
1534
1601
|
}
|
|
1535
1602
|
if (source.kind === "complete" || source.kind === "blocked") {
|
|
1536
|
-
const summary = text(source.summary
|
|
1603
|
+
const summary = text(source.summary);
|
|
1537
1604
|
const details = source.details === void 0 ? [] : source.details;
|
|
1538
|
-
if (!summary || !Array.isArray(details) ||
|
|
1605
|
+
if (!summary || !Array.isArray(details) || !exact(source, ["kind", "id", "title", "description", "actions", "summary", "details"])) return null;
|
|
1539
1606
|
const parsedDetails = [];
|
|
1540
1607
|
for (const rawDetail of details) {
|
|
1541
1608
|
const detail = record3(rawDetail);
|
|
1542
|
-
const label = text(detail?.label
|
|
1543
|
-
const detailValue = text(detail?.value,
|
|
1609
|
+
const label = text(detail?.label);
|
|
1610
|
+
const detailValue = text(detail?.value, true);
|
|
1544
1611
|
if (!detail || !label || detailValue === null || !exact(detail, ["label", "value"])) return null;
|
|
1545
1612
|
parsedDetails.push({ label, value: detailValue });
|
|
1546
1613
|
}
|
|
@@ -1555,14 +1622,14 @@ function setupScreen(value) {
|
|
|
1555
1622
|
const source = record3(value);
|
|
1556
1623
|
const workflow = record3(source?.workflow);
|
|
1557
1624
|
const current = panel(source?.current);
|
|
1558
|
-
if (!source || source.object !== "constal.setup.screen" || source.version !== 1 || !workflow || !current || !ID.test(String(workflow.id ?? "")) || !text(workflow.version
|
|
1625
|
+
if (!source || source.object !== "constal.setup.screen" || source.version !== 1 || !workflow || !current || !ID.test(String(workflow.id ?? "")) || !text(workflow.version) || !ID.test(String(workflow.targetAgent ?? "")) || !Number.isSafeInteger(source.revision) || Number(source.revision) < 1 || !["active", "blocked", "complete", "cancelled"].includes(String(source.status)) || !text(source.title) || text(source.description, true) === null || !Array.isArray(source.steps) || source.steps.length < 1 || source.waitLabel !== null && !text(source.waitLabel) || !exact(workflow, ["id", "version", "targetAgent"]) || !exact(source, ["object", "version", "workflow", "revision", "status", "title", "description", "steps", "current", "waitLabel"])) {
|
|
1559
1626
|
throw new TypeError("Setup screen is invalid");
|
|
1560
1627
|
}
|
|
1561
1628
|
const parsedSteps = [];
|
|
1562
1629
|
for (const rawStep of source.steps) {
|
|
1563
1630
|
const step = record3(rawStep);
|
|
1564
|
-
const id2 = text(step?.id
|
|
1565
|
-
const label = text(step?.label
|
|
1631
|
+
const id2 = text(step?.id);
|
|
1632
|
+
const label = text(step?.label);
|
|
1566
1633
|
if (!step || !id2 || !ID.test(id2) || !label || !["pending", "current", "complete", "blocked"].includes(String(step.status)) || step.optional !== void 0 && typeof step.optional !== "boolean" || !exact(step, ["id", "label", "status", "optional"])) throw new TypeError("Setup screen step is invalid");
|
|
1567
1634
|
parsedSteps.push({ id: id2, label, status: step.status, ...step.optional === void 0 ? {} : { optional: step.optional } });
|
|
1568
1635
|
}
|
|
@@ -1579,7 +1646,6 @@ function setupScreen(value) {
|
|
|
1579
1646
|
current,
|
|
1580
1647
|
waitLabel: source.waitLabel === null ? null : String(source.waitLabel)
|
|
1581
1648
|
};
|
|
1582
|
-
if (new TextEncoder().encode(canonicalJson(normalized)).byteLength > MAX_SCREEN_BYTES) throw new TypeError("Setup screen exceeds 256 KiB");
|
|
1583
1649
|
return normalized;
|
|
1584
1650
|
}
|
|
1585
1651
|
function setupSubmission(value, screen) {
|
|
@@ -2965,11 +3031,11 @@ var MODEL_EVALUATION_CAPABILITY = {
|
|
|
2965
3031
|
};
|
|
2966
3032
|
function modelGenerationOptions(source) {
|
|
2967
3033
|
const { maxOutputTokens, temperature, effort } = source;
|
|
2968
|
-
if (maxOutputTokens !== void 0 && (!Number.isSafeInteger(maxOutputTokens) || maxOutputTokens < 1
|
|
2969
|
-
throw new TypeError("maxOutputTokens must be
|
|
3034
|
+
if (maxOutputTokens !== void 0 && (!Number.isSafeInteger(maxOutputTokens) || maxOutputTokens < 1)) {
|
|
3035
|
+
throw new TypeError("maxOutputTokens must be a positive safe integer");
|
|
2970
3036
|
}
|
|
2971
|
-
if (temperature !== void 0 && (typeof temperature !== "number" || !Number.isFinite(temperature)
|
|
2972
|
-
throw new TypeError("temperature must be a finite number
|
|
3037
|
+
if (temperature !== void 0 && (typeof temperature !== "number" || !Number.isFinite(temperature))) {
|
|
3038
|
+
throw new TypeError("temperature must be a finite number");
|
|
2973
3039
|
}
|
|
2974
3040
|
if (effort !== void 0 && (typeof effort !== "string" || !effort.trim())) {
|
|
2975
3041
|
throw new TypeError("effort must be a nonempty model-supported string");
|
|
@@ -2994,12 +3060,12 @@ function credentialHeader(value, name) {
|
|
|
2994
3060
|
}
|
|
2995
3061
|
function normalizeModelGatewayConfig(value) {
|
|
2996
3062
|
const source = record7(value);
|
|
2997
|
-
if (!source || typeof source.baseUrl !== "string" || source.
|
|
3063
|
+
if (!source || typeof source.baseUrl !== "string" || source.protocol !== "anthropic" && source.protocol !== "openai" || typeof source.model !== "string" || source.model.length === 0) {
|
|
2998
3064
|
throw new TypeError("model gateway config is invalid");
|
|
2999
3065
|
}
|
|
3000
|
-
const maxOutputTokens = source.maxOutputTokens === void 0 ?
|
|
3066
|
+
const maxOutputTokens = source.maxOutputTokens === void 0 ? null : Number(source.maxOutputTokens);
|
|
3001
3067
|
const temperature = source.temperature === void 0 ? null : Number(source.temperature);
|
|
3002
|
-
if (!Number.isSafeInteger(maxOutputTokens) || maxOutputTokens < 1 ||
|
|
3068
|
+
if (maxOutputTokens !== null && (!Number.isSafeInteger(maxOutputTokens) || maxOutputTokens < 1) || temperature !== null && !Number.isFinite(temperature)) {
|
|
3003
3069
|
throw new TypeError("model gateway generation limits are invalid");
|
|
3004
3070
|
}
|
|
3005
3071
|
const normalized = {
|
|
@@ -3087,7 +3153,7 @@ function modelProtocolRequest(protocol, model, maxOutputTokens, temperature, arg
|
|
|
3087
3153
|
model,
|
|
3088
3154
|
system: args.system ?? "",
|
|
3089
3155
|
messages: alternating(messages),
|
|
3090
|
-
max_tokens: maxOutputTokens,
|
|
3156
|
+
...maxOutputTokens === null ? {} : { max_tokens: maxOutputTokens },
|
|
3091
3157
|
...effort === void 0 ? {} : { output_config: { effort } },
|
|
3092
3158
|
...temperature === null ? {} : { temperature },
|
|
3093
3159
|
...args.tools?.length ? { tools: args.tools.map((tool) => ({ name: tool.name, description: tool.description, input_schema: tool.schema })) } : {},
|
|
@@ -3099,7 +3165,7 @@ function modelProtocolRequest(protocol, model, maxOutputTokens, temperature, arg
|
|
|
3099
3165
|
...args.system ? [{ role: "developer", content: args.system }] : [],
|
|
3100
3166
|
...messages
|
|
3101
3167
|
],
|
|
3102
|
-
max_completion_tokens: maxOutputTokens,
|
|
3168
|
+
...maxOutputTokens === null ? {} : { max_completion_tokens: maxOutputTokens },
|
|
3103
3169
|
...effort === void 0 ? {} : { reasoning_effort: effort },
|
|
3104
3170
|
...temperature === null ? {} : { temperature },
|
|
3105
3171
|
...args.tools?.length ? { tools: args.tools.map((tool) => ({
|
|
@@ -3206,7 +3272,7 @@ function slotMetadata(value) {
|
|
|
3206
3272
|
const output = {};
|
|
3207
3273
|
for (const [slot, raw] of entries) {
|
|
3208
3274
|
const item = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
|
|
3209
|
-
if (!SLOT.test(slot) || !item || typeof item.title !== "string" || !item.title || item.
|
|
3275
|
+
if (!SLOT.test(slot) || !item || typeof item.title !== "string" || !item.title || item.description !== void 0 && typeof item.description !== "string" || item.required !== void 0 && typeof item.required !== "boolean" || item.provider !== void 0 && (typeof item.provider !== "string" || !SLOT.test(item.provider)) || Object.keys(item).some((key) => !["title", "description", "documentationUrl", "required", "provider"].includes(key))) {
|
|
3210
3276
|
throw new TypeError("Gateway Credential slots are invalid");
|
|
3211
3277
|
}
|
|
3212
3278
|
httpsUrl(item.documentationUrl, "Gateway Credential slot documentation URL");
|
|
@@ -3252,7 +3318,7 @@ function checkpointImportRequest(value) {
|
|
|
3252
3318
|
const artifact = source?.artifact && typeof source.artifact === "object" && !Array.isArray(source.artifact) ? source.artifact : null;
|
|
3253
3319
|
const artifactValue = artifact?.value && typeof artifact.value === "object" && !Array.isArray(artifact.value) ? artifact.value : null;
|
|
3254
3320
|
const model = source?.model && typeof source.model === "object" && !Array.isArray(source.model) ? source.model : null;
|
|
3255
|
-
if (!source || typeof source.deploymentId !== "string" || !/^[a-z0-9][a-z0-9._-]{0,127}$/u.test(source.deploymentId) || !provenance || !provider || typeof provider.crn !== "string" || typeof provider.hash !== "string" || !HASH3.test(provider.hash) || Object.keys(provider).some((key) => !["crn", "hash"].includes(key)) || typeof provenance.job !== "string" || !/^[a-z0-9][a-z0-9._-]{0,127}$/u.test(provenance.job) || typeof provenance.baseModel !== "string" || !provenance.baseModel || provenance.baseModel.length > 512 || !checkpoint || !Number.isSafeInteger(checkpoint.step) || Number(checkpoint.step) < 0 || typeof checkpoint.ref !== "string" || !HASH3.test(checkpoint.ref) || typeof checkpoint.format !== "string" || !/^[a-z0-9][a-z0-9._+-]{0,63}$/u.test(checkpoint.format) || checkpoint.createdAt !== null && (!Number.isSafeInteger(checkpoint.createdAt) || Number(checkpoint.createdAt) < 0) || Object.keys(checkpoint).some((key) => !["step", "ref", "format", "createdAt"].includes(key)) || Object.keys(provenance).some((key) => !["provider", "job", "baseModel", "checkpoint"].includes(key)) || !artifact || artifact.ref !== checkpoint.ref || !artifactValue || Object.keys(artifact).some((key) => !["ref", "value"].includes(key)) || !model || typeof model.id !== "string" || !MODEL_RESOURCE_ID.test(model.id) || typeof model.displayName !== "string" || !model.displayName ||
|
|
3321
|
+
if (!source || typeof source.deploymentId !== "string" || !/^[a-z0-9][a-z0-9._-]{0,127}$/u.test(source.deploymentId) || !provenance || !provider || typeof provider.crn !== "string" || typeof provider.hash !== "string" || !HASH3.test(provider.hash) || Object.keys(provider).some((key) => !["crn", "hash"].includes(key)) || typeof provenance.job !== "string" || !/^[a-z0-9][a-z0-9._-]{0,127}$/u.test(provenance.job) || typeof provenance.baseModel !== "string" || !provenance.baseModel || provenance.baseModel.length > 512 || !checkpoint || !Number.isSafeInteger(checkpoint.step) || Number(checkpoint.step) < 0 || typeof checkpoint.ref !== "string" || !HASH3.test(checkpoint.ref) || typeof checkpoint.format !== "string" || !/^[a-z0-9][a-z0-9._+-]{0,63}$/u.test(checkpoint.format) || checkpoint.createdAt !== null && (!Number.isSafeInteger(checkpoint.createdAt) || Number(checkpoint.createdAt) < 0) || Object.keys(checkpoint).some((key) => !["step", "ref", "format", "createdAt"].includes(key)) || Object.keys(provenance).some((key) => !["provider", "job", "baseModel", "checkpoint"].includes(key)) || !artifact || artifact.ref !== checkpoint.ref || !artifactValue || Object.keys(artifact).some((key) => !["ref", "value"].includes(key)) || !model || typeof model.id !== "string" || !MODEL_RESOURCE_ID.test(model.id) || typeof model.displayName !== "string" || !model.displayName || typeof model.temperature !== "number" || !Number.isFinite(model.temperature) || model.temperature < 0 || model.temperature > 2 || Object.keys(model).some((key) => !["id", "displayName", "temperature"].includes(key)) || Object.keys(source).some((key) => !["deploymentId", "source", "artifact", "model"].includes(key))) {
|
|
3256
3322
|
throw new TypeError("checkpoint import request is invalid");
|
|
3257
3323
|
}
|
|
3258
3324
|
try {
|
|
@@ -3283,7 +3349,7 @@ function checkpointDeploymentRequest(value) {
|
|
|
3283
3349
|
var MODEL_ID_CONTROL = /[\u0000-\u001f\u007f]/u;
|
|
3284
3350
|
function gatewayModelOffer(value) {
|
|
3285
3351
|
const source = value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
3286
|
-
if (!source || typeof source.id !== "string" || !source.id || source.id.length > 512 || source.id !== source.id.trim() || MODEL_ID_CONTROL.test(source.id) || typeof source.displayName !== "string" || !source.displayName ||
|
|
3352
|
+
if (!source || typeof source.id !== "string" || !source.id || source.id.length > 512 || source.id !== source.id.trim() || MODEL_ID_CONTROL.test(source.id) || typeof source.displayName !== "string" || !source.displayName || !Number.isSafeInteger(source.contextTokens) || Number(source.contextTokens) <= 0 || !Number.isSafeInteger(source.maxOutputTokens) || Number(source.maxOutputTokens) <= 0 || Number(source.maxOutputTokens) > Number(source.contextTokens) || !Object.hasOwn(source, "pricing") || Object.keys(source).some((key) => ![
|
|
3287
3353
|
"id",
|
|
3288
3354
|
"displayName",
|
|
3289
3355
|
"contextTokens",
|
|
@@ -3330,7 +3396,7 @@ function assertNonSecretGatewayConfig(value, field2 = "config") {
|
|
|
3330
3396
|
}
|
|
3331
3397
|
function gatewayPackageMetadata(value) {
|
|
3332
3398
|
const source = value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
3333
|
-
if (!source || source.lifecycleVersion !== 1 || typeof source.displayName !== "string" || !source.displayName ||
|
|
3399
|
+
if (!source || source.lifecycleVersion !== 1 || typeof source.displayName !== "string" || !source.displayName || typeof source.description !== "string" || !source.description || source.service !== void 0 && (typeof source.service !== "string" || !source.service || source.service.length > 128) || !Array.isArray(source.capabilities) || source.capabilities.length === 0 || source.capabilities.length > 32 || !source.billing || typeof source.billing !== "object" || Array.isArray(source.billing) || !["platform", "tenant"].includes(String(source.billing.upstreamPayer ?? ""))) {
|
|
3334
3400
|
throw new TypeError("Gateway package metadata is invalid");
|
|
3335
3401
|
}
|
|
3336
3402
|
httpsUrl(source.documentationUrl, "Gateway documentation URL");
|
|
@@ -3496,8 +3562,8 @@ function interactionRecord(value) {
|
|
|
3496
3562
|
function exactKeys3(value, allowed) {
|
|
3497
3563
|
return Object.keys(value).every((key) => allowed.includes(key));
|
|
3498
3564
|
}
|
|
3499
|
-
function
|
|
3500
|
-
return typeof value === "string" && value.length > 0
|
|
3565
|
+
function nonemptyText(value) {
|
|
3566
|
+
return typeof value === "string" && value.length > 0;
|
|
3501
3567
|
}
|
|
3502
3568
|
function interactionExpiry(value, sessionExpiresAt) {
|
|
3503
3569
|
if (value === void 0 || value === null) return null;
|
|
@@ -3524,13 +3590,13 @@ function credentialInteractionEvent(value) {
|
|
|
3524
3590
|
function credentialInteractionPrimaryAction(value, origins) {
|
|
3525
3591
|
const action3 = interactionRecord(value);
|
|
3526
3592
|
const event = interactionRecord(action3?.event);
|
|
3527
|
-
if (!action3 || !event || !
|
|
3593
|
+
if (!action3 || !event || !nonemptyText(action3.label) || !exactKeys3(event, ["kind"]) || event.kind !== "continue") {
|
|
3528
3594
|
throw new TypeError("credential interaction primary action is invalid");
|
|
3529
3595
|
}
|
|
3530
3596
|
if (action3.kind === "continue") {
|
|
3531
3597
|
if (!exactKeys3(action3, ["kind", "label", "event"])) throw new TypeError("credential interaction primary action is invalid");
|
|
3532
3598
|
} else if (action3.kind === "open-url") {
|
|
3533
|
-
if (!exactKeys3(action3, ["kind", "label", "url", "event"]) || !
|
|
3599
|
+
if (!exactKeys3(action3, ["kind", "label", "url", "event"]) || !nonemptyText(action3.url)) {
|
|
3534
3600
|
throw new TypeError("credential interaction primary action is invalid");
|
|
3535
3601
|
}
|
|
3536
3602
|
let url;
|
|
@@ -3553,7 +3619,7 @@ function credentialInteractionAction(value, origins, state, sessionExpiresAt) {
|
|
|
3553
3619
|
const expiresAt = action3.kind === "complete" ? null : interactionExpiry(action3.expiresAt, sessionExpiresAt);
|
|
3554
3620
|
if (Number.isNaN(expiresAt)) throw new TypeError("credential interaction action expiry is invalid");
|
|
3555
3621
|
if (action3.kind === "redirect") {
|
|
3556
|
-
if (!exactKeys3(action3, ["kind", "url", "expiresAt"]) || !
|
|
3622
|
+
if (!exactKeys3(action3, ["kind", "url", "expiresAt"]) || !nonemptyText(action3.url)) {
|
|
3557
3623
|
throw new TypeError("credential interaction redirect is invalid");
|
|
3558
3624
|
}
|
|
3559
3625
|
let url;
|
|
@@ -3566,7 +3632,7 @@ function credentialInteractionAction(value, origins, state, sessionExpiresAt) {
|
|
|
3566
3632
|
throw new TypeError("credential interaction redirect is not authorized");
|
|
3567
3633
|
}
|
|
3568
3634
|
} else if (action3.kind === "form") {
|
|
3569
|
-
if (!exactKeys3(action3, ["kind", "schema", "title", "description", "submitLabel", "expiresAt"]) || action3.title !== void 0 && !
|
|
3635
|
+
if (!exactKeys3(action3, ["kind", "schema", "title", "description", "submitLabel", "expiresAt"]) || action3.title !== void 0 && !nonemptyText(action3.title) || action3.description !== void 0 && !nonemptyText(action3.description) || action3.submitLabel !== void 0 && !nonemptyText(action3.submitLabel)) {
|
|
3570
3636
|
throw new TypeError("credential interaction form is invalid");
|
|
3571
3637
|
}
|
|
3572
3638
|
const schemaError = validateJsonSchemaDefinition(action3.schema, "$interaction.form.schema");
|
|
@@ -3575,7 +3641,7 @@ function credentialInteractionAction(value, origins, state, sessionExpiresAt) {
|
|
|
3575
3641
|
throw new TypeError(`credential interaction form schema is invalid${schemaError ? `: ${schemaError}` : ""}`);
|
|
3576
3642
|
}
|
|
3577
3643
|
} else if (action3.kind === "display") {
|
|
3578
|
-
if (!exactKeys3(action3, ["kind", "instructions", "title", "userCode", "primaryAction", "expiresAt"]) || !
|
|
3644
|
+
if (!exactKeys3(action3, ["kind", "instructions", "title", "userCode", "primaryAction", "expiresAt"]) || !nonemptyText(action3.instructions) || action3.title !== void 0 && !nonemptyText(action3.title) || action3.userCode !== void 0 && !nonemptyText(action3.userCode)) {
|
|
3579
3645
|
throw new TypeError("credential interaction display is invalid");
|
|
3580
3646
|
}
|
|
3581
3647
|
credentialInteractionPrimaryAction(action3.primaryAction, origins);
|
|
@@ -3584,7 +3650,7 @@ function credentialInteractionAction(value, origins, state, sessionExpiresAt) {
|
|
|
3584
3650
|
throw new TypeError("credential interaction wait action is invalid");
|
|
3585
3651
|
}
|
|
3586
3652
|
} else {
|
|
3587
|
-
if (!exactKeys3(action3, ["kind", "material", "expiresAt"]) || !
|
|
3653
|
+
if (!exactKeys3(action3, ["kind", "material", "expiresAt"]) || !nonemptyText(action3.material) || action3.expiresAt !== void 0 && action3.expiresAt !== null && (!Number.isSafeInteger(action3.expiresAt) || Number(action3.expiresAt) <= Date.now())) {
|
|
3588
3654
|
throw new TypeError("credential interaction completion is invalid");
|
|
3589
3655
|
}
|
|
3590
3656
|
}
|
|
@@ -3619,7 +3685,7 @@ function credentialProviderSetupMetadata(value, slots) {
|
|
|
3619
3685
|
}
|
|
3620
3686
|
const slot = declaration;
|
|
3621
3687
|
const slotAllowed = /* @__PURE__ */ new Set(["title", "description", "documentationUrl", "input", "accept"]);
|
|
3622
|
-
if (Object.keys(slot).some((key) => !slotAllowed.has(key)) || typeof slot.title !== "string" || !slot.title || slot.
|
|
3688
|
+
if (Object.keys(slot).some((key) => !slotAllowed.has(key)) || typeof slot.title !== "string" || !slot.title || slot.description !== void 0 && (typeof slot.description !== "string" || !slot.description) || slot.input !== void 0 && !["secret", "multiline", "file"].includes(String(slot.input))) {
|
|
3623
3689
|
throw new TypeError("credential provider setup Credential slots are invalid");
|
|
3624
3690
|
}
|
|
3625
3691
|
if (slot.documentationUrl !== void 0) {
|
|
@@ -3641,7 +3707,7 @@ function credentialProviderSetupMetadata(value, slots) {
|
|
|
3641
3707
|
return value;
|
|
3642
3708
|
}
|
|
3643
3709
|
function credentialProvider(definition) {
|
|
3644
|
-
if (!/^[a-z0-9][a-z0-9._-]{0,127}$/u.test(definition.id) || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u.test(definition.version) || !definition.displayName ||
|
|
3710
|
+
if (!/^[a-z0-9][a-z0-9._-]{0,127}$/u.test(definition.id) || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u.test(definition.version) || !definition.displayName || !definition.description || typeof definition.mint !== "function" || definition.verify !== void 0 && typeof definition.verify !== "function" || definition.destroy !== void 0 && typeof definition.destroy !== "function") {
|
|
3645
3711
|
throw new TypeError("credential provider metadata is invalid");
|
|
3646
3712
|
}
|
|
3647
3713
|
if (definition.documentationUrl !== void 0) {
|
|
@@ -4342,6 +4408,7 @@ export {
|
|
|
4342
4408
|
DirectNetworkDenied,
|
|
4343
4409
|
EVALUATION_LIMITS,
|
|
4344
4410
|
EffectCeilingExceeded,
|
|
4411
|
+
EmptyJoin,
|
|
4345
4412
|
GateExhausted,
|
|
4346
4413
|
IntegrationRequestNotSent,
|
|
4347
4414
|
LeaseLost,
|
|
@@ -4381,6 +4448,7 @@ export {
|
|
|
4381
4448
|
agentSetupRequirements,
|
|
4382
4449
|
agentUiBundleManifest,
|
|
4383
4450
|
agentUiDeclaration,
|
|
4451
|
+
all,
|
|
4384
4452
|
analyticsEvent,
|
|
4385
4453
|
approximateTokens,
|
|
4386
4454
|
authProvider,
|
|
@@ -4459,6 +4527,7 @@ export {
|
|
|
4459
4527
|
parseResourceName,
|
|
4460
4528
|
policy,
|
|
4461
4529
|
policyName,
|
|
4530
|
+
race,
|
|
4462
4531
|
renderTrainingCompletion,
|
|
4463
4532
|
resolveBindingOwner,
|
|
4464
4533
|
resolveContainerImageSource,
|
|
@@ -4480,6 +4549,7 @@ export {
|
|
|
4480
4549
|
scopedResourceRef,
|
|
4481
4550
|
scoreLevel,
|
|
4482
4551
|
scorerName,
|
|
4552
|
+
select,
|
|
4483
4553
|
selectableResourceLabels,
|
|
4484
4554
|
setupAwait,
|
|
4485
4555
|
setupCredentialReceipt,
|