@constal/sdk 2.3.0 → 2.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constal/sdk",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Public TypeScript SDK for authoring Constal agents, integrations, policies, channels, and credential providers",
5
5
  "keywords": ["constal", "agents", "integrations", "typescript", "sdk"],
6
6
  "license": "UNLICENSED",
package/publish/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@constal/sdk",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "exports": [
5
5
  "Action",
6
6
  "ActionPattern",
@@ -155,6 +155,8 @@
155
155
  "IgnoredChannelEvent",
156
156
  "IngressRequest",
157
157
  "IngressTarget",
158
+ "IntegrationArtifactEgressRequest",
159
+ "IntegrationArtifactEgressResponse",
158
160
  "IntegrationContext",
159
161
  "IntegrationEgressPolicy",
160
162
  "IntegrationEgressRequest",
@@ -174,6 +176,7 @@
174
176
  "LeaseLost",
175
177
  "LedgerAddress",
176
178
  "LedgerEvent",
179
+ "LocalResourceRef",
177
180
  "MCP_CLIENT_CAPABILITY",
178
181
  "MEMORY_OPERATION_DECLARATIONS",
179
182
  "MODEL_CHECKPOINT_IMPORT_CAPABILITY",
@@ -220,6 +223,7 @@
220
223
  "Principal",
221
224
  "PrincipalKind",
222
225
  "Provenance",
226
+ "RESOURCE_KINDS",
223
227
  "RawModelProtocol",
224
228
  "Recovery",
225
229
  "ReduceFact",
@@ -229,6 +233,7 @@
229
233
  "ResourceContractRef",
230
234
  "ResourceControlsConstraint",
231
235
  "ResourceCredentialBinding",
236
+ "ResourceDependencyRef",
232
237
  "ResourceDisabled",
233
238
  "ResourceInvalid",
234
239
  "ResourceKind",
@@ -412,8 +417,10 @@
412
417
  "policyName",
413
418
  "renderTrainingCompletion",
414
419
  "resolveGatewayEgress",
420
+ "resolveResourceDependencyRef",
415
421
  "resourceContractRef",
416
422
  "resourceCredentialBinding",
423
+ "resourceDependencyRef",
417
424
  "resourceLabelMap",
418
425
  "resourceName",
419
426
  "resourceNeed",
@@ -20,6 +20,20 @@ interface IntegrationEgressResponse {
20
20
  bodyBase64: string;
21
21
  bytes: number;
22
22
  }
23
+ interface IntegrationArtifactEgressResponse {
24
+ url: string;
25
+ status: number;
26
+ headers: Record<string, string>;
27
+ artifact: {
28
+ ref: Ref;
29
+ bytes: number;
30
+ } | null;
31
+ errorBodyBase64?: string;
32
+ }
33
+ type IntegrationArtifactEgressRequest = Omit<IntegrationEgressRequest, "maximumResponseBytes"> & {
34
+ /** Optional package-specific ceiling; defaults to the platform CAS single-object limit. */
35
+ maximumResponseBytes?: number;
36
+ };
23
37
  interface IntegrationState {
24
38
  get<T>(key: string): Promise<T | null>;
25
39
  set(key: string, value: unknown): Promise<void>;
@@ -37,6 +51,8 @@ interface IntegrationContext {
37
51
  store(bytes: ArrayBuffer | string): Promise<Ref>;
38
52
  audit(record: unknown): void;
39
53
  egress(request: IntegrationEgressRequest): Promise<IntegrationEgressResponse>;
54
+ /** Stream a successful response directly into content-addressed storage. */
55
+ egressArtifact(request: IntegrationArtifactEgressRequest): Promise<IntegrationArtifactEgressResponse>;
40
56
  }
41
57
  interface IntegrationEgressRule {
42
58
  operations: string[];
@@ -797,6 +813,14 @@ interface ScopedResourceRef {
797
813
  required: boolean;
798
814
  contract: ResourceContractRef;
799
815
  }
816
+ /** A tenant-neutral package dependency resolved only when the package is installed. */
817
+ interface LocalResourceRef<K extends ResourceKind = ResourceKind> {
818
+ kind: "local";
819
+ resourceKind: K;
820
+ id: string;
821
+ namespace?: string;
822
+ }
823
+ type ResourceDependencyRef<K extends ResourceKind = ResourceKind> = CRN | LocalResourceRef<K>;
800
824
  interface FixedModelGatewayRef {
801
825
  kind: "fixed";
802
826
  resource: {
@@ -1001,6 +1025,8 @@ declare function agentResourceBinding(value: unknown): AgentResourceBinding;
1001
1025
  declare function resourceCredentialBinding(value: unknown): ResourceCredentialBinding;
1002
1026
  declare function credentialRotationDefaults(value: unknown): CredentialRotationDefaults;
1003
1027
  declare function resourceName(parts: ResourceNameParts): ResourceName;
1028
+ declare function resourceDependencyRef<K extends ResourceKind>(value: unknown, expectedKinds: readonly K[]): ResourceDependencyRef<K>;
1029
+ declare function resolveResourceDependencyRef<K extends ResourceKind>(value: unknown, scope: Pick<ResourceNameParts, "environment" | "tenant" | "namespace">, expectedKinds: readonly K[]): ResourceName;
1004
1030
  declare function parseResourceName(value: string): ResourceNameParts;
1005
1031
  declare function credentialName(value: string): CredentialCRN;
1006
1032
  declare function credentialProviderName(value: string): CredentialProviderCRN;
@@ -2063,7 +2089,7 @@ interface Channel<Input = unknown, Output = unknown, Delivery = Output> {
2063
2089
  id: string;
2064
2090
  version: string;
2065
2091
  protocol: ChannelProtocol<Input, Output, Delivery>;
2066
- authProvider: AuthProviderCRN;
2092
+ authProvider: ResourceDependencyRef<"auth-provider">;
2067
2093
  public?: boolean;
2068
2094
  needs?: ResourceNeed[];
2069
2095
  analytics?: AnalyticsEventDefinition[];
@@ -3601,5 +3627,5 @@ declare class SessionDeleted extends Error {
3601
3627
  constructor(session: string);
3602
3628
  }
3603
3629
 
3604
- export { AfterYield, ApiError, CONSTAL_API_CAPABILITY, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EffectCeilingExceeded, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, integrationEgressPolicy, labelSelector, matchesAction, matchesLabelSelector, matchesResource, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelLimit, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, opTool, opTools, parseResourceName, policy, policyName, renderTrainingCompletion, resolveGatewayEgress, resourceContractRef, resourceCredentialBinding, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, sandboxControls, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scorerName, setupAwait, setupScreen, setupScreenView, setupSubmission, sha256Hex, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
3605
- export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentDef, AgentDeployPolicy, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerScope, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelAlarm, ChannelAlarmResult, ChannelContext, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, 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, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryView, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationSecret, IntegrationState, InvokableKind, InvokeOpts, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerEvent, ManifestIndexPage, MapFact, MapOpts, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGovernanceControls, ModelGovernanceMeter, ModelInvocationArgs, ModelInvocationResult, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandResult, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialInteractionPanel, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, 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 };
3630
+ export { AfterYield, ApiError, CONSTAL_API_CAPABILITY, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EffectCeilingExceeded, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, integrationEgressPolicy, labelSelector, matchesAction, matchesLabelSelector, matchesResource, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelLimit, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, opTool, opTools, parseResourceName, policy, policyName, renderTrainingCompletion, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, sandboxControls, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scorerName, setupAwait, setupScreen, setupScreenView, setupSubmission, sha256Hex, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
3631
+ export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentDef, AgentDeployPolicy, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerScope, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelAlarm, ChannelAlarmResult, ChannelContext, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, 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, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryView, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationSecret, IntegrationState, InvokableKind, InvokeOpts, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerEvent, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGovernanceControls, ModelGovernanceMeter, ModelInvocationArgs, ModelInvocationResult, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, 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, SandboxCommandResult, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialInteractionPanel, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, 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
@@ -579,6 +579,35 @@ function resourceName(parts) {
579
579
  validateParts(parts);
580
580
  return `crn:constal:${parts.environment}:${parts.tenant}:${parts.namespace}:${parts.kind}/${parts.path}`;
581
581
  }
582
+ function resourceDependencyRef(value, expectedKinds) {
583
+ if (typeof value === "string") {
584
+ const parts = parseResourceName(value);
585
+ if (!expectedKinds.includes(parts.kind)) throw new TypeError("resource dependency kind is invalid");
586
+ return value;
587
+ }
588
+ const candidate = record2(value);
589
+ if (!candidate || candidate.kind !== "local" || typeof candidate.resourceKind !== "string" || !expectedKinds.includes(candidate.resourceKind) || typeof candidate.id !== "string" || candidate.namespace !== void 0 && typeof candidate.namespace !== "string" || Object.keys(candidate).some((key) => !["kind", "resourceKind", "id", "namespace"].includes(key))) {
590
+ throw new TypeError("resource dependency reference is invalid");
591
+ }
592
+ resourceName({
593
+ environment: "local",
594
+ tenant: "local",
595
+ namespace: candidate.namespace ?? "default",
596
+ kind: candidate.resourceKind,
597
+ path: candidate.id
598
+ });
599
+ return candidate;
600
+ }
601
+ function resolveResourceDependencyRef(value, scope2, expectedKinds) {
602
+ const reference = resourceDependencyRef(value, expectedKinds);
603
+ if (typeof reference === "string") return reference;
604
+ return resourceName({
605
+ ...scope2,
606
+ namespace: reference.namespace ?? scope2.namespace,
607
+ kind: reference.resourceKind,
608
+ path: reference.id
609
+ });
610
+ }
582
611
  function parseResourceName(value) {
583
612
  const match = value.match(/^crn:constal:([^:]+):([^:]+):([^:]+):([^/]+)\/(.+)$/u);
584
613
  if (!match) throw new TypeError("resource name is invalid");
@@ -875,7 +904,7 @@ function channel(definition) {
875
904
  if (typeof definition.protocol.receive !== "function" || typeof definition.protocol.respond !== "function" || definition.protocol.send !== void 0 && typeof definition.protocol.send !== "function" || definition.protocol.alarm !== void 0 && typeof definition.protocol.alarm !== "function") {
876
905
  throw new TypeError("channel.protocol must define receive and respond, with optional send and alarm handlers");
877
906
  }
878
- authProviderName(definition.authProvider);
907
+ resourceDependencyRef(definition.authProvider, ["auth-provider"]);
879
908
  definition.needs?.forEach(resourceNeed);
880
909
  const analytics = definition.analytics ?? [];
881
910
  analytics.forEach((event) => analyticsEvent(event));
@@ -3097,6 +3126,7 @@ export {
3097
3126
  OutcomeUnknown,
3098
3127
  PolicyConstraintFailed,
3099
3128
  PolicyDecisionFailed,
3129
+ RESOURCE_KINDS,
3100
3130
  ResourceDisabled,
3101
3131
  ResourceInvalid,
3102
3132
  ResourceUnbound,
@@ -3174,8 +3204,10 @@ export {
3174
3204
  policyName,
3175
3205
  renderTrainingCompletion,
3176
3206
  resolveGatewayEgress,
3207
+ resolveResourceDependencyRef,
3177
3208
  resourceContractRef,
3178
3209
  resourceCredentialBinding,
3210
+ resourceDependencyRef,
3179
3211
  resourceLabelMap,
3180
3212
  resourceName,
3181
3213
  resourceNeed,