@constal/sdk 6.8.0 → 6.9.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": "6.8.0",
3
+ "version": "6.9.0",
4
4
  "description": "Public TypeScript SDK for authoring Constal agents, integrations, policies, channels, and credential providers",
5
5
  "keywords": [
6
6
  "constal",
package/publish/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@constal/sdk",
3
- "version": "6.8.0",
3
+ "version": "6.9.0",
4
4
  "exports": [
5
5
  "AGENT_UI_DEFAULTS",
6
6
  "Action",
@@ -121,6 +121,7 @@
121
121
  "CreateSandboxImageOptions",
122
122
  "CreateSandboxOptions",
123
123
  "CredentialCRN",
124
+ "CredentialDestination",
124
125
  "CredentialDestroyResult",
125
126
  "CredentialEvidence",
126
127
  "CredentialInteractionAction",
@@ -133,6 +134,7 @@
133
134
  "CredentialMaterialRequest",
134
135
  "CredentialMintRequest",
135
136
  "CredentialMintResult",
137
+ "CredentialPresentation",
136
138
  "CredentialProviderCRN",
137
139
  "CredentialProviderConfigEgressBinding",
138
140
  "CredentialProviderContext",
@@ -347,8 +349,6 @@
347
349
  "SandboxCommandCollectionError",
348
350
  "SandboxCommandExecution",
349
351
  "SandboxCommandResult",
350
- "SandboxEgressCredentialHeaderRule",
351
- "SandboxEgressCredentialRule",
352
352
  "SandboxEgressPolicy",
353
353
  "SandboxEgressRule",
354
354
  "SandboxExecInput",
@@ -603,8 +603,8 @@
603
603
  "modelProtocolRequest",
604
604
  "modelProtocolResult",
605
605
  "murmur3_32",
606
+ "normalizeCredentialDestinations",
606
607
  "normalizeModelGatewayConfig",
607
- "normalizeSandboxEgressCredentialRules",
608
608
  "normalizeSandboxEgressPolicy",
609
609
  "normalizeSandboxLabels",
610
610
  "normalizeSandboxNetworkPolicy",
@@ -632,7 +632,6 @@
632
632
  "resourceTools",
633
633
  "runLabels",
634
634
  "sandboxControls",
635
- "sandboxEgressCredentialRuleFor",
636
635
  "sandboxEgressDecision",
637
636
  "sandboxEgressHostMatches",
638
637
  "sandboxLimit",
@@ -1,3 +1,88 @@
1
+ /**
2
+ * A sandbox's own egress settings: an ordered host policy that narrows its pool's network, and labels every egress event
3
+ * carries. They are provider-neutral declarations; a pool whose provider has no egress gate refuses them rather than
4
+ * ignoring them. And where a Credential is used, the destinations it declares: a sandbox's egress gate adds it to the
5
+ * sandbox's requests to them, when it is one of the sandbox owner's connections (docs/sandbox-egress-connections.md).
6
+ */
7
+ /** One ordered rule: the first rule whose host matches a request decides it. */
8
+ interface SandboxEgressRule {
9
+ action: "allow" | "deny";
10
+ /** An exact host name, or `*.example.com` for the apex and every name under it. */
11
+ host: string;
12
+ }
13
+ /**
14
+ * A sandbox's narrowing of its pool's network. It never widens it: a request must be admitted by the pool and by this
15
+ * policy. A host no rule matches takes `default` (`deny` when omitted). The pool's control host stays reachable.
16
+ */
17
+ interface SandboxEgressPolicy {
18
+ rules: SandboxEgressRule[];
19
+ default?: "allow" | "deny";
20
+ }
21
+ /** How a Credential is presented in a request: the one header it sets. A header the sandbox sent under the same name is replaced. */
22
+ interface CredentialPresentation {
23
+ /** The header to set; `authorization` when omitted. */
24
+ header?: string;
25
+ /** The header value, with `{value}` exactly once where the Credential goes; `Bearer {value}` when omitted. */
26
+ value?: string;
27
+ /** Instead of `value`: HTTP basic auth, `Basic base64(username:value)`, or `Basic base64(value)` without a username. */
28
+ basic?: {
29
+ username?: string;
30
+ };
31
+ /**
32
+ * For a Credential whose value is JSON: the JSON Pointer (RFC 6901) of the text that goes in place of the whole value,
33
+ * such as `/accessToken`. A value that is not JSON, or has no non-empty text there, refuses the request. Omitted: the
34
+ * whole value.
35
+ */
36
+ field?: string;
37
+ /**
38
+ * `totp`: the text (after `field`) is an authenticator seed, RFC 4648 base32, and the header carries the RFC 6238
39
+ * time-based code for the request's time in its place (`{value}` and `basic` apply to the code), such as npm's `npm-otp`.
40
+ * The object the text sits in may give the code's `digits` (6 to 8, RFC 4226 5.3), `period` (whole seconds) and
41
+ * `algorithm` (`SHA1`, `SHA256` or `SHA512`, the Key URI Format's names), each RFC 6238's default (6, 30, `SHA1`) when
42
+ * absent. The seed is redacted from responses as a value is; the code, worthless past its period, is not.
43
+ */
44
+ code?: "totp";
45
+ }
46
+ /**
47
+ * Where a Credential is used, as its version declares it: its provider's verify answers its destinations, and an imported
48
+ * Credential is given them when it is imported. A sandbox's egress gate adds the Credential, presented as `present`, to an
49
+ * https request of the sandbox that the destination matches, resolved at each request through the platform's Credential
50
+ * use (binding controls, scope, Policy, a use record naming the destination). The sandbox never sees the value, and the
51
+ * gate redacts it from what the response echoes back. A Credential with no destinations is never added to a request.
52
+ */
53
+ interface CredentialDestination {
54
+ /** `https://` and an exact host name, or `https://*.example.com` for the apex and every name under it. */
55
+ origin: string;
56
+ /**
57
+ * A path prefix on that origin, `/` and whole segments (`/acme`, `/acme/app.git`). A request matches when its path equals
58
+ * it or continues it with `/`. Compared exactly as sent: no case folding, no percent-decoding. Omitted: every path.
59
+ */
60
+ path?: string;
61
+ present: CredentialPresentation;
62
+ }
63
+ /** Caller-supplied labels a sandbox's events carry: at most 16, short keys, values of at most 256 characters. */
64
+ type SandboxLabels = Record<string, string>;
65
+ declare const SANDBOX_EGRESS_LIMITS: {
66
+ readonly rules: 64;
67
+ readonly labels: 16;
68
+ readonly labelValueLength: 256;
69
+ };
70
+ /** Whether `pattern` (exact, or `*.d` for `d` and every name under it) admits `hostname`. */
71
+ declare function sandboxEgressHostMatches(pattern: string, hostname: string): boolean;
72
+ /**
73
+ * A Credential version's destinations (none when omitted), canonical: each origin's host lowercased, a path's one trailing
74
+ * `/` dropped, a presentation's header lowercased and its value defaulted. The destinations of one origin and path, which
75
+ * a request gets together, set different headers.
76
+ */
77
+ declare function normalizeCredentialDestinations(value: unknown): CredentialDestination[];
78
+ declare function normalizeSandboxEgressPolicy(value: unknown): SandboxEgressPolicy;
79
+ /** The decision a policy gives a host: the first matching rule, else its default. Null admits everything. */
80
+ declare function sandboxEgressDecision(policy: SandboxEgressPolicy | null | undefined, hostname: string): {
81
+ allowed: boolean;
82
+ rule: string;
83
+ };
84
+ declare function normalizeSandboxLabels(value: unknown): SandboxLabels;
85
+
1
86
  /** Stable capability shared by configured Models and directly bound Gateways. */
2
87
  declare const MODEL_COMPLETION_CAPABILITY: CapabilityContractRef;
3
88
  /** Capability of Gateways that evaluate state against typed questions (`evaluate`), alongside or instead of completion. */
@@ -1291,19 +1376,15 @@ type AgentResourceBinding = CRN | ScopedResourceRef;
1291
1376
  type ResourceCredentialBinding = CredentialCRN | ScopedCredentialRef;
1292
1377
  interface InvocationCredentialUse {
1293
1378
  binding: ResourceCredentialBinding;
1294
- /** Who receives the value: a sandbox process (an env variable or a memory-backed file), a sandbox's egress gate,
1295
- * which adds it to requests as the named header and never shows it to the sandbox, a browser Resource's service, which
1296
- * types it, signs with it or restores it in the browsers it drives for the named login and never returns it (a login's
1297
- * account name, password and authenticator seed, one of its passkeys, or its saved session), or the invoked Resource
1298
- * itself: for this call only, its scoped slot of this name holds the Credential the Run's own owner holds under this key. */
1379
+ /** Who receives the value: a sandbox process (an env variable or a memory-backed file), a browser Resource's service,
1380
+ * which types it, signs with it or restores it in the browsers it drives for the named login and never returns it (a
1381
+ * login's account name, password and authenticator seed, one of its passkeys, or its saved session), or the invoked
1382
+ * Resource itself: for this call only, its scoped slot of this name holds the Credential the Run's own owner holds under
1383
+ * this key. */
1299
1384
  consumer: {
1300
1385
  kind: "process";
1301
1386
  delivery: "env" | "file";
1302
1387
  name: string;
1303
- } | {
1304
- kind: "egress";
1305
- delivery: "header";
1306
- name: string;
1307
1388
  } | {
1308
1389
  kind: "browser";
1309
1390
  delivery: "login" | "passkey" | "session";
@@ -1891,128 +1972,19 @@ declare function containerImageSelection(value: unknown): ContainerImageSelectio
1891
1972
  * manifest. The caller owns registry authentication and transport Policy. */
1892
1973
  declare function resolveContainerImageSource(reference: string, platform: ContainerImageSource["platform"], request: ContainerRegistryRequest, authorization?: string): Promise<ContainerImageSource>;
1893
1974
 
1894
- /**
1895
- * A sandbox's own egress settings: an ordered host policy that narrows its pool's network, Credentials its pool's
1896
- * egress gate adds to requests, and labels every egress event carries. They are provider-neutral declarations; a pool
1897
- * whose provider has no egress gate refuses them rather than ignoring them.
1898
- */
1899
- /** One ordered rule: the first rule whose host matches a request decides it. */
1900
- interface SandboxEgressRule {
1901
- action: "allow" | "deny";
1902
- /** An exact host name, or `*.example.com` for the apex and every name under it. */
1903
- host: string;
1904
- }
1905
- /**
1906
- * A sandbox's narrowing of its pool's network. It never widens it: a request must be admitted by the pool and by this
1907
- * policy. A host no rule matches takes `default` (`deny` when omitted). The pool's control host stays reachable.
1908
- */
1909
- interface SandboxEgressPolicy {
1910
- rules: SandboxEgressRule[];
1911
- default?: "allow" | "deny";
1912
- }
1913
- /** One header an egress Credential rule sets from its Credential. */
1914
- interface SandboxEgressCredentialHeaderRule {
1915
- /** The header to set; `authorization` when omitted. A header the sandbox sent under the same name is replaced. */
1916
- header?: string;
1917
- /** The header value, with `{value}` exactly once where the Credential goes; `Bearer {value}` when omitted. */
1918
- value?: string;
1919
- /** Instead of `value`: HTTP basic auth, `Basic base64(username:value)`, or `Basic base64(value)` without a username. */
1920
- basic?: {
1921
- username?: string;
1922
- };
1923
- /**
1924
- * For a Credential whose value is JSON: the JSON Pointer (RFC 6901) of the text that goes in place of the whole value,
1925
- * such as `/accessToken`. A value that is not JSON, or has no non-empty text there, refuses the request. Omitted: the
1926
- * whole value.
1927
- */
1928
- field?: string;
1929
- /**
1930
- * `totp`: the text (after `field`) is an authenticator seed, RFC 4648 base32, and the header carries the RFC 6238
1931
- * time-based code for the request's time in its place (`{value}` and `basic` apply to the code), such as npm's `npm-otp`.
1932
- * The object the text sits in may give the code's `digits` (6 to 8, RFC 4226 5.3), `period` (whole seconds) and
1933
- * `algorithm` (`SHA1`, `SHA256` or `SHA512`, the Key URI Format's names), each RFC 6238's default (6, 30, `SHA1`) when
1934
- * absent. The seed is redacted from responses as a value is; the code, worthless past its period, is not.
1935
- */
1936
- code?: "totp";
1937
- }
1938
- /**
1939
- * The first rule whose host and path match a request adds its headers: built from a Credential, resolved at each
1940
- * request through the platform's Credential use (binding controls, scope, Policy, a use record naming the destination).
1941
- * The sandbox never sees the value, and the gate redacts it from what the response echoes back.
1942
- */
1943
- interface SandboxEgressCredentialRule extends SandboxEgressCredentialHeaderRule {
1944
- /** Exact host names, or `*.example.com` for the apex and every name under it. Requests must be https. */
1945
- hosts: string[];
1946
- /**
1947
- * Path prefixes on those hosts, each `/` and whole segments (`/acme`, `/acme/app.git`). A request matches when its path
1948
- * equals one or continues it with `/`. Compared exactly as sent: no case folding, no percent-decoding. Omitted: every path.
1949
- */
1950
- paths?: string[];
1951
- /** A Credential slot the pool declares. */
1952
- slot?: string;
1953
- /** Only on createSandbox: a Credential (or a scoped binding to one) the call delegates to this sandbox. */
1954
- binding?: ResourceCredentialBinding;
1955
- /**
1956
- * More headers from the same Credential, each set as the rule's own is (such as a token and the account it belongs to,
1957
- * two fields of one JSON value): at most SANDBOX_EGRESS_LIMITS.credentialRules, no header named twice in the rule.
1958
- */
1959
- headers?: SandboxEgressCredentialHeaderRule[];
1960
- /**
1961
- * For git over HTTPS through this rule: the refs a push (a `git-receive-pack` request) may update, each a full ref name
1962
- * (`refs/heads/leonard/t-1`) or a prefix ending in `/*` for every ref under it (`refs/heads/leonard/t-1/*`). The gate
1963
- * reads the push's ref-update commands, never its pack, and refuses a push that names any other ref, with the reason git
1964
- * shows. `[]` refuses every push. Omitted: the gate reads no request body through this rule.
1965
- */
1966
- push?: string[];
1967
- }
1968
- /** A rule as the pool receives it: a delegated binding arrives as the invocation's Credential use `egress-<n>` (`use`). */
1969
- interface SandboxEgressCredentialGrant extends SandboxEgressCredentialRule {
1970
- use?: string;
1971
- }
1972
- /** Caller-supplied labels a sandbox's events carry: at most 16, short keys, values of at most 256 characters. */
1973
- type SandboxLabels = Record<string, string>;
1974
- declare const SANDBOX_EGRESS_LIMITS: {
1975
- readonly rules: 64;
1976
- readonly credentialRules: 16;
1977
- readonly hostsPerRule: 32;
1978
- readonly labels: 16;
1979
- readonly labelValueLength: 256;
1980
- };
1981
- /** Whether `pattern` (exact, or `*.d` for `d` and every name under it) admits `hostname`. */
1982
- declare function sandboxEgressHostMatches(pattern: string, hostname: string): boolean;
1983
- /**
1984
- * The Credential rule a request gets: the first, in order, whose `hosts` admit its host and whose `paths`, when it has
1985
- * them, admit its path (equal, or continued with `/`). The query never takes part. None: the request carries no Credential.
1986
- */
1987
- declare function sandboxEgressCredentialRuleFor<R extends Pick<SandboxEgressCredentialRule, "hosts" | "paths">>(rules: readonly R[], url: URL | string): R | undefined;
1988
- declare function normalizeSandboxEgressPolicy(value: unknown): SandboxEgressPolicy;
1989
- /** The decision a policy gives a host: the first matching rule, else its default. Null admits everything. */
1990
- declare function sandboxEgressDecision(policy: SandboxEgressPolicy | null | undefined, hostname: string): {
1991
- allowed: boolean;
1992
- rule: string;
1993
- };
1994
- /**
1995
- * Egress Credential rules. `bindings` admits a rule that delegates a binding (createSandbox); a pool's own rules name its
1996
- * slots. The pool receives a delegated rule as `use` (the invocation's `egress-<n>` Credential use) in place of `binding`.
1997
- */
1998
- declare function normalizeSandboxEgressCredentialRules(value: unknown, options?: {
1999
- bindings?: boolean;
2000
- uses?: boolean;
2001
- }): SandboxEgressCredentialGrant[];
2002
- declare function normalizeSandboxLabels(value: unknown): SandboxLabels;
2003
-
2004
1975
  /** Canonicalize one provider-neutral path and keep it inside the logical workspace. */
2005
1976
  declare function normalizeSandboxWorkspacePath(path: string, cwd?: string): string;
1977
+ /**
1978
+ * A sandbox's https requests carry its owner's connections: the Credential of each enabled binding its customer owns (the
1979
+ * tenant, for a tenant-level Run) in the Agent's namespace, at the destinations that Credential declares
1980
+ * (CredentialDestination). Nothing here names them.
1981
+ */
2006
1982
  interface CreateSandboxOptions {
2007
1983
  image?: SandboxImage;
2008
1984
  resetImage?: boolean;
2009
1985
  execution?: ContainerImageSelection;
2010
1986
  /** Narrows the pool's network for this sandbox; `Sandbox.updateNetwork` replaces it later. */
2011
1987
  network?: SandboxEgressPolicy;
2012
- /** Headers the pool's egress gate adds from Credentials, after the pool's own rules. A rule naming a `binding` is
2013
- * delegated by this call; calling createSandbox again for the Session renews the delegation, and calling it again with
2014
- * other rules replaces them. */
2015
- credentials?: SandboxEgressCredentialRule[];
2016
1988
  /** Labels every egress event of this sandbox carries. */
2017
1989
  labels?: SandboxLabels;
2018
1990
  /**
@@ -2020,8 +1992,8 @@ interface CreateSandboxOptions {
2020
1992
  * run, shared by every Run it reaches, whatever its Agent or Session (InvokeOrigin `entry`): each such Run that calls
2021
1993
  * createSandbox with `entry` works in it, its files kept from one Run to the next, and the Session's calls that name no
2022
1994
  * sandbox (`workspace()`) go there until a createSandbox without it. No Session's end releases it: it is deleted 6 h
2023
- * after it was last used, and the next createSandbox makes a new one. Credentials and push refs given replace those of
2024
- * every Run sharing it. Make it a Run's first call to the pool: a Run's fast calls keep the sandbox their grant found.
1995
+ * after it was last used, and the next createSandbox makes a new one. Make it a Run's first call to the pool: a Run's fast
1996
+ * calls keep the sandbox their grant found.
2025
1997
  */
2026
1998
  scope?: SandboxScope;
2027
1999
  }
@@ -5156,6 +5128,11 @@ interface CredentialVerifyResult {
5156
5128
  verified: boolean;
5157
5129
  /** Non-secret external identity and access facts verified by this provider. */
5158
5130
  claims?: Record<string, string | number | boolean | string[]>;
5131
+ /**
5132
+ * With verified:true: where this version is used, which the platform stores on it beside its claims. A provider whose
5133
+ * destination depends on the account it connected reads that account here. None: the version is never added to a request.
5134
+ */
5135
+ destinations?: CredentialDestination[];
5159
5136
  /** With verified:false only: the provider states that the installation this version stands for no longer exists.
5160
5137
  * The platform revokes this version and the Credential's older live versions. A failure that may pass, and any
5161
5138
  * answer that is not such a statement (a suspension, a mismatch, a refusal), is thrown instead. */
@@ -5562,5 +5539,5 @@ declare function parseLedgerAddress(value: unknown): LedgerAddressParts | null;
5562
5539
  /** Formats ledger address parts; throws when a part breaks its id rule. */
5563
5540
  declare function formatLedgerAddress(parts: LedgerAddressParts): LedgerAddress;
5564
5541
 
5565
- export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CHAT_FORMAT_CAPABILITY, 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, DATA_SHARE_FEE_BPS, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GENERAL_QUALITY_JUDGE, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, NotAppendOnly, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_EGRESS_LIMITS, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TRAINING_RECIPE_DEFAULTS, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentLimit, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, all, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, chatFormat, chatFormatMetadata, chatFormatPin, chatParseInput, chatParsed, chatRenderInput, chatRenderRequest, chatRendering, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, dataShareEarningMicroUsd, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, formatLedgerAddress, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, judgeAgent, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxEgressCredentialRules, normalizeSandboxEgressPolicy, normalizeSandboxLabels, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, runLabels, sandboxControls, sandboxEgressCredentialRuleFor, sandboxEgressDecision, sandboxEgressHostMatches, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerDraftHash, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, shareContributionRequest, shareContributionReview, shareEvaluation, sharePrices, shareRequest, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingCorrection, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
5566
- export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentGovernanceMeter, 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, ChannelDeliveryError, ChannelDeliveryEvent, ChannelDeliveryOutcome, ChannelDeliveryReport, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, ChatFormatDefinition, ChatFormatMetadata, ChatFormatPin, ChatMessage, ChatParseRequest, ChatParsed, ChatRenderRequest, ChatRendering, ChatSpan, ChatTool, 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, CredentialProviderConfigEgressBinding, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DataSharingScope, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvalSuiteCase, EvalSuiteCasePage, EvalSuiteCaseScore, EvalSuiteCaseState, EvalSuiteScoreState, 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, HistoryPage, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, JudgeRubric, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCacheHint, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, 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, RunReport, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandCollectionError, SandboxCommandExecution, SandboxCommandResult, SandboxEgressCredentialHeaderRule, SandboxEgressCredentialRule, SandboxEgressPolicy, SandboxEgressRule, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxLabels, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, SandboxWorkspaceInspection, SandboxWorkspacePreparation, SandboxWorkspaceReceipt, 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, ScorerDraft, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, ShareHistory, SharePrice, ShareRequest, ShareReviewDecision, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, StepJournal, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingCorrection, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingPreparation, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingStep, TrainingUsageUnits, TurnDraft, TurnGate, TurnHistoryMessage, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
5542
+ export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CHAT_FORMAT_CAPABILITY, 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, DATA_SHARE_FEE_BPS, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GENERAL_QUALITY_JUDGE, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, NotAppendOnly, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_EGRESS_LIMITS, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TRAINING_RECIPE_DEFAULTS, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentLimit, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, all, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, chatFormat, chatFormatMetadata, chatFormatPin, chatParseInput, chatParsed, chatRenderInput, chatRenderRequest, chatRendering, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, dataShareEarningMicroUsd, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, formatLedgerAddress, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, judgeAgent, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeCredentialDestinations, normalizeModelGatewayConfig, normalizeSandboxEgressPolicy, normalizeSandboxLabels, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, runLabels, sandboxControls, sandboxEgressDecision, sandboxEgressHostMatches, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerDraftHash, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, shareContributionRequest, shareContributionReview, shareEvaluation, sharePrices, shareRequest, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingCorrection, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
5543
+ export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentGovernanceMeter, 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, ChannelDeliveryError, ChannelDeliveryEvent, ChannelDeliveryOutcome, ChannelDeliveryReport, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, ChatFormatDefinition, ChatFormatMetadata, ChatFormatPin, ChatMessage, ChatParseRequest, ChatParsed, ChatRenderRequest, ChatRendering, ChatSpan, ChatTool, 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, CredentialDestination, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialPresentation, CredentialProviderCRN, CredentialProviderConfigEgressBinding, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DataSharingScope, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvalSuiteCase, EvalSuiteCasePage, EvalSuiteCaseScore, EvalSuiteCaseState, EvalSuiteScoreState, 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, HistoryPage, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, JudgeRubric, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCacheHint, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, 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, RunReport, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandCollectionError, SandboxCommandExecution, SandboxCommandResult, SandboxEgressPolicy, SandboxEgressRule, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxLabels, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, SandboxWorkspaceInspection, SandboxWorkspacePreparation, SandboxWorkspaceReceipt, 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, ScorerDraft, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, ShareHistory, SharePrice, ShareRequest, ShareReviewDecision, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, StepJournal, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingCorrection, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingPreparation, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingStep, TrainingUsageUnits, TurnDraft, TurnGate, TurnHistoryMessage, 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
@@ -171,107 +171,107 @@ var KEYWORDS = /* @__PURE__ */ new Set([
171
171
  "anyOf"
172
172
  ]);
173
173
  var TYPES = /* @__PURE__ */ new Set(["null", "boolean", "object", "array", "number", "string", "integer"]);
174
- function validateJsonSchemaDefinition(schema, path = "$schema", depth = 0) {
174
+ function validateJsonSchemaDefinition(schema, path2 = "$schema", depth = 0) {
175
175
  if (schema === true || schema === false) return null;
176
- if (!schema || typeof schema !== "object" || Array.isArray(schema)) return `${path} must be an object or boolean schema`;
176
+ if (!schema || typeof schema !== "object" || Array.isArray(schema)) return `${path2} must be an object or boolean schema`;
177
177
  const rule = schema;
178
178
  const unknown = Object.keys(rule).find((key) => !KEYWORDS.has(key) && !key.startsWith("x-"));
179
- if (unknown) return `${path}.${unknown} is not supported`;
179
+ if (unknown) return `${path2}.${unknown} is not supported`;
180
180
  const types = typeof rule.type === "string" ? [rule.type] : Array.isArray(rule.type) ? rule.type : [];
181
- if (rule.type !== void 0 && (types.length === 0 || types.some((type) => typeof type !== "string" || !TYPES.has(type)))) return `${path}.type is invalid`;
182
- if (rule.enum !== void 0 && (!Array.isArray(rule.enum) || rule.enum.length === 0)) return `${path}.enum must be non-empty`;
181
+ if (rule.type !== void 0 && (types.length === 0 || types.some((type) => typeof type !== "string" || !TYPES.has(type)))) return `${path2}.type is invalid`;
182
+ if (rule.enum !== void 0 && (!Array.isArray(rule.enum) || rule.enum.length === 0)) return `${path2}.enum must be non-empty`;
183
183
  for (const keyword of ["minLength", "maxLength", "minItems", "maxItems", "minProperties", "maxProperties"]) {
184
- if (rule[keyword] !== void 0 && (!Number.isSafeInteger(rule[keyword]) || Number(rule[keyword]) < 0)) return `${path}.${keyword} is invalid`;
184
+ if (rule[keyword] !== void 0 && (!Number.isSafeInteger(rule[keyword]) || Number(rule[keyword]) < 0)) return `${path2}.${keyword} is invalid`;
185
185
  }
186
186
  for (const keyword of ["minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf"]) {
187
- if (rule[keyword] !== void 0 && (typeof rule[keyword] !== "number" || !Number.isFinite(rule[keyword]))) return `${path}.${keyword} is invalid`;
187
+ if (rule[keyword] !== void 0 && (typeof rule[keyword] !== "number" || !Number.isFinite(rule[keyword]))) return `${path2}.${keyword} is invalid`;
188
188
  }
189
- if (typeof rule.multipleOf === "number" && rule.multipleOf <= 0) return `${path}.multipleOf must be positive`;
189
+ if (typeof rule.multipleOf === "number" && rule.multipleOf <= 0) return `${path2}.multipleOf must be positive`;
190
190
  if (rule.pattern !== void 0) {
191
191
  try {
192
192
  if (typeof rule.pattern !== "string") throw new Error();
193
193
  new RegExp(rule.pattern, "u");
194
194
  } catch {
195
- return `${path}.pattern is invalid`;
195
+ return `${path2}.pattern is invalid`;
196
196
  }
197
197
  }
198
- if (rule.required !== void 0 && (!Array.isArray(rule.required) || rule.required.some((key) => typeof key !== "string") || new Set(rule.required).size !== rule.required.length)) return `${path}.required is invalid`;
199
- if (rule.properties !== void 0 && (!rule.properties || typeof rule.properties !== "object" || Array.isArray(rule.properties))) return `${path}.properties is invalid`;
198
+ if (rule.required !== void 0 && (!Array.isArray(rule.required) || rule.required.some((key) => typeof key !== "string") || new Set(rule.required).size !== rule.required.length)) return `${path2}.required is invalid`;
199
+ if (rule.properties !== void 0 && (!rule.properties || typeof rule.properties !== "object" || Array.isArray(rule.properties))) return `${path2}.properties is invalid`;
200
200
  for (const [key, child] of Object.entries(rule.properties ?? {})) {
201
- const error = validateJsonSchemaDefinition(child, `${path}.properties.${key}`, depth + 1);
201
+ const error = validateJsonSchemaDefinition(child, `${path2}.properties.${key}`, depth + 1);
202
202
  if (error) return error;
203
203
  }
204
204
  if (rule.items !== void 0) {
205
- const error = validateJsonSchemaDefinition(rule.items, `${path}.items`, depth + 1);
205
+ const error = validateJsonSchemaDefinition(rule.items, `${path2}.items`, depth + 1);
206
206
  if (error) return error;
207
207
  }
208
208
  if (rule.anyOf !== void 0) {
209
- if (!Array.isArray(rule.anyOf) || rule.anyOf.length === 0) return `${path}.anyOf is invalid`;
209
+ if (!Array.isArray(rule.anyOf) || rule.anyOf.length === 0) return `${path2}.anyOf is invalid`;
210
210
  for (const [index, child] of rule.anyOf.entries()) {
211
- const error = validateJsonSchemaDefinition(child, `${path}.anyOf[${index}]`, depth + 1);
211
+ const error = validateJsonSchemaDefinition(child, `${path2}.anyOf[${index}]`, depth + 1);
212
212
  if (error) return error;
213
213
  }
214
214
  }
215
215
  if (rule.additionalProperties !== void 0 && typeof rule.additionalProperties !== "boolean") {
216
- const error = validateJsonSchemaDefinition(rule.additionalProperties, `${path}.additionalProperties`, depth + 1);
216
+ const error = validateJsonSchemaDefinition(rule.additionalProperties, `${path2}.additionalProperties`, depth + 1);
217
217
  if (error) return error;
218
218
  }
219
- if (rule.uniqueItems !== void 0 && typeof rule.uniqueItems !== "boolean") return `${path}.uniqueItems is invalid`;
219
+ if (rule.uniqueItems !== void 0 && typeof rule.uniqueItems !== "boolean") return `${path2}.uniqueItems is invalid`;
220
220
  return null;
221
221
  }
222
- function validateJsonSchema(value, schema, path = "$") {
222
+ function validateJsonSchema(value, schema, path2 = "$") {
223
223
  if (schema === true) return null;
224
- if (schema === false) return `${path} is rejected by the schema`;
225
- if (!schema || typeof schema !== "object" || Array.isArray(schema)) return `${path} has an invalid schema`;
224
+ if (schema === false) return `${path2} is rejected by the schema`;
225
+ if (!schema || typeof schema !== "object" || Array.isArray(schema)) return `${path2} has an invalid schema`;
226
226
  const rule = schema;
227
- if (Array.isArray(rule.anyOf) && !rule.anyOf.some((child) => validateJsonSchema(value, child, path) === null)) {
228
- return `${path} does not match any allowed schema`;
227
+ if (Array.isArray(rule.anyOf) && !rule.anyOf.some((child) => validateJsonSchema(value, child, path2) === null)) {
228
+ return `${path2} does not match any allowed schema`;
229
229
  }
230
230
  const types = typeof rule.type === "string" ? [rule.type] : Array.isArray(rule.type) ? rule.type : [];
231
- if (types.length && !types.some((type) => type === "object" ? value !== null && typeof value === "object" && !Array.isArray(value) : type === "array" ? Array.isArray(value) : type === "null" ? value === null : type === "integer" ? typeof value === "number" && Number.isInteger(value) : typeof value === type)) return `${path} must be ${types.join(" or ")}`;
232
- if (Array.isArray(rule.enum) && !rule.enum.some((candidate) => canonicalJson(candidate) === canonicalJson(value))) return `${path} is not allowed`;
233
- if (Object.hasOwn(rule, "const") && canonicalJson(rule.const) !== canonicalJson(value)) return `${path} does not equal the required value`;
231
+ if (types.length && !types.some((type) => type === "object" ? value !== null && typeof value === "object" && !Array.isArray(value) : type === "array" ? Array.isArray(value) : type === "null" ? value === null : type === "integer" ? typeof value === "number" && Number.isInteger(value) : typeof value === type)) return `${path2} must be ${types.join(" or ")}`;
232
+ if (Array.isArray(rule.enum) && !rule.enum.some((candidate) => canonicalJson(candidate) === canonicalJson(value))) return `${path2} is not allowed`;
233
+ if (Object.hasOwn(rule, "const") && canonicalJson(rule.const) !== canonicalJson(value)) return `${path2} does not equal the required value`;
234
234
  if (typeof value === "string") {
235
- if (typeof rule.minLength === "number" && value.length < rule.minLength) return `${path} is too short`;
236
- if (typeof rule.maxLength === "number" && value.length > rule.maxLength) return `${path} is too long`;
237
- if (typeof rule.pattern === "string" && !new RegExp(rule.pattern, "u").test(value)) return `${path} does not match the required pattern`;
235
+ if (typeof rule.minLength === "number" && value.length < rule.minLength) return `${path2} is too short`;
236
+ if (typeof rule.maxLength === "number" && value.length > rule.maxLength) return `${path2} is too long`;
237
+ if (typeof rule.pattern === "string" && !new RegExp(rule.pattern, "u").test(value)) return `${path2} does not match the required pattern`;
238
238
  }
239
239
  if (typeof value === "number") {
240
- if (typeof rule.minimum === "number" && value < rule.minimum) return `${path} is below minimum`;
241
- if (typeof rule.maximum === "number" && value > rule.maximum) return `${path} is above maximum`;
242
- if (typeof rule.exclusiveMinimum === "number" && value <= rule.exclusiveMinimum) return `${path} is below exclusive minimum`;
243
- if (typeof rule.exclusiveMaximum === "number" && value >= rule.exclusiveMaximum) return `${path} is above exclusive maximum`;
244
- if (typeof rule.multipleOf === "number" && Math.abs(value / rule.multipleOf - Math.round(value / rule.multipleOf)) > Number.EPSILON * 8) return `${path} is not a multiple`;
240
+ if (typeof rule.minimum === "number" && value < rule.minimum) return `${path2} is below minimum`;
241
+ if (typeof rule.maximum === "number" && value > rule.maximum) return `${path2} is above maximum`;
242
+ if (typeof rule.exclusiveMinimum === "number" && value <= rule.exclusiveMinimum) return `${path2} is below exclusive minimum`;
243
+ if (typeof rule.exclusiveMaximum === "number" && value >= rule.exclusiveMaximum) return `${path2} is above exclusive maximum`;
244
+ if (typeof rule.multipleOf === "number" && Math.abs(value / rule.multipleOf - Math.round(value / rule.multipleOf)) > Number.EPSILON * 8) return `${path2} is not a multiple`;
245
245
  }
246
246
  if (value && typeof value === "object" && !Array.isArray(value)) {
247
247
  const record14 = value;
248
- for (const key of Array.isArray(rule.required) ? rule.required : []) if (typeof key === "string" && !(key in record14)) return `${path}.${key} is required`;
248
+ for (const key of Array.isArray(rule.required) ? rule.required : []) if (typeof key === "string" && !(key in record14)) return `${path2}.${key} is required`;
249
249
  const properties = rule.properties && typeof rule.properties === "object" && !Array.isArray(rule.properties) ? rule.properties : {};
250
- if (typeof rule.minProperties === "number" && Object.keys(record14).length < rule.minProperties) return `${path} has too few properties`;
251
- if (typeof rule.maxProperties === "number" && Object.keys(record14).length > rule.maxProperties) return `${path} has too many properties`;
250
+ if (typeof rule.minProperties === "number" && Object.keys(record14).length < rule.minProperties) return `${path2} has too few properties`;
251
+ if (typeof rule.maxProperties === "number" && Object.keys(record14).length > rule.maxProperties) return `${path2} has too many properties`;
252
252
  if (rule.additionalProperties === false) {
253
253
  const extra = Object.keys(record14).find((key) => !(key in properties));
254
- if (extra) return `${path}.${extra} is not allowed`;
254
+ if (extra) return `${path2}.${extra} is not allowed`;
255
255
  }
256
256
  for (const [key, child] of Object.entries(properties)) if (key in record14) {
257
- const error = validateJsonSchema(record14[key], child, `${path}.${key}`);
257
+ const error = validateJsonSchema(record14[key], child, `${path2}.${key}`);
258
258
  if (error) return error;
259
259
  }
260
260
  if (rule.additionalProperties && typeof rule.additionalProperties === "object") for (const key of Object.keys(record14).filter((candidate) => !(candidate in properties))) {
261
- const error = validateJsonSchema(record14[key], rule.additionalProperties, `${path}.${key}`);
261
+ const error = validateJsonSchema(record14[key], rule.additionalProperties, `${path2}.${key}`);
262
262
  if (error) return error;
263
263
  }
264
264
  }
265
265
  if (Array.isArray(value)) {
266
- if (typeof rule.minItems === "number" && value.length < rule.minItems) return `${path} has too few items`;
267
- if (typeof rule.maxItems === "number" && value.length > rule.maxItems) return `${path} has too many items`;
266
+ if (typeof rule.minItems === "number" && value.length < rule.minItems) return `${path2} has too few items`;
267
+ if (typeof rule.maxItems === "number" && value.length > rule.maxItems) return `${path2} has too many items`;
268
268
  if (rule.items) for (const [index, item] of value.entries()) {
269
- const error = validateJsonSchema(item, rule.items, `${path}[${index}]`);
269
+ const error = validateJsonSchema(item, rule.items, `${path2}[${index}]`);
270
270
  if (error) return error;
271
271
  }
272
272
  if (rule.uniqueItems === true) {
273
273
  const values = value.map(canonicalJson);
274
- if (new Set(values).size !== values.length) return `${path} must contain unique items`;
274
+ if (new Set(values).size !== values.length) return `${path2} must contain unique items`;
275
275
  }
276
276
  }
277
277
  return null;
@@ -341,22 +341,22 @@ var TABLE_QUERY_SCHEMA = {
341
341
  }
342
342
  }
343
343
  };
344
- function validateStageOutputSpec(value, path = "$.output") {
345
- if (!value || typeof value !== "object" || Array.isArray(value)) return `${path} must be an object`;
344
+ function validateStageOutputSpec(value, path2 = "$.output") {
345
+ if (!value || typeof value !== "object" || Array.isArray(value)) return `${path2} must be an object`;
346
346
  const output = value;
347
347
  const extra = Object.keys(output).find((key) => key !== "schema" && key !== "sortOrder");
348
- if (extra) return `${path}.${extra} is not allowed`;
349
- if (!Object.hasOwn(output, "schema")) return `${path}.schema is required`;
350
- const schemaError = validateJsonSchemaDefinition(output.schema, `${path}.schema`);
348
+ if (extra) return `${path2}.${extra} is not allowed`;
349
+ if (!Object.hasOwn(output, "schema")) return `${path2}.schema is required`;
350
+ const schemaError = validateJsonSchemaDefinition(output.schema, `${path2}.schema`);
351
351
  if (schemaError) return schemaError;
352
352
  const sortOrder = output.sortOrder ?? [];
353
- if (!Array.isArray(sortOrder)) return `${path}.sortOrder is invalid`;
353
+ if (!Array.isArray(sortOrder)) return `${path2}.sortOrder is invalid`;
354
354
  const keys = /* @__PURE__ */ new Set();
355
355
  for (const [index, raw] of sortOrder.entries()) {
356
- if (!raw || typeof raw !== "object" || Array.isArray(raw)) return `${path}.sortOrder[${index}] is invalid`;
356
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return `${path2}.sortOrder[${index}] is invalid`;
357
357
  const field2 = raw;
358
358
  if (Object.keys(field2).some((key) => key !== "key" && key !== "direction") || typeof field2.key !== "string" || !/^[a-zA-Z_][a-zA-Z0-9_.-]{0,127}$/u.test(field2.key) || field2.direction !== "asc" && field2.direction !== "desc" || keys.has(field2.key)) {
359
- return `${path}.sortOrder[${index}] is invalid`;
359
+ return `${path2}.sortOrder[${index}] is invalid`;
360
360
  }
361
361
  keys.add(field2.key);
362
362
  }
@@ -590,20 +590,20 @@ function skills(binding = "skills", sandbox = "sandbox") {
590
590
  async run(args, ctx) {
591
591
  const { ref } = await ctx.invoke(ctx.resources[binding], "bundle", { skill: args.skill });
592
592
  const workspace = ctx.sandboxPool(ctx.resources[sandbox]).workspace();
593
- const path = `/workspace/skills/${ref}`;
593
+ const path2 = `/workspace/skills/${ref}`;
594
594
  const bound = args.timeoutMs === void 0 ? void 0 : { timeoutMs: args.timeoutMs };
595
- const present = await workspace.exec({ cmd: "test", args: ["-e", path], ...bound }, bound);
595
+ const present = await workspace.exec({ cmd: "test", args: ["-e", path2], ...bound }, bound);
596
596
  if (present.status !== "completed" || present.exitCode !== 0) {
597
597
  const archive = `/workspace/.constal/imports/${ref}.tar.gz`;
598
598
  const staging = `/workspace/.constal/staging/${ref}`;
599
599
  await required(workspace, args.skill, "mkdir", ["-p", "--", "/workspace/.constal/imports", staging, "/workspace/skills"], args.timeoutMs);
600
600
  await workspace.putFile(archive, ref, bound && { invoke: bound });
601
601
  await required(workspace, args.skill, "tar", ["-xzf", archive, "-C", staging, "--no-same-owner", "--no-same-permissions"], args.timeoutMs);
602
- await required(workspace, args.skill, "mv", ["--", staging, path], args.timeoutMs);
602
+ await required(workspace, args.skill, "mv", ["--", staging, path2], args.timeoutMs);
603
603
  await required(workspace, args.skill, "rm", ["-f", "--", archive], args.timeoutMs);
604
604
  }
605
605
  const { skill: _skill, ...command } = args;
606
- return { path, ...await workspace.exec({ ...command, cwd: path }, bound) };
606
+ return { path: path2, ...await workspace.exec({ ...command, cwd: path2 }, bound) };
607
607
  }
608
608
  };
609
609
  return { [find.name]: find, [read.name]: read, [run.name]: run };
@@ -1173,7 +1173,7 @@ function invocationCredentialUses(value) {
1173
1173
  const result = {};
1174
1174
  for (const [slot, raw] of Object.entries(source).sort(([left], [right]) => left.localeCompare(right))) {
1175
1175
  const use = record2(raw), consumer = record2(use?.consumer);
1176
- if (!NAME3.test(slot) || !use || Object.keys(use).some((key) => key !== "binding" && key !== "consumer") || !consumer || (consumer.kind === "resource" ? Object.keys(consumer).length !== 1 || typeof use.binding === "string" : Object.keys(consumer).some((key) => !["kind", "delivery", "name"].includes(key)) || !(consumer.kind === "process" && (consumer.delivery === "env" || consumer.delivery === "file") || consumer.kind === "egress" && consumer.delivery === "header" || consumer.kind === "browser" && (consumer.delivery === "login" || consumer.delivery === "passkey" || consumer.delivery === "session")) || typeof consumer.name !== "string" || !consumer.name || consumer.name.includes("=") || /[\u0000-\u001f\u007f]/u.test(consumer.name))) throw new TypeError("invocation Credential selection is invalid");
1176
+ if (!NAME3.test(slot) || !use || Object.keys(use).some((key) => key !== "binding" && key !== "consumer") || !consumer || (consumer.kind === "resource" ? Object.keys(consumer).length !== 1 || typeof use.binding === "string" : Object.keys(consumer).some((key) => !["kind", "delivery", "name"].includes(key)) || !(consumer.kind === "process" && (consumer.delivery === "env" || consumer.delivery === "file") || consumer.kind === "browser" && (consumer.delivery === "login" || consumer.delivery === "passkey" || consumer.delivery === "session")) || typeof consumer.name !== "string" || !consumer.name || consumer.name.includes("=") || /[\u0000-\u001f\u007f]/u.test(consumer.name))) throw new TypeError("invocation Credential selection is invalid");
1177
1177
  result[slot] = { binding: resourceCredentialBinding(use.binding), consumer };
1178
1178
  }
1179
1179
  return result;
@@ -1434,28 +1434,28 @@ function normalizeSandboxNetworkPolicy(value, options = {}) {
1434
1434
  }
1435
1435
 
1436
1436
  // packages/sdk/src/definitions.ts
1437
- function requiredString(value, path) {
1438
- if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${path} must be a non-empty string`);
1437
+ function requiredString(value, path2) {
1438
+ if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${path2} must be a non-empty string`);
1439
1439
  }
1440
- function validateExecutable(value, path) {
1441
- requiredString(value.id, `${path}.id`);
1442
- requiredString(value.version, `${path}.version`);
1440
+ function validateExecutable(value, path2) {
1441
+ requiredString(value.id, `${path2}.id`);
1442
+ requiredString(value.version, `${path2}.version`);
1443
1443
  }
1444
- function validateTool(tool, path = "tool") {
1445
- requiredString(tool.name, `${path}.name`);
1444
+ function validateTool(tool, path2 = "tool") {
1445
+ requiredString(tool.name, `${path2}.name`);
1446
1446
  if (tool.title !== void 0 && (typeof tool.title !== "string" || tool.title.trim() === "" || /[\n\v\f\r\u0085\u2028\u2029]/u.test(tool.title))) {
1447
- throw new TypeError(`${path}.title must be a non-empty single line`);
1447
+ throw new TypeError(`${path2}.title must be a non-empty single line`);
1448
1448
  }
1449
- requiredString(tool.version, `${path}.version`);
1450
- if (!["read-only", "idempotent", "reconcilable", "non-idempotent"].includes(tool.maxEffect)) throw new TypeError(`${path}.maxEffect is invalid`);
1449
+ requiredString(tool.version, `${path2}.version`);
1450
+ if (!["read-only", "idempotent", "reconcilable", "non-idempotent"].includes(tool.maxEffect)) throw new TypeError(`${path2}.maxEffect is invalid`);
1451
1451
  tool.needs?.forEach(resourceNeed);
1452
- if (tool.preview !== void 0 && typeof tool.preview !== "function") throw new TypeError(`${path}.preview must be a function`);
1453
- if (typeof tool.run !== "function") throw new TypeError(`${path}.run must be a function`);
1452
+ if (tool.preview !== void 0 && typeof tool.preview !== "function") throw new TypeError(`${path2}.preview must be a function`);
1453
+ if (typeof tool.run !== "function") throw new TypeError(`${path2}.run must be a function`);
1454
1454
  return tool;
1455
1455
  }
1456
- function validateView(view, path = "view") {
1457
- validateExecutable(view, path);
1458
- if (typeof view.init !== "function" || typeof view.apply !== "function") throw new TypeError(`${path} must define init and apply`);
1456
+ function validateView(view, path2 = "view") {
1457
+ validateExecutable(view, path2);
1458
+ if (typeof view.init !== "function" || typeof view.apply !== "function") throw new TypeError(`${path2} must define init and apply`);
1459
1459
  return view;
1460
1460
  }
1461
1461
  function validatePartitionFn(fn) {
@@ -1523,12 +1523,12 @@ function authProvider(definition) {
1523
1523
  }
1524
1524
 
1525
1525
  // packages/sdk/src/channel.ts
1526
- function required2(value, path) {
1527
- if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${path} must be a non-empty string`);
1526
+ function required2(value, path2) {
1527
+ if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${path2} must be a non-empty string`);
1528
1528
  }
1529
- function executable(value, path) {
1530
- required2(value.id, `${path}.id`);
1531
- required2(value.version, `${path}.version`);
1529
+ function executable(value, path2) {
1530
+ required2(value.id, `${path2}.id`);
1531
+ required2(value.version, `${path2}.version`);
1532
1532
  }
1533
1533
  function channel(definition) {
1534
1534
  executable(definition, "channel");
@@ -1641,8 +1641,8 @@ var UI_ASSET_CONTENT_TYPES = Object.freeze({
1641
1641
  mp3: "audio/mpeg",
1642
1642
  mp4: "video/mp4"
1643
1643
  });
1644
- function uiAssetContentType(path) {
1645
- const name = path.slice(path.lastIndexOf("/") + 1);
1644
+ function uiAssetContentType(path2) {
1645
+ const name = path2.slice(path2.lastIndexOf("/") + 1);
1646
1646
  const dot = name.lastIndexOf(".");
1647
1647
  const extension = dot > 0 ? name.slice(dot + 1).toLowerCase() : "";
1648
1648
  return Object.hasOwn(UI_ASSET_CONTENT_TYPES, extension) ? UI_ASSET_CONTENT_TYPES[extension] : "application/octet-stream";
@@ -1675,34 +1675,34 @@ function uiBundle(value, execution) {
1675
1675
  if (moduleEntries.length < 1 || moduleEntries.length > UI_BUNDLE_BOUNDS.maximumModules || assetEntries.length > UI_BUNDLE_BOUNDS.maximumAssets || !Object.hasOwn(modules, manifest2.runtime.entry)) {
1676
1676
  throw new TypeError("UI bundle file inventory is invalid");
1677
1677
  }
1678
- const paths2 = /* @__PURE__ */ new Set();
1678
+ const paths = /* @__PURE__ */ new Set();
1679
1679
  let expandedBytes = 0;
1680
1680
  const normalizedModules = {};
1681
1681
  for (const [rawPath, rawModule] of moduleEntries.sort(([left], [right]) => left.localeCompare(right))) {
1682
- const path = safePath(rawPath, "UI module path");
1682
+ const path2 = safePath(rawPath, "UI module path");
1683
1683
  const module = object(rawModule, "UI module is invalid");
1684
1684
  exactKeys(module, ["type", "source"], ["type", "source"]);
1685
- if (path.split("/").some((part) => part.startsWith(PLATFORM_MODULE_PREFIX))) {
1685
+ if (path2.split("/").some((part) => part.startsWith(PLATFORM_MODULE_PREFIX))) {
1686
1686
  throw new TypeError("UI module path uses the reserved platform namespace");
1687
1687
  }
1688
1688
  if (module.type !== "esmodule" || typeof module.source !== "string" || SECRET.test(module.source)) throw new TypeError("UI module is invalid or contains secret material");
1689
1689
  const bytes = byteLength(module.source);
1690
- if (bytes > UI_BUNDLE_BOUNDS.maximumFileBytes || paths2.has(path)) throw new TypeError("UI module path or size is invalid");
1691
- paths2.add(path);
1690
+ if (bytes > UI_BUNDLE_BOUNDS.maximumFileBytes || paths.has(path2)) throw new TypeError("UI module path or size is invalid");
1691
+ paths.add(path2);
1692
1692
  expandedBytes += bytes;
1693
- normalizedModules[path] = { type: "esmodule", source: module.source };
1693
+ normalizedModules[path2] = { type: "esmodule", source: module.source };
1694
1694
  }
1695
1695
  const normalizedAssets = {};
1696
1696
  for (const [rawPath, rawAsset] of assetEntries.sort(([left], [right]) => left.localeCompare(right))) {
1697
- const path = safePath(rawPath, "UI asset path");
1697
+ const path2 = safePath(rawPath, "UI asset path");
1698
1698
  const asset = object(rawAsset, "UI asset is invalid");
1699
1699
  exactKeys(asset, ["bodyBase64", "contentType"], ["bodyBase64", "contentType"]);
1700
- if (typeof asset.bodyBase64 !== "string" || !BASE64.test(asset.bodyBase64) || typeof asset.contentType !== "string" || !CONTENT_TYPE.test(asset.contentType) || paths2.has(path)) throw new TypeError("UI asset is invalid");
1700
+ if (typeof asset.bodyBase64 !== "string" || !BASE64.test(asset.bodyBase64) || typeof asset.contentType !== "string" || !CONTENT_TYPE.test(asset.contentType) || paths.has(path2)) throw new TypeError("UI asset is invalid");
1701
1701
  const bytes = Math.floor(asset.bodyBase64.length * 3 / 4) - (asset.bodyBase64.endsWith("==") ? 2 : asset.bodyBase64.endsWith("=") ? 1 : 0);
1702
1702
  if (bytes > UI_BUNDLE_BOUNDS.maximumFileBytes) throw new TypeError("UI asset exceeds the file limit");
1703
- paths2.add(path);
1703
+ paths.add(path2);
1704
1704
  expandedBytes += bytes;
1705
- normalizedAssets[path] = { bodyBase64: asset.bodyBase64, contentType: asset.contentType };
1705
+ normalizedAssets[path2] = { bodyBase64: asset.bodyBase64, contentType: asset.contentType };
1706
1706
  }
1707
1707
  if (!Object.hasOwn(normalizedAssets, `${manifest2.assets.root}/${manifest2.assets.fallback}`)) {
1708
1708
  throw new TypeError("UI bundle fallback asset is unavailable");
@@ -2477,66 +2477,66 @@ var encoder4 = new TextEncoder();
2477
2477
  function record4(value) {
2478
2478
  return !!value && typeof value === "object" && !Array.isArray(value);
2479
2479
  }
2480
- function requiredString2(value, path, _maximum) {
2480
+ function requiredString2(value, path2, _maximum) {
2481
2481
  if (typeof value !== "string" || value.length === 0) {
2482
- throw new TypeError(`${path} must be a non-empty string`);
2482
+ throw new TypeError(`${path2} must be a non-empty string`);
2483
2483
  }
2484
2484
  }
2485
- function exactKeys2(value, allowed, required3, path) {
2485
+ function exactKeys2(value, allowed, required3, path2) {
2486
2486
  if (Object.keys(value).some((key) => !allowed.includes(key)) || required3.some((key) => !Object.hasOwn(value, key))) {
2487
- throw new TypeError(`${path} has invalid keys`);
2487
+ throw new TypeError(`${path2} has invalid keys`);
2488
2488
  }
2489
2489
  }
2490
2490
  function scalar2(value) {
2491
2491
  return value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "number" && Number.isFinite(value);
2492
2492
  }
2493
- function validateGrant(grant, path) {
2493
+ function validateGrant(grant, path2) {
2494
2494
  if (!record4(grant) || !Array.isArray(grant.actions) || grant.actions.length === 0 || !Array.isArray(grant.resources) || grant.resources.length === 0 || !Number.isSafeInteger(grant.ttlMs) || grant.ttlMs < 1 || grant.ttlMs > 864e5) {
2495
- throw new TypeError(`${path} is invalid`);
2495
+ throw new TypeError(`${path2} is invalid`);
2496
2496
  }
2497
- exactKeys2(grant, ["actions", "resources", "ttlMs"], ["actions", "resources", "ttlMs"], path);
2497
+ exactKeys2(grant, ["actions", "resources", "ttlMs"], ["actions", "resources", "ttlMs"], path2);
2498
2498
  grant.actions.forEach(actionPattern);
2499
2499
  grant.resources.forEach(resourcePattern);
2500
2500
  }
2501
- function validatePolicyConstraint(constraint, path = "constraint") {
2501
+ function validatePolicyConstraint(constraint, path2 = "constraint") {
2502
2502
  if (!constraint || typeof constraint !== "object" || Array.isArray(constraint) || typeof constraint.kind !== "string") {
2503
- throw new TypeError(`${path} is invalid`);
2503
+ throw new TypeError(`${path2} is invalid`);
2504
2504
  }
2505
2505
  const source = constraint;
2506
2506
  if (constraint.kind === "resource-controls" || constraint.kind === "admission-limit") {
2507
2507
  try {
2508
2508
  validatePolicyGovernanceConstraint(constraint);
2509
2509
  } catch (error) {
2510
- throw new TypeError(`${path} is invalid: ${error instanceof Error ? error.message : String(error)}`);
2510
+ throw new TypeError(`${path2} is invalid: ${error instanceof Error ? error.message : String(error)}`);
2511
2511
  }
2512
2512
  return;
2513
2513
  }
2514
2514
  if (constraint.kind === "arguments") {
2515
- exactKeys2(source, ["kind", "schema"], ["kind", "schema"], path);
2516
- if (!record4(constraint.schema) || validateJsonSchemaDefinition(constraint.schema)) throw new TypeError(`${path}.schema is invalid`);
2515
+ exactKeys2(source, ["kind", "schema"], ["kind", "schema"], path2);
2516
+ if (!record4(constraint.schema) || validateJsonSchemaDefinition(constraint.schema)) throw new TypeError(`${path2}.schema is invalid`);
2517
2517
  return;
2518
2518
  }
2519
2519
  if (constraint.kind === "context") {
2520
- exactKeys2(source, ["kind", "equals"], ["kind", "equals"], path);
2520
+ exactKeys2(source, ["kind", "equals"], ["kind", "equals"], path2);
2521
2521
  if (!record4(constraint.equals) || Object.keys(constraint.equals).length === 0 || Object.entries(constraint.equals).some(([key, value]) => !key || key.length > 256 || !scalar2(value))) {
2522
- throw new TypeError(`${path}.equals is invalid`);
2522
+ throw new TypeError(`${path2}.equals is invalid`);
2523
2523
  }
2524
2524
  return;
2525
2525
  }
2526
2526
  if (constraint.kind === "credential-binding") {
2527
- exactKeys2(source, ["kind", "source", "consumer"], ["kind", "source", "consumer"], path);
2527
+ exactKeys2(source, ["kind", "source", "consumer"], ["kind", "source", "consumer"], path2);
2528
2528
  credentialName(constraint.source);
2529
2529
  parseResourceName(constraint.consumer);
2530
2530
  return;
2531
2531
  }
2532
- throw new TypeError(`${path}.kind is invalid`);
2532
+ throw new TypeError(`${path2}.kind is invalid`);
2533
2533
  }
2534
- function validateConstraints(value, path, required3) {
2534
+ function validateConstraints(value, path2, required3) {
2535
2535
  if (value === void 0 && !required3) return [];
2536
2536
  if (!Array.isArray(value) || required3 && value.length === 0) {
2537
- throw new TypeError(`${path} is invalid`);
2537
+ throw new TypeError(`${path2} is invalid`);
2538
2538
  }
2539
- value.forEach((constraint, index) => validatePolicyConstraint(constraint, `${path}[${index}]`));
2539
+ value.forEach((constraint, index) => validatePolicyConstraint(constraint, `${path2}[${index}]`));
2540
2540
  return value;
2541
2541
  }
2542
2542
  function policyOutcome(value) {
@@ -2860,8 +2860,8 @@ function integrationEgressPolicy(value) {
2860
2860
  }
2861
2861
  const rules = source.rules.map((raw) => {
2862
2862
  const rule = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
2863
- const paths2 = Number(rule?.pathPrefix !== void 0) + Number(rule?.pathExact !== void 0);
2864
- if (!rule || !Array.isArray(rule.operations) || rule.operations.length === 0 || rule.operations.some((operation) => typeof operation !== "string" || operation !== "*" && !OPERATION3.test(operation)) || typeof rule.origin !== "string" || paths2 !== 1 || !Array.isArray(rule.methods) || rule.methods.length === 0 || rule.methods.length > 8 || rule.methods.some((method) => typeof method !== "string" || !/^(?:GET|POST|PUT|PATCH|DELETE)$/u.test(method)) || Object.keys(rule).some((key) => !["operations", "origin", "pathPrefix", "pathExact", "methods"].includes(key))) {
2863
+ const paths = Number(rule?.pathPrefix !== void 0) + Number(rule?.pathExact !== void 0);
2864
+ if (!rule || !Array.isArray(rule.operations) || rule.operations.length === 0 || rule.operations.some((operation) => typeof operation !== "string" || operation !== "*" && !OPERATION3.test(operation)) || typeof rule.origin !== "string" || paths !== 1 || !Array.isArray(rule.methods) || rule.methods.length === 0 || rule.methods.length > 8 || rule.methods.some((method) => typeof method !== "string" || !/^(?:GET|POST|PUT|PATCH|DELETE)$/u.test(method)) || Object.keys(rule).some((key) => !["operations", "origin", "pathPrefix", "pathExact", "methods"].includes(key))) {
2865
2865
  throw new TypeError("integration egress rule is invalid");
2866
2866
  }
2867
2867
  let origin;
@@ -2873,8 +2873,8 @@ function integrationEgressPolicy(value) {
2873
2873
  if (origin.protocol !== "https:" || origin.origin !== rule.origin || origin.username || origin.password) {
2874
2874
  throw new TypeError("integration egress origin is invalid");
2875
2875
  }
2876
- const path = String(rule.pathPrefix ?? rule.pathExact);
2877
- if (!path.startsWith("/") || path.includes("?") || path.includes("#")) throw new TypeError("integration egress path is invalid");
2876
+ const path2 = String(rule.pathPrefix ?? rule.pathExact);
2877
+ if (!path2.startsWith("/") || path2.includes("?") || path2.includes("#")) throw new TypeError("integration egress path is invalid");
2878
2878
  return rule;
2879
2879
  });
2880
2880
  return { rules };
@@ -3521,8 +3521,8 @@ async function resolveContainerImageSource(reference, platform, request, authori
3521
3521
  }
3522
3522
 
3523
3523
  // packages/sdk/src/sandbox-egress.ts
3524
- var SANDBOX_EGRESS_LIMITS = { rules: 64, credentialRules: 16, hostsPerRule: 32, labels: 16, labelValueLength: 256 };
3525
- var HEADER2 = /^[a-z0-9!#$%&'*+.^_`|~-]{1,64}$/u;
3524
+ var SANDBOX_EGRESS_LIMITS = { rules: 64, labels: 16, labelValueLength: 256 };
3525
+ var HEADER2 = /^[a-z0-9!#$%&'*+.^_`|~-]+$/u;
3526
3526
  var RESERVED_HEADERS2 = /* @__PURE__ */ new Set([
3527
3527
  "connection",
3528
3528
  "content-length",
@@ -3534,8 +3534,6 @@ var RESERVED_HEADERS2 = /* @__PURE__ */ new Set([
3534
3534
  "transfer-encoding",
3535
3535
  "upgrade"
3536
3536
  ]);
3537
- var SLOT = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
3538
- var USE = /^egress-(?:0|[1-9][0-9]?)$/u;
3539
3537
  var LABEL = /^[a-z0-9][a-z0-9._-]{0,62}$/u;
3540
3538
  function object4(value) {
3541
3539
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
@@ -3544,57 +3542,55 @@ function sandboxEgressHostMatches(pattern, hostname) {
3544
3542
  const host2 = hostname.toLowerCase().replace(/\.$/u, "");
3545
3543
  return pattern.startsWith("*.") ? host2 === pattern.slice(2) || host2.endsWith(pattern.slice(1)) : host2 === pattern;
3546
3544
  }
3547
- function sandboxEgressCredentialRuleFor(rules, url) {
3548
- const target = typeof url === "string" ? new URL(url) : url;
3549
- return rules.find((rule) => rule.hosts.some((pattern) => sandboxEgressHostMatches(pattern, target.hostname)) && (!rule.paths || rule.paths.some((path) => target.pathname === path || target.pathname.startsWith(`${path}/`))));
3550
- }
3551
3545
  function host(value) {
3552
3546
  const [normalized] = normalizeSandboxDomains([value]);
3553
3547
  return normalized;
3554
3548
  }
3555
- function headerRule(rule) {
3556
- const header = rule.header === void 0 ? "authorization" : rule.header;
3557
- if (typeof header !== "string" || !HEADER2.test(header.toLowerCase()) || RESERVED_HEADERS2.has(header.toLowerCase()) || header.toLowerCase().startsWith("x-constal-")) throw new TypeError("sandbox egress Credential header is invalid");
3558
- if (rule.value !== void 0 && rule.basic !== void 0) throw new TypeError("sandbox egress Credential rule takes value or basic, not both");
3559
- if (rule.value !== void 0 && (typeof rule.value !== "string" || rule.value.length > 256 || /[\r\n\0]/u.test(rule.value) || rule.value.split("{value}").length !== 2)) throw new TypeError("sandbox egress Credential value must contain {value} exactly once");
3560
- const basic = rule.basic === void 0 ? void 0 : object4(rule.basic);
3561
- if (rule.basic !== void 0 && (!basic || Object.keys(basic).some((key) => key !== "username") || basic.username !== void 0 && (typeof basic.username !== "string" || !basic.username || basic.username.length > 128 || /[:\r\n\0]/u.test(basic.username)))) throw new TypeError("sandbox egress Credential basic auth is invalid");
3562
- if (rule.field !== void 0 && (typeof rule.field !== "string" || !rule.field.startsWith("/") || rule.field.length > 256 || SPACE_OR_CONTROL.test(rule.field) || /~(?![01])/u.test(rule.field))) throw new TypeError("sandbox egress Credential field must be a JSON Pointer");
3563
- if (rule.code !== void 0 && rule.code !== "totp") throw new TypeError("sandbox egress Credential code must be totp");
3549
+ function presentation(present) {
3550
+ const header = present.header === void 0 ? "authorization" : present.header;
3551
+ if (typeof header !== "string" || !HEADER2.test(header.toLowerCase()) || RESERVED_HEADERS2.has(header.toLowerCase()) || header.toLowerCase().startsWith("x-constal-")) throw new TypeError("Credential destination header is invalid");
3552
+ if (present.value !== void 0 && present.basic !== void 0) throw new TypeError("Credential destination takes value or basic, not both");
3553
+ if (present.value !== void 0 && (typeof present.value !== "string" || /[\r\n\0]/u.test(present.value) || present.value.split("{value}").length !== 2)) throw new TypeError("Credential destination value must contain {value} exactly once");
3554
+ const basic = present.basic === void 0 ? void 0 : object4(present.basic);
3555
+ if (present.basic !== void 0 && (!basic || Object.keys(basic).some((key) => key !== "username") || basic.username !== void 0 && (typeof basic.username !== "string" || !basic.username || /[:\r\n\0]/u.test(basic.username)))) throw new TypeError("Credential destination basic auth is invalid");
3556
+ if (present.field !== void 0 && (typeof present.field !== "string" || !present.field.startsWith("/") || SPACE_OR_CONTROL.test(present.field) || /~(?![01])/u.test(present.field))) throw new TypeError("Credential destination field must be a JSON Pointer");
3557
+ if (present.code !== void 0 && present.code !== "totp") throw new TypeError("Credential destination code must be totp");
3564
3558
  return {
3565
3559
  header: header.toLowerCase(),
3566
- ...basic ? { basic: basic.username === void 0 ? {} : { username: basic.username } } : { value: rule.value ?? "Bearer {value}" },
3567
- ...rule.field !== void 0 ? { field: rule.field } : {},
3568
- ...rule.code !== void 0 ? { code: "totp" } : {}
3560
+ ...basic ? { basic: basic.username === void 0 ? {} : { username: basic.username } } : { value: present.value ?? "Bearer {value}" },
3561
+ ...present.field !== void 0 ? { field: present.field } : {},
3562
+ ...present.code !== void 0 ? { code: "totp" } : {}
3569
3563
  };
3570
3564
  }
3571
3565
  var SPACE_OR_CONTROL = /[\s\u0000-\u001f\u007f]/u;
3572
- function paths(value) {
3573
- if (!Array.isArray(value) || value.length === 0 || value.length > SANDBOX_EGRESS_LIMITS.hostsPerRule) {
3574
- throw new TypeError("sandbox egress Credential paths are invalid");
3566
+ function path(raw) {
3567
+ if (typeof raw !== "string" || !raw.startsWith("/") || /[%?#\\]/u.test(raw) || SPACE_OR_CONTROL.test(raw)) {
3568
+ throw new TypeError("Credential destination path is invalid");
3575
3569
  }
3576
- return [...new Set(value.map((raw) => {
3577
- if (typeof raw !== "string" || !raw.startsWith("/") || /[%?#\\]/u.test(raw) || SPACE_OR_CONTROL.test(raw)) {
3578
- throw new TypeError("sandbox egress Credential path is invalid");
3579
- }
3580
- const path = raw.length > 1 && raw.endsWith("/") ? raw.slice(0, -1) : raw;
3581
- if (path.slice(1).split("/").some((segment) => segment === "" || segment === "." || segment === "..")) {
3582
- throw new TypeError("sandbox egress Credential path is invalid");
3583
- }
3584
- return path;
3585
- }))].sort();
3586
- }
3587
- function gitRefName(ref) {
3588
- return ref.length > 0 && !ref.includes("..") && !ref.includes("//") && !ref.includes("@{") && !/[~^:?\[\\*]/u.test(ref) && !SPACE_OR_CONTROL.test(ref) && !ref.endsWith("/") && !ref.endsWith(".") && ref.split("/").every((component) => !component.startsWith(".") && !component.endsWith(".lock"));
3570
+ const prefix = raw.length > 1 && raw.endsWith("/") ? raw.slice(0, -1) : raw;
3571
+ if (prefix.slice(1).split("/").some((segment) => segment === "" || segment === "." || segment === "..")) {
3572
+ throw new TypeError("Credential destination path is invalid");
3573
+ }
3574
+ return prefix;
3589
3575
  }
3590
- function pushRefs(value) {
3591
- if (!Array.isArray(value) || value.length > SANDBOX_EGRESS_LIMITS.hostsPerRule) throw new TypeError("sandbox egress Credential push refs are invalid");
3592
- return [...new Set(value.map((raw) => {
3593
- if (typeof raw !== "string" || !raw.startsWith("refs/") || !gitRefName(raw.endsWith("/*") ? raw.slice(0, -2) : raw)) {
3594
- throw new TypeError("sandbox egress Credential push ref is invalid");
3576
+ function normalizeCredentialDestinations(value) {
3577
+ if (value === void 0) return [];
3578
+ if (!Array.isArray(value)) throw new TypeError("Credential destinations are invalid");
3579
+ const destinations = value.map((raw) => {
3580
+ const destination = object4(raw);
3581
+ const present = object4(destination?.present);
3582
+ if (!destination || Object.keys(destination).some((key) => !["origin", "path", "present"].includes(key)) || typeof destination.origin !== "string" || !destination.origin.startsWith("https://") || !present || Object.keys(present).some((key) => !["header", "value", "basic", "field", "code"].includes(key))) {
3583
+ throw new TypeError("Credential destination is invalid");
3595
3584
  }
3596
- return raw;
3597
- }))].sort();
3585
+ return {
3586
+ origin: `https://${host(destination.origin.slice("https://".length))}`,
3587
+ ...destination.path !== void 0 ? { path: path(destination.path) } : {},
3588
+ present: presentation(present)
3589
+ };
3590
+ });
3591
+ const headers = destinations.map((destination) => JSON.stringify([destination.origin, destination.path ?? null, destination.present.header]));
3592
+ if (new Set(headers).size !== headers.length) throw new TypeError("Credential destinations of one origin and path name a header twice");
3593
+ return destinations;
3598
3594
  }
3599
3595
  function normalizeSandboxEgressPolicy(value) {
3600
3596
  const input = object4(value);
@@ -3616,41 +3612,6 @@ function sandboxEgressDecision(policy2, hostname) {
3616
3612
  if (index < 0) return { allowed: policy2.default === "allow", rule: "sandbox:default" };
3617
3613
  return { allowed: policy2.rules[index].action === "allow", rule: `sandbox:${index}` };
3618
3614
  }
3619
- function normalizeSandboxEgressCredentialRules(value, options = {}) {
3620
- if (value === void 0) return [];
3621
- if (!Array.isArray(value) || value.length > SANDBOX_EGRESS_LIMITS.credentialRules) throw new TypeError("sandbox egress Credential rules are invalid");
3622
- return value.map((raw) => {
3623
- const rule = object4(raw);
3624
- const allowed = ["hosts", "paths", "slot", "header", "value", "basic", "field", "code", "headers", "push", ...options.bindings ? ["binding"] : [], ...options.uses ? ["use"] : []];
3625
- if (!rule || Object.keys(rule).some((key) => !allowed.includes(key)) || !Array.isArray(rule.hosts) || rule.hosts.length === 0 || rule.hosts.length > SANDBOX_EGRESS_LIMITS.hostsPerRule) throw new TypeError("sandbox egress Credential rule is invalid");
3626
- const sources = [rule.slot, rule.binding, rule.use].filter((source) => source !== void 0);
3627
- if (sources.length !== 1 || rule.slot !== void 0 && (typeof rule.slot !== "string" || !SLOT.test(rule.slot)) || rule.use !== void 0 && (typeof rule.use !== "string" || !USE.test(rule.use))) {
3628
- throw new TypeError("sandbox egress Credential rule names exactly one slot or binding");
3629
- }
3630
- const own = headerRule(rule);
3631
- if (rule.headers !== void 0 && (!Array.isArray(rule.headers) || rule.headers.length === 0 || rule.headers.length > SANDBOX_EGRESS_LIMITS.credentialRules)) throw new TypeError("sandbox egress Credential headers are invalid");
3632
- const more = rule.headers?.map((raw2) => {
3633
- const entry2 = object4(raw2);
3634
- if (!entry2 || Object.keys(entry2).some((key) => !["header", "value", "basic", "field", "code"].includes(key))) {
3635
- throw new TypeError("sandbox egress Credential header is invalid");
3636
- }
3637
- return headerRule(entry2);
3638
- });
3639
- if (more && (/* @__PURE__ */ new Set([own.header, ...more.map((entry2) => entry2.header)])).size !== more.length + 1) {
3640
- throw new TypeError("sandbox egress Credential rule names a header twice");
3641
- }
3642
- return {
3643
- hosts: normalizeSandboxDomains(rule.hosts),
3644
- ...rule.paths !== void 0 ? { paths: paths(rule.paths) } : {},
3645
- ...rule.slot !== void 0 ? { slot: rule.slot } : {},
3646
- ...rule.binding !== void 0 ? { binding: resourceCredentialBinding(rule.binding) } : {},
3647
- ...rule.use !== void 0 ? { use: rule.use } : {},
3648
- ...own,
3649
- ...more ? { headers: more } : {},
3650
- ...rule.push !== void 0 ? { push: pushRefs(rule.push) } : {}
3651
- };
3652
- });
3653
- }
3654
3615
  function normalizeSandboxLabels(value) {
3655
3616
  if (value === void 0) return {};
3656
3617
  const input = object4(value);
@@ -3674,15 +3635,15 @@ function absoluteSandboxPath(value) {
3674
3635
  }
3675
3636
  return `/${segments.join("/")}`;
3676
3637
  }
3677
- function normalizeSandboxWorkspacePath(path, cwd = WORKSPACE_ROOT) {
3678
- if (typeof path !== "string" || !path || typeof cwd !== "string" || !cwd || /[\u0000-\u001f\u007f]/u.test(path) || /[\u0000-\u001f\u007f]/u.test(cwd)) {
3638
+ function normalizeSandboxWorkspacePath(path2, cwd = WORKSPACE_ROOT) {
3639
+ if (typeof path2 !== "string" || !path2 || typeof cwd !== "string" || !cwd || /[\u0000-\u001f\u007f]/u.test(path2) || /[\u0000-\u001f\u007f]/u.test(cwd)) {
3679
3640
  throw new TypeError("sandbox workspace path is invalid");
3680
3641
  }
3681
3642
  const base = absoluteSandboxPath(cwd.startsWith("/") ? cwd : `${WORKSPACE_ROOT}/${cwd}`);
3682
3643
  if (base !== WORKSPACE_ROOT && !base.startsWith(`${WORKSPACE_ROOT}/`)) {
3683
3644
  throw new TypeError("sandbox working directory is outside /workspace");
3684
3645
  }
3685
- const normalized = absoluteSandboxPath(path.startsWith("/") ? path : `${base}/${path}`);
3646
+ const normalized = absoluteSandboxPath(path2.startsWith("/") ? path2 : `${base}/${path2}`);
3686
3647
  if (normalized !== WORKSPACE_ROOT && !normalized.startsWith(`${WORKSPACE_ROOT}/`)) {
3687
3648
  throw new TypeError("sandbox path is outside /workspace");
3688
3649
  }
@@ -3878,7 +3839,7 @@ function startTrainingRequest(value) {
3878
3839
  async function checkpointArtifactRef(value) {
3879
3840
  return await sha256Hex(canonicalJson(value));
3880
3841
  }
3881
- var SLOT2 = /^[a-z0-9][a-z0-9._-]{0,127}$/u;
3842
+ var SLOT = /^[a-z0-9][a-z0-9._-]{0,127}$/u;
3882
3843
  var HASH5 = /^[a-f0-9]{64}$/u;
3883
3844
  var MODEL_RESOURCE_ID = /^[a-z0-9][a-z0-9-]{0,62}$/u;
3884
3845
  function httpsUrl(value, field2) {
@@ -3898,7 +3859,7 @@ function slotMetadata(value) {
3898
3859
  const output = {};
3899
3860
  for (const [slot, raw] of entries) {
3900
3861
  const item = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
3901
- if (!SLOT2.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" || !SLOT2.test(item.provider)) || Object.keys(item).some((key) => !["title", "description", "documentationUrl", "required", "provider"].includes(key))) {
3862
+ 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))) {
3902
3863
  throw new TypeError("Gateway Credential slots are invalid");
3903
3864
  }
3904
3865
  httpsUrl(item.documentationUrl, "Gateway Credential slot documentation URL");
@@ -3911,7 +3872,7 @@ function configEgressBindings(value) {
3911
3872
  if (!Array.isArray(value)) throw new TypeError("Gateway config egress bindings are invalid");
3912
3873
  return value.map((raw) => {
3913
3874
  const item = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
3914
- if (!item || !SLOT2.test(String(item.urlProperty ?? "")) || !Array.isArray(item.operations) || item.operations.length === 0 || item.operations.some((operation) => typeof operation !== "string" || operation !== "*" && !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/u.test(operation)) || !Array.isArray(item.methods) || item.methods.length === 0 || item.methods.some((method) => typeof method !== "string" || !/^(?:GET|POST|PUT|PATCH|DELETE)$/u.test(method)) || Object.keys(item).some((key) => !["urlProperty", "operations", "methods"].includes(key))) {
3875
+ if (!item || !SLOT.test(String(item.urlProperty ?? "")) || !Array.isArray(item.operations) || item.operations.length === 0 || item.operations.some((operation) => typeof operation !== "string" || operation !== "*" && !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/u.test(operation)) || !Array.isArray(item.methods) || item.methods.length === 0 || item.methods.some((method) => typeof method !== "string" || !/^(?:GET|POST|PUT|PATCH|DELETE)$/u.test(method)) || Object.keys(item).some((key) => !["urlProperty", "operations", "methods"].includes(key))) {
3915
3876
  throw new TypeError("Gateway config egress bindings are invalid");
3916
3877
  }
3917
3878
  return {
@@ -3924,7 +3885,7 @@ function configEgressBindings(value) {
3924
3885
  function discoverySetup(value) {
3925
3886
  if (value === void 0) return void 0;
3926
3887
  const item = value && typeof value === "object" && !Array.isArray(value) ? value : null;
3927
- if (!item || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/u.test(String(item.operation ?? "")) || !SLOT2.test(String(item.resultConfigProperty ?? "")) || Object.keys(item).some((key) => !["operation", "resultConfigProperty"].includes(key))) {
3888
+ if (!item || !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/u.test(String(item.operation ?? "")) || !SLOT.test(String(item.resultConfigProperty ?? "")) || Object.keys(item).some((key) => !["operation", "resultConfigProperty"].includes(key))) {
3928
3889
  throw new TypeError("Gateway discovery setup is invalid");
3929
3890
  }
3930
3891
  return { operation: String(item.operation), resultConfigProperty: String(item.resultConfigProperty) };
@@ -3989,7 +3950,7 @@ function gatewayModelOffer(value) {
3989
3950
  const modalities = (field2) => {
3990
3951
  const values = source[field2];
3991
3952
  if (values === void 0) return void 0;
3992
- if (!Array.isArray(values) || values.length === 0 || values.some((item) => typeof item !== "string" || !SLOT2.test(item)) || new Set(values).size !== values.length) {
3953
+ if (!Array.isArray(values) || values.length === 0 || values.some((item) => typeof item !== "string" || !SLOT.test(item)) || new Set(values).size !== values.length) {
3993
3954
  throw new TypeError("Gateway Model offer is invalid");
3994
3955
  }
3995
3956
  return values;
@@ -4877,10 +4838,10 @@ function codeScorerIR(value) {
4877
4838
  if (!ir || ir.v !== 1 || !exactKeys5(ir, ["v", "rule"])) throw new TypeError("Code Scorer IR is invalid");
4878
4839
  return { v: 1, rule: scorerRule(ir.rule, 0, { rules: 0 }) };
4879
4840
  }
4880
- function pointer(value, path) {
4881
- if (path === "") return { found: true, value };
4841
+ function pointer(value, path2) {
4842
+ if (path2 === "") return { found: true, value };
4882
4843
  let current = value;
4883
- for (const encoded of path.slice(1).split("/")) {
4844
+ for (const encoded of path2.slice(1).split("/")) {
4884
4845
  const key = encoded.replace(/~1/gu, "/").replace(/~0/gu, "~");
4885
4846
  if (Array.isArray(current)) {
4886
4847
  if (!/^(?:0|[1-9][0-9]*)$/u.test(key) || Number(key) >= current.length) return { found: false, value: void 0 };
@@ -4893,8 +4854,8 @@ function pointer(value, path) {
4893
4854
  }
4894
4855
  return { found: true, value: current };
4895
4856
  }
4896
- function fail(path, reason) {
4897
- return { pass: false, checks: 1, failures: [{ path, reason }] };
4857
+ function fail(path2, reason) {
4858
+ return { pass: false, checks: 1, failures: [{ path: path2, reason }] };
4898
4859
  }
4899
4860
  function pass() {
4900
4861
  return { pass: true, checks: 1, failures: [] };
@@ -5390,8 +5351,8 @@ export {
5390
5351
  modelProtocolRequest,
5391
5352
  modelProtocolResult,
5392
5353
  murmur3_32,
5354
+ normalizeCredentialDestinations,
5393
5355
  normalizeModelGatewayConfig,
5394
- normalizeSandboxEgressCredentialRules,
5395
5356
  normalizeSandboxEgressPolicy,
5396
5357
  normalizeSandboxLabels,
5397
5358
  normalizeSandboxNetworkPolicy,
@@ -5419,7 +5380,6 @@ export {
5419
5380
  resourceTools,
5420
5381
  runLabels,
5421
5382
  sandboxControls,
5422
- sandboxEgressCredentialRuleFor,
5423
5383
  sandboxEgressDecision,
5424
5384
  sandboxEgressHostMatches,
5425
5385
  sandboxLimit,