@constal/sdk 3.3.0 → 3.3.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/README.md +2 -23
- package/package.json +1 -1
- package/publish/api.json +1 -4
- package/publish/index.d.ts +2 -24
- package/publish/index.js +0 -60
package/README.md
CHANGED
|
@@ -184,30 +184,9 @@ from the upstream model selected by `offer`. Advertised offers use
|
|
|
184
184
|
`{ kind: "manual", model }`, with metadata described by
|
|
185
185
|
`GATEWAY_MODEL_OFFER_SCHEMA`. Generation settings go in `defaults`.
|
|
186
186
|
|
|
187
|
-
##
|
|
187
|
+
## Building images
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
```ts
|
|
192
|
-
const pool = ctx.sandboxPool(ctx.resources.sandbox!);
|
|
193
|
-
const image = await pool.importImage({ reference: "registry.example.com/team/tests:v1" });
|
|
194
|
-
const workspace = await pool.createSandbox(ctx.run.agent.crn, ctx.run.session, { image });
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Imported handles expose `image.source`, including the resolved OCI reference and
|
|
198
|
-
manifest digest. The pool owns provider registration, reuse, and deletion.
|
|
199
|
-
`importSandboxImageInput(value)` validates configuration inputs.
|
|
200
|
-
|
|
201
|
-
Private registries accept `registry: { username, credential }`. The provider
|
|
202
|
-
adapter supplies any required runtime preparation; the same sandbox Driver executes
|
|
203
|
-
it with normal policy, credential delivery, usage, and cancellation. Blaxel images
|
|
204
|
-
receive the sandbox API. Private Daytona images are prepared in the provider
|
|
205
|
-
registry using temporary, scoped push access.
|
|
206
|
-
|
|
207
|
-
Set `cache: false` to request a fresh import. Reuse still checks current source
|
|
208
|
-
access and provider readiness. Image deletion does not delete running sandboxes.
|
|
209
|
-
|
|
210
|
-
Build a working directory with the same sandbox:
|
|
189
|
+
Build and publish a working directory through the bound sandbox:
|
|
211
190
|
|
|
212
191
|
```ts
|
|
213
192
|
const built = await workspace.buildImage({
|
package/package.json
CHANGED
package/publish/api.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@constal/sdk",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"exports": [
|
|
5
5
|
"Action",
|
|
6
6
|
"ActionPattern",
|
|
@@ -97,7 +97,6 @@
|
|
|
97
97
|
"ConstalApiChangeReceipt",
|
|
98
98
|
"ConstalApiOperationReceipt",
|
|
99
99
|
"ConstalApiQueryResult",
|
|
100
|
-
"ContainerImageSource",
|
|
101
100
|
"ControlEvent",
|
|
102
101
|
"Cost",
|
|
103
102
|
"CreateSandboxImageOptions",
|
|
@@ -178,7 +177,6 @@
|
|
|
178
177
|
"Hash",
|
|
179
178
|
"HistoryView",
|
|
180
179
|
"IgnoredChannelEvent",
|
|
181
|
-
"ImportSandboxImageInput",
|
|
182
180
|
"IngressRequest",
|
|
183
181
|
"IngressTarget",
|
|
184
182
|
"IntegrationArtifactEgressRequest",
|
|
@@ -462,7 +460,6 @@
|
|
|
462
460
|
"gatewayPackageMetadata",
|
|
463
461
|
"hash",
|
|
464
462
|
"hashValue",
|
|
465
|
-
"importSandboxImageInput",
|
|
466
463
|
"integrationEgressPolicy",
|
|
467
464
|
"labelSelector",
|
|
468
465
|
"matchesAction",
|
package/publish/index.d.ts
CHANGED
|
@@ -1586,14 +1586,6 @@ interface SandboxProcess {
|
|
|
1586
1586
|
}>;
|
|
1587
1587
|
}
|
|
1588
1588
|
|
|
1589
|
-
/** Immutable OCI source identity, independent of any provider's adapted image format. */
|
|
1590
|
-
interface ContainerImageSource {
|
|
1591
|
-
reference: string;
|
|
1592
|
-
digest: string;
|
|
1593
|
-
mediaType: string;
|
|
1594
|
-
bytes: number;
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
1589
|
/** Build the selected working directory with Docker available in this sandbox. */
|
|
1598
1590
|
interface SandboxImageBuildInput {
|
|
1599
1591
|
context?: string;
|
|
@@ -1631,15 +1623,6 @@ interface CreateSandboxOptions {
|
|
|
1631
1623
|
interface CreateSandboxImageOptions {
|
|
1632
1624
|
cacheKey?: string;
|
|
1633
1625
|
}
|
|
1634
|
-
interface ImportSandboxImageInput {
|
|
1635
|
-
reference: string;
|
|
1636
|
-
/** Reuse a completed, matching provider image. False requests a fresh import. */
|
|
1637
|
-
cache?: boolean;
|
|
1638
|
-
registry?: {
|
|
1639
|
-
username: string;
|
|
1640
|
-
credential: ResourceCredentialBinding;
|
|
1641
|
-
};
|
|
1642
|
-
}
|
|
1643
1626
|
interface SandboxExecInput {
|
|
1644
1627
|
cmd: string;
|
|
1645
1628
|
args?: string[];
|
|
@@ -1775,11 +1758,8 @@ interface SandboxImage {
|
|
|
1775
1758
|
readonly id: string;
|
|
1776
1759
|
readonly pool: SandboxPool;
|
|
1777
1760
|
readonly cacheKey: string | null;
|
|
1778
|
-
readonly source?: ContainerImageSource;
|
|
1779
1761
|
delete(opts?: InvokeOpts): Promise<void>;
|
|
1780
1762
|
}
|
|
1781
|
-
/** Normalize explicit registry input; this does not contact a provider or load credential material. */
|
|
1782
|
-
declare function importSandboxImageInput(value: unknown): ImportSandboxImageInput;
|
|
1783
1763
|
/** Mutable, Agent/Session-scoped workspace backed by a VM or container provider. */
|
|
1784
1764
|
interface Sandbox {
|
|
1785
1765
|
readonly id: string;
|
|
@@ -1810,8 +1790,6 @@ interface Sandbox {
|
|
|
1810
1790
|
/** Provider-neutral factory and owner for images and logical sandboxes. */
|
|
1811
1791
|
interface SandboxPool {
|
|
1812
1792
|
readonly resource: CRN;
|
|
1813
|
-
/** Import an existing registry image into a provider-supported pool. Registry access uses Credential references. */
|
|
1814
|
-
importImage(input: ImportSandboxImageInput, opts?: InvokeOpts): Promise<SandboxImage>;
|
|
1815
1793
|
/** Capture an immutable image from a sandbox owned by this pool. */
|
|
1816
1794
|
createImage(sandbox: Sandbox, options?: CreateSandboxImageOptions, opts?: InvokeOpts): Promise<SandboxImage>;
|
|
1817
1795
|
/** Resolve an Agent-owned prepared image by its immutable environment digest. */
|
|
@@ -4567,5 +4545,5 @@ declare class SessionDeleted extends Error {
|
|
|
4567
4545
|
constructor(session: string);
|
|
4568
4546
|
}
|
|
4569
4547
|
|
|
4570
|
-
export { 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, CONSTAL_MODEL_CREATE_SCHEMA, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EffectCeilingExceeded, GATEWAY_MODEL_OFFER_SCHEMA, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_GENERATION_OPTIONS_SCHEMA, MODEL_GENERATION_OPTION_KEYS, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_PROCESS_CREDENTIALS_SCHEMA, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, analyticsEvent, applyModelProviderOptions, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, connections, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue,
|
|
4571
|
-
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentConnection, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelAlarm, ChannelAlarmResult, ChannelContext, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionDescription, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionSource, ConnectionStatus, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ConstalApiQueryResult,
|
|
4548
|
+
export { 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, CONSTAL_MODEL_CREATE_SCHEMA, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EffectCeilingExceeded, GATEWAY_MODEL_OFFER_SCHEMA, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_GENERATION_OPTIONS_SCHEMA, MODEL_GENERATION_OPTION_KEYS, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_PROCESS_CREDENTIALS_SCHEMA, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, analyticsEvent, applyModelProviderOptions, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, connections, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, integrationEgressPolicy, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpProtocol, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelPrompt, modelProtocolRequest, modelProtocolResult, modelProviderOptions, murmur3_32, normalizeInvocationOptions, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, opTool, opTools, parseResourceName, policy, policyName, renderTrainingCompletion, resolveBindingOwner, resolveGatewayEgress, resolveResourceDependencyRef, resourceContext, resourceContractRef, resourceCredentialBinding, resourceCredentialBindings, resourceDependencyRef, resourceIndex, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, sandboxControls, sandboxImageBuildInput, sandboxLimit, sandboxProcessCredentials, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scorerName, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupScreen, setupScreenView, setupSubmission, sha256Hex, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
|
|
4549
|
+
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentConnection, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelAlarm, ChannelAlarmResult, ChannelContext, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionDescription, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionSource, ConnectionStatus, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ConstalApiQueryResult, 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, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayPackageRef, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryView, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationSecret, IntegrationState, InvocationHandle, InvokableKind, InvokeOpts, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerEvent, LoadedSkill, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpMessage, McpTool, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelInvocationArgs, ModelInvocationResult, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, ProcessConnection, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceConnectionAttempt, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourceOperation, ResourcePattern, ResourceSelector, RollbackReport, RunCapabilities, RunIdentityView, RunInfo, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandResult, SandboxCredentialTargets, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxImageBuildInput, SandboxImageBuildResult, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessReadOptions, SandboxProcessReadResult, SandboxProcessWriteInput, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWriteFileResult, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, 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, SkillSet, 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
|
@@ -3973,46 +3973,6 @@ function credentialProvider(definition2) {
|
|
|
3973
3973
|
return Object.freeze({ ...definition2, mintRecovery, metadata: metadata2 });
|
|
3974
3974
|
}
|
|
3975
3975
|
|
|
3976
|
-
// packages/sdk/src/container-images.ts
|
|
3977
|
-
var REPOSITORY = /^[a-z0-9]+(?:(?:\.|_|__|-+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:\.|_|__|-+)[a-z0-9]+)*)*$/u;
|
|
3978
|
-
function containerImageReference(value) {
|
|
3979
|
-
if (typeof value !== "string" || !value || /[\s?#\\]/u.test(value) || value.includes("://")) throw new TypeError("Container image reference is invalid");
|
|
3980
|
-
const components = value.split("@");
|
|
3981
|
-
if (components.length > 2) throw new TypeError("Container image reference is invalid");
|
|
3982
|
-
let name = components[0];
|
|
3983
|
-
const digest = components[1] ?? null;
|
|
3984
|
-
if (digest !== null && !/^[a-z][a-z0-9+._-]*:[A-Za-z0-9=_-]+$/u.test(digest)) throw new TypeError("Container image digest is invalid");
|
|
3985
|
-
if (digest?.startsWith("sha256:") && !/^sha256:[a-f0-9]{64}$/u.test(digest)) throw new TypeError("Container image SHA-256 digest is invalid");
|
|
3986
|
-
const separator = name.lastIndexOf(":");
|
|
3987
|
-
const tag = separator > name.lastIndexOf("/") ? name.slice(separator + 1) : null;
|
|
3988
|
-
if (tag !== null) {
|
|
3989
|
-
if (!/^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$/u.test(tag)) throw new TypeError("Container image tag is invalid");
|
|
3990
|
-
name = name.slice(0, separator);
|
|
3991
|
-
}
|
|
3992
|
-
const parts = name.split("/");
|
|
3993
|
-
const explicitRegistry = parts.length > 1 && (/[.:]/u.test(parts[0]) || parts[0] === "localhost");
|
|
3994
|
-
const registryInput = explicitRegistry ? parts.shift() : "docker.io";
|
|
3995
|
-
let host;
|
|
3996
|
-
try {
|
|
3997
|
-
host = new URL(`https://${registryInput}`);
|
|
3998
|
-
} catch {
|
|
3999
|
-
throw new TypeError("Container image registry is invalid");
|
|
4000
|
-
}
|
|
4001
|
-
if (host.username || host.password || host.pathname !== "/" || !host.hostname) throw new TypeError("Container image registry is invalid");
|
|
4002
|
-
const registry = host.host === "index.docker.io" ? "docker.io" : host.host;
|
|
4003
|
-
if (registry === "docker.io" && parts.length === 1) parts.unshift("library");
|
|
4004
|
-
const repository = parts.join("/");
|
|
4005
|
-
if (!REPOSITORY.test(repository)) throw new TypeError("Container image repository is invalid");
|
|
4006
|
-
const selectedTag = tag ?? (digest === null ? "latest" : null);
|
|
4007
|
-
return {
|
|
4008
|
-
registry,
|
|
4009
|
-
repository,
|
|
4010
|
-
tag: selectedTag,
|
|
4011
|
-
digest,
|
|
4012
|
-
reference: `${registry}/${repository}${digest === null ? `:${selectedTag}` : `@${digest}`}`
|
|
4013
|
-
};
|
|
4014
|
-
}
|
|
4015
|
-
|
|
4016
3976
|
// packages/sdk/src/sandbox-build.ts
|
|
4017
3977
|
var recipeProperties = {
|
|
4018
3978
|
context: { type: "string", minLength: 1 },
|
|
@@ -4105,25 +4065,6 @@ function processCredentialMaps(value, resolve) {
|
|
|
4105
4065
|
function sandboxProcessCredentials(value) {
|
|
4106
4066
|
return processCredentialMaps(value, resourceCredentialBinding);
|
|
4107
4067
|
}
|
|
4108
|
-
function importSandboxImageInput(value) {
|
|
4109
|
-
const error = validateJsonSchema(value, { type: "object", required: ["reference"], additionalProperties: false, properties: {
|
|
4110
|
-
cache: { type: "boolean" },
|
|
4111
|
-
reference: { type: "string", minLength: 1 },
|
|
4112
|
-
registry: {
|
|
4113
|
-
type: "object",
|
|
4114
|
-
required: ["username", "credential"],
|
|
4115
|
-
additionalProperties: false,
|
|
4116
|
-
properties: { username: { type: "string", minLength: 1 }, credential: RESOURCE_CREDENTIAL_BINDING_SCHEMA }
|
|
4117
|
-
}
|
|
4118
|
-
} });
|
|
4119
|
-
if (error) throw new TypeError(`Invalid sandbox image input: ${error}`);
|
|
4120
|
-
const source = structuredClone(value);
|
|
4121
|
-
return {
|
|
4122
|
-
reference: containerImageReference(source.reference).reference,
|
|
4123
|
-
...source.cache === void 0 ? {} : { cache: source.cache },
|
|
4124
|
-
...source.registry ? { registry: { username: source.registry.username, credential: resourceCredentialBinding(source.registry.credential) } } : {}
|
|
4125
|
-
};
|
|
4126
|
-
}
|
|
4127
4068
|
|
|
4128
4069
|
// packages/sdk/src/scorer.ts
|
|
4129
4070
|
function validPointer(value) {
|
|
@@ -4543,7 +4484,6 @@ export {
|
|
|
4543
4484
|
gatewayPackageMetadata,
|
|
4544
4485
|
hash,
|
|
4545
4486
|
hashValue,
|
|
4546
|
-
importSandboxImageInput,
|
|
4547
4487
|
integrationEgressPolicy,
|
|
4548
4488
|
labelSelector,
|
|
4549
4489
|
matchesAction,
|