@constal/sdk 6.8.0 → 6.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/publish/api.json +5 -5
- package/publish/index.d.ts +108 -127
- package/publish/index.js +169 -204
package/package.json
CHANGED
package/publish/api.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@constal/sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.1",
|
|
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,9 @@
|
|
|
603
603
|
"modelProtocolRequest",
|
|
604
604
|
"modelProtocolResult",
|
|
605
605
|
"murmur3_32",
|
|
606
|
+
"normalizeCredentialDestinations",
|
|
606
607
|
"normalizeModelGatewayConfig",
|
|
607
|
-
"
|
|
608
|
+
"normalizeSandboxConnectionKeys",
|
|
608
609
|
"normalizeSandboxEgressPolicy",
|
|
609
610
|
"normalizeSandboxLabels",
|
|
610
611
|
"normalizeSandboxNetworkPolicy",
|
|
@@ -632,7 +633,6 @@
|
|
|
632
633
|
"resourceTools",
|
|
633
634
|
"runLabels",
|
|
634
635
|
"sandboxControls",
|
|
635
|
-
"sandboxEgressCredentialRuleFor",
|
|
636
636
|
"sandboxEgressDecision",
|
|
637
637
|
"sandboxEgressHostMatches",
|
|
638
638
|
"sandboxLimit",
|
package/publish/index.d.ts
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
+
/** A sandbox may narrow its owner's connections by binding key. An empty list permits no connection. */
|
|
2
|
+
declare function normalizeSandboxConnectionKeys(value: unknown): string[];
|
|
3
|
+
/**
|
|
4
|
+
* A sandbox's own egress settings: an ordered host policy that narrows its pool's network, and labels every egress event
|
|
5
|
+
* carries. They are provider-neutral declarations; a pool whose provider has no egress gate refuses them rather than
|
|
6
|
+
* ignoring them. And where a Credential is used, the destinations it declares: a sandbox's egress gate adds it to the
|
|
7
|
+
* sandbox's requests to them, when it is one of the sandbox owner's connections (docs/sandbox-egress-connections.md).
|
|
8
|
+
*/
|
|
9
|
+
/** One ordered rule: the first rule whose host matches a request decides it. */
|
|
10
|
+
interface SandboxEgressRule {
|
|
11
|
+
action: "allow" | "deny";
|
|
12
|
+
/** An exact host name, or `*.example.com` for the apex and every name under it. */
|
|
13
|
+
host: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A sandbox's narrowing of its pool's network. It never widens it: a request must be admitted by the pool and by this
|
|
17
|
+
* policy. A host no rule matches takes `default` (`deny` when omitted). The pool's control host stays reachable.
|
|
18
|
+
*/
|
|
19
|
+
interface SandboxEgressPolicy {
|
|
20
|
+
rules: SandboxEgressRule[];
|
|
21
|
+
default?: "allow" | "deny";
|
|
22
|
+
}
|
|
23
|
+
/** How a Credential is presented in a request: the one header it sets. A header the sandbox sent under the same name is replaced. */
|
|
24
|
+
interface CredentialPresentation {
|
|
25
|
+
/** The header to set; `authorization` when omitted. */
|
|
26
|
+
header?: string;
|
|
27
|
+
/** The header value, with `{value}` exactly once where the Credential goes; `Bearer {value}` when omitted. */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Instead of `value`: HTTP basic auth, `Basic base64(username:value)`, or `Basic base64(value)` without a username. */
|
|
30
|
+
basic?: {
|
|
31
|
+
username?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* For a Credential whose value is JSON: the JSON Pointer (RFC 6901) of the text that goes in place of the whole value,
|
|
35
|
+
* such as `/accessToken`. A value that is not JSON, or has no non-empty text there, refuses the request. Omitted: the
|
|
36
|
+
* whole value.
|
|
37
|
+
*/
|
|
38
|
+
field?: string;
|
|
39
|
+
/**
|
|
40
|
+
* `totp`: the text (after `field`) is an authenticator seed, RFC 4648 base32, and the header carries the RFC 6238
|
|
41
|
+
* time-based code for the request's time in its place (`{value}` and `basic` apply to the code), such as npm's `npm-otp`.
|
|
42
|
+
* The object the text sits in may give the code's `digits` (6 to 8, RFC 4226 5.3), `period` (whole seconds) and
|
|
43
|
+
* `algorithm` (`SHA1`, `SHA256` or `SHA512`, the Key URI Format's names), each RFC 6238's default (6, 30, `SHA1`) when
|
|
44
|
+
* absent. The seed is redacted from responses as a value is; the code, worthless past its period, is not.
|
|
45
|
+
*/
|
|
46
|
+
code?: "totp";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Where a Credential is used, as its version declares it: its provider's verify answers its destinations, and an imported
|
|
50
|
+
* Credential is given them when it is imported. A sandbox's egress gate adds the Credential, presented as `present`, to an
|
|
51
|
+
* https request of the sandbox that the destination matches, resolved at each request through the platform's Credential
|
|
52
|
+
* use (binding controls, scope, Policy, a use record naming the destination). The sandbox never sees the value, and the
|
|
53
|
+
* gate redacts it from what the response echoes back. A Credential with no destinations is never added to a request.
|
|
54
|
+
*/
|
|
55
|
+
interface CredentialDestination {
|
|
56
|
+
/** `https://` and an exact host name, or `https://*.example.com` for the apex and every name under it. */
|
|
57
|
+
origin: string;
|
|
58
|
+
/**
|
|
59
|
+
* A path prefix on that origin, `/` and whole segments (`/acme`, `/acme/app.git`). A request matches when its path equals
|
|
60
|
+
* it or continues it with `/`. Compared exactly as sent: no case folding, no percent-decoding. Omitted: every path.
|
|
61
|
+
*/
|
|
62
|
+
path?: string;
|
|
63
|
+
present: CredentialPresentation;
|
|
64
|
+
}
|
|
65
|
+
/** Caller-supplied labels a sandbox's events carry: at most 16, short keys, values of at most 256 characters. */
|
|
66
|
+
type SandboxLabels = Record<string, string>;
|
|
67
|
+
declare const SANDBOX_EGRESS_LIMITS: {
|
|
68
|
+
readonly rules: 64;
|
|
69
|
+
readonly labels: 16;
|
|
70
|
+
readonly labelValueLength: 256;
|
|
71
|
+
};
|
|
72
|
+
/** Whether `pattern` (exact, or `*.d` for `d` and every name under it) admits `hostname`. */
|
|
73
|
+
declare function sandboxEgressHostMatches(pattern: string, hostname: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* A Credential version's destinations (none when omitted), canonical: each origin's host lowercased, a path's one trailing
|
|
76
|
+
* `/` dropped, a presentation's header lowercased and its value defaulted. The destinations of one origin and path, which
|
|
77
|
+
* a request gets together, set different headers.
|
|
78
|
+
*/
|
|
79
|
+
declare function normalizeCredentialDestinations(value: unknown): CredentialDestination[];
|
|
80
|
+
declare function normalizeSandboxEgressPolicy(value: unknown): SandboxEgressPolicy;
|
|
81
|
+
/** The decision a policy gives a host: the first matching rule, else its default. Null admits everything. */
|
|
82
|
+
declare function sandboxEgressDecision(policy: SandboxEgressPolicy | null | undefined, hostname: string): {
|
|
83
|
+
allowed: boolean;
|
|
84
|
+
rule: string;
|
|
85
|
+
};
|
|
86
|
+
declare function normalizeSandboxLabels(value: unknown): SandboxLabels;
|
|
87
|
+
|
|
1
88
|
/** Stable capability shared by configured Models and directly bound Gateways. */
|
|
2
89
|
declare const MODEL_COMPLETION_CAPABILITY: CapabilityContractRef;
|
|
3
90
|
/** Capability of Gateways that evaluate state against typed questions (`evaluate`), alongside or instead of completion. */
|
|
@@ -1291,19 +1378,15 @@ type AgentResourceBinding = CRN | ScopedResourceRef;
|
|
|
1291
1378
|
type ResourceCredentialBinding = CredentialCRN | ScopedCredentialRef;
|
|
1292
1379
|
interface InvocationCredentialUse {
|
|
1293
1380
|
binding: ResourceCredentialBinding;
|
|
1294
|
-
/** Who receives the value: a sandbox process (an env variable or a memory-backed file), a
|
|
1295
|
-
* which
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
1298
|
-
*
|
|
1381
|
+
/** Who receives the value: a sandbox process (an env variable or a memory-backed file), a browser Resource's service,
|
|
1382
|
+
* which types it, signs with it or restores it in the browsers it drives for the named login and never returns it (a
|
|
1383
|
+
* login's account name, password and authenticator seed, one of its passkeys, or its saved session), or the invoked
|
|
1384
|
+
* Resource itself: for this call only, its scoped slot of this name holds the Credential the Run's own owner holds under
|
|
1385
|
+
* this key. */
|
|
1299
1386
|
consumer: {
|
|
1300
1387
|
kind: "process";
|
|
1301
1388
|
delivery: "env" | "file";
|
|
1302
1389
|
name: string;
|
|
1303
|
-
} | {
|
|
1304
|
-
kind: "egress";
|
|
1305
|
-
delivery: "header";
|
|
1306
|
-
name: string;
|
|
1307
1390
|
} | {
|
|
1308
1391
|
kind: "browser";
|
|
1309
1392
|
delivery: "login" | "passkey" | "session";
|
|
@@ -1891,128 +1974,21 @@ declare function containerImageSelection(value: unknown): ContainerImageSelectio
|
|
|
1891
1974
|
* manifest. The caller owns registry authentication and transport Policy. */
|
|
1892
1975
|
declare function resolveContainerImageSource(reference: string, platform: ContainerImageSource["platform"], request: ContainerRegistryRequest, authorization?: string): Promise<ContainerImageSource>;
|
|
1893
1976
|
|
|
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
1977
|
/** Canonicalize one provider-neutral path and keep it inside the logical workspace. */
|
|
2005
1978
|
declare function normalizeSandboxWorkspacePath(path: string, cwd?: string): string;
|
|
1979
|
+
/**
|
|
1980
|
+
* A sandbox's https requests carry its owner's connections: the Credential of each enabled binding its customer owns (the
|
|
1981
|
+
* tenant, for a tenant-level Run) in the Agent's namespace, at the destinations that Credential declares
|
|
1982
|
+
* (CredentialDestination). Nothing here names them.
|
|
1983
|
+
*/
|
|
2006
1984
|
interface CreateSandboxOptions {
|
|
1985
|
+
/** Restrict egress credentials to these owner connection keys. Omitted keeps the existing restriction; [] permits none. */
|
|
1986
|
+
connectionKeys?: string[];
|
|
2007
1987
|
image?: SandboxImage;
|
|
2008
1988
|
resetImage?: boolean;
|
|
2009
1989
|
execution?: ContainerImageSelection;
|
|
2010
1990
|
/** Narrows the pool's network for this sandbox; `Sandbox.updateNetwork` replaces it later. */
|
|
2011
1991
|
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
1992
|
/** Labels every egress event of this sandbox carries. */
|
|
2017
1993
|
labels?: SandboxLabels;
|
|
2018
1994
|
/**
|
|
@@ -2020,8 +1996,8 @@ interface CreateSandboxOptions {
|
|
|
2020
1996
|
* run, shared by every Run it reaches, whatever its Agent or Session (InvokeOrigin `entry`): each such Run that calls
|
|
2021
1997
|
* createSandbox with `entry` works in it, its files kept from one Run to the next, and the Session's calls that name no
|
|
2022
1998
|
* 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.
|
|
2024
|
-
*
|
|
1999
|
+
* 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
|
|
2000
|
+
* calls keep the sandbox their grant found.
|
|
2025
2001
|
*/
|
|
2026
2002
|
scope?: SandboxScope;
|
|
2027
2003
|
}
|
|
@@ -5156,6 +5132,11 @@ interface CredentialVerifyResult {
|
|
|
5156
5132
|
verified: boolean;
|
|
5157
5133
|
/** Non-secret external identity and access facts verified by this provider. */
|
|
5158
5134
|
claims?: Record<string, string | number | boolean | string[]>;
|
|
5135
|
+
/**
|
|
5136
|
+
* With verified:true: where this version is used, which the platform stores on it beside its claims. A provider whose
|
|
5137
|
+
* destination depends on the account it connected reads that account here. None: the version is never added to a request.
|
|
5138
|
+
*/
|
|
5139
|
+
destinations?: CredentialDestination[];
|
|
5159
5140
|
/** With verified:false only: the provider states that the installation this version stands for no longer exists.
|
|
5160
5141
|
* The platform revokes this version and the Credential's older live versions. A failure that may pass, and any
|
|
5161
5142
|
* answer that is not such a statement (a suspension, a mismatch, a refusal), is thrown instead. */
|
|
@@ -5562,5 +5543,5 @@ declare function parseLedgerAddress(value: unknown): LedgerAddressParts | null;
|
|
|
5562
5543
|
/** Formats ledger address parts; throws when a part breaks its id rule. */
|
|
5563
5544
|
declare function formatLedgerAddress(parts: LedgerAddressParts): LedgerAddress;
|
|
5564
5545
|
|
|
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,
|
|
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,
|
|
5546
|
+
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, normalizeSandboxConnectionKeys, 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 };
|
|
5547
|
+
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,
|
|
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 `${
|
|
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 `${
|
|
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 `${
|
|
182
|
-
if (rule.enum !== void 0 && (!Array.isArray(rule.enum) || rule.enum.length === 0)) return `${
|
|
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 `${
|
|
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 `${
|
|
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 `${
|
|
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 `${
|
|
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 `${
|
|
199
|
-
if (rule.properties !== void 0 && (!rule.properties || typeof rule.properties !== "object" || Array.isArray(rule.properties))) return `${
|
|
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, `${
|
|
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, `${
|
|
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 `${
|
|
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, `${
|
|
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, `${
|
|
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 `${
|
|
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,
|
|
222
|
+
function validateJsonSchema(value, schema, path2 = "$") {
|
|
223
223
|
if (schema === true) return null;
|
|
224
|
-
if (schema === false) return `${
|
|
225
|
-
if (!schema || typeof schema !== "object" || Array.isArray(schema)) return `${
|
|
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,
|
|
228
|
-
return `${
|
|
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 `${
|
|
232
|
-
if (Array.isArray(rule.enum) && !rule.enum.some((candidate) => canonicalJson(candidate) === canonicalJson(value))) return `${
|
|
233
|
-
if (Object.hasOwn(rule, "const") && canonicalJson(rule.const) !== canonicalJson(value)) return `${
|
|
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 `${
|
|
236
|
-
if (typeof rule.maxLength === "number" && value.length > rule.maxLength) return `${
|
|
237
|
-
if (typeof rule.pattern === "string" && !new RegExp(rule.pattern, "u").test(value)) return `${
|
|
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 `${
|
|
241
|
-
if (typeof rule.maximum === "number" && value > rule.maximum) return `${
|
|
242
|
-
if (typeof rule.exclusiveMinimum === "number" && value <= rule.exclusiveMinimum) return `${
|
|
243
|
-
if (typeof rule.exclusiveMaximum === "number" && value >= rule.exclusiveMaximum) return `${
|
|
244
|
-
if (typeof rule.multipleOf === "number" && Math.abs(value / rule.multipleOf - Math.round(value / rule.multipleOf)) > Number.EPSILON * 8) return `${
|
|
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 `${
|
|
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 `${
|
|
251
|
-
if (typeof rule.maxProperties === "number" && Object.keys(record14).length > rule.maxProperties) return `${
|
|
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 `${
|
|
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, `${
|
|
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, `${
|
|
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 `${
|
|
267
|
-
if (typeof rule.maxItems === "number" && value.length > rule.maxItems) return `${
|
|
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, `${
|
|
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 `${
|
|
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,
|
|
345
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return `${
|
|
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 `${
|
|
349
|
-
if (!Object.hasOwn(output, "schema")) return `${
|
|
350
|
-
const schemaError = validateJsonSchemaDefinition(output.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 `${
|
|
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 `${
|
|
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 `${
|
|
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
|
|
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",
|
|
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,
|
|
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:
|
|
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 === "
|
|
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,
|
|
1438
|
-
if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${
|
|
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,
|
|
1441
|
-
requiredString(value.id, `${
|
|
1442
|
-
requiredString(value.version, `${
|
|
1440
|
+
function validateExecutable(value, path2) {
|
|
1441
|
+
requiredString(value.id, `${path2}.id`);
|
|
1442
|
+
requiredString(value.version, `${path2}.version`);
|
|
1443
1443
|
}
|
|
1444
|
-
function validateTool(tool,
|
|
1445
|
-
requiredString(tool.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(`${
|
|
1447
|
+
throw new TypeError(`${path2}.title must be a non-empty single line`);
|
|
1448
1448
|
}
|
|
1449
|
-
requiredString(tool.version, `${
|
|
1450
|
-
if (!["read-only", "idempotent", "reconcilable", "non-idempotent"].includes(tool.maxEffect)) throw new TypeError(`${
|
|
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(`${
|
|
1453
|
-
if (typeof tool.run !== "function") throw new TypeError(`${
|
|
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,
|
|
1457
|
-
validateExecutable(view,
|
|
1458
|
-
if (typeof view.init !== "function" || typeof view.apply !== "function") throw new TypeError(`${
|
|
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,
|
|
1527
|
-
if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${
|
|
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,
|
|
1530
|
-
required2(value.id, `${
|
|
1531
|
-
required2(value.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(
|
|
1645
|
-
const name =
|
|
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
|
|
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
|
|
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 (
|
|
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 ||
|
|
1691
|
-
|
|
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[
|
|
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
|
|
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) ||
|
|
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
|
-
|
|
1703
|
+
paths.add(path2);
|
|
1704
1704
|
expandedBytes += bytes;
|
|
1705
|
-
normalizedAssets[
|
|
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,
|
|
2480
|
+
function requiredString2(value, path2, _maximum) {
|
|
2481
2481
|
if (typeof value !== "string" || value.length === 0) {
|
|
2482
|
-
throw new TypeError(`${
|
|
2482
|
+
throw new TypeError(`${path2} must be a non-empty string`);
|
|
2483
2483
|
}
|
|
2484
2484
|
}
|
|
2485
|
-
function exactKeys2(value, allowed, required3,
|
|
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(`${
|
|
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,
|
|
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(`${
|
|
2495
|
+
throw new TypeError(`${path2} is invalid`);
|
|
2496
2496
|
}
|
|
2497
|
-
exactKeys2(grant, ["actions", "resources", "ttlMs"], ["actions", "resources", "ttlMs"],
|
|
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,
|
|
2501
|
+
function validatePolicyConstraint(constraint, path2 = "constraint") {
|
|
2502
2502
|
if (!constraint || typeof constraint !== "object" || Array.isArray(constraint) || typeof constraint.kind !== "string") {
|
|
2503
|
-
throw new TypeError(`${
|
|
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(`${
|
|
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"],
|
|
2516
|
-
if (!record4(constraint.schema) || validateJsonSchemaDefinition(constraint.schema)) throw new TypeError(`${
|
|
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"],
|
|
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(`${
|
|
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"],
|
|
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(`${
|
|
2532
|
+
throw new TypeError(`${path2}.kind is invalid`);
|
|
2533
2533
|
}
|
|
2534
|
-
function validateConstraints(value,
|
|
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(`${
|
|
2537
|
+
throw new TypeError(`${path2} is invalid`);
|
|
2538
2538
|
}
|
|
2539
|
-
value.forEach((constraint, index) => validatePolicyConstraint(constraint, `${
|
|
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
|
|
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" ||
|
|
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
|
|
2877
|
-
if (!
|
|
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,12 @@ async function resolveContainerImageSource(reference, platform, request, authori
|
|
|
3521
3521
|
}
|
|
3522
3522
|
|
|
3523
3523
|
// packages/sdk/src/sandbox-egress.ts
|
|
3524
|
-
|
|
3525
|
-
|
|
3524
|
+
function normalizeSandboxConnectionKeys(value) {
|
|
3525
|
+
if (!Array.isArray(value)) throw new TypeError("sandbox connection keys must be an array");
|
|
3526
|
+
return [...new Set(value.map((key) => scopedBindingKey(key)))].sort();
|
|
3527
|
+
}
|
|
3528
|
+
var SANDBOX_EGRESS_LIMITS = { rules: 64, labels: 16, labelValueLength: 256 };
|
|
3529
|
+
var HEADER2 = /^[a-z0-9!#$%&'*+.^_`|~-]+$/u;
|
|
3526
3530
|
var RESERVED_HEADERS2 = /* @__PURE__ */ new Set([
|
|
3527
3531
|
"connection",
|
|
3528
3532
|
"content-length",
|
|
@@ -3534,8 +3538,6 @@ var RESERVED_HEADERS2 = /* @__PURE__ */ new Set([
|
|
|
3534
3538
|
"transfer-encoding",
|
|
3535
3539
|
"upgrade"
|
|
3536
3540
|
]);
|
|
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
3541
|
var LABEL = /^[a-z0-9][a-z0-9._-]{0,62}$/u;
|
|
3540
3542
|
function object4(value) {
|
|
3541
3543
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -3544,57 +3546,55 @@ function sandboxEgressHostMatches(pattern, hostname) {
|
|
|
3544
3546
|
const host2 = hostname.toLowerCase().replace(/\.$/u, "");
|
|
3545
3547
|
return pattern.startsWith("*.") ? host2 === pattern.slice(2) || host2.endsWith(pattern.slice(1)) : host2 === pattern;
|
|
3546
3548
|
}
|
|
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
3549
|
function host(value) {
|
|
3552
3550
|
const [normalized] = normalizeSandboxDomains([value]);
|
|
3553
3551
|
return normalized;
|
|
3554
3552
|
}
|
|
3555
|
-
function
|
|
3556
|
-
const header =
|
|
3557
|
-
if (typeof header !== "string" || !HEADER2.test(header.toLowerCase()) || RESERVED_HEADERS2.has(header.toLowerCase()) || header.toLowerCase().startsWith("x-constal-")) throw new TypeError("
|
|
3558
|
-
if (
|
|
3559
|
-
if (
|
|
3560
|
-
const basic =
|
|
3561
|
-
if (
|
|
3562
|
-
if (
|
|
3563
|
-
if (
|
|
3553
|
+
function presentation(present) {
|
|
3554
|
+
const header = present.header === void 0 ? "authorization" : present.header;
|
|
3555
|
+
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");
|
|
3556
|
+
if (present.value !== void 0 && present.basic !== void 0) throw new TypeError("Credential destination takes value or basic, not both");
|
|
3557
|
+
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");
|
|
3558
|
+
const basic = present.basic === void 0 ? void 0 : object4(present.basic);
|
|
3559
|
+
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");
|
|
3560
|
+
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");
|
|
3561
|
+
if (present.code !== void 0 && present.code !== "totp") throw new TypeError("Credential destination code must be totp");
|
|
3564
3562
|
return {
|
|
3565
3563
|
header: header.toLowerCase(),
|
|
3566
|
-
...basic ? { basic: basic.username === void 0 ? {} : { username: basic.username } } : { value:
|
|
3567
|
-
...
|
|
3568
|
-
...
|
|
3564
|
+
...basic ? { basic: basic.username === void 0 ? {} : { username: basic.username } } : { value: present.value ?? "Bearer {value}" },
|
|
3565
|
+
...present.field !== void 0 ? { field: present.field } : {},
|
|
3566
|
+
...present.code !== void 0 ? { code: "totp" } : {}
|
|
3569
3567
|
};
|
|
3570
3568
|
}
|
|
3571
3569
|
var SPACE_OR_CONTROL = /[\s\u0000-\u001f\u007f]/u;
|
|
3572
|
-
function
|
|
3573
|
-
if (!
|
|
3574
|
-
throw new TypeError("
|
|
3570
|
+
function path(raw) {
|
|
3571
|
+
if (typeof raw !== "string" || !raw.startsWith("/") || /[%?#\\]/u.test(raw) || SPACE_OR_CONTROL.test(raw)) {
|
|
3572
|
+
throw new TypeError("Credential destination path is invalid");
|
|
3575
3573
|
}
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
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"));
|
|
3574
|
+
const prefix = raw.length > 1 && raw.endsWith("/") ? raw.slice(0, -1) : raw;
|
|
3575
|
+
if (prefix.slice(1).split("/").some((segment) => segment === "" || segment === "." || segment === "..")) {
|
|
3576
|
+
throw new TypeError("Credential destination path is invalid");
|
|
3577
|
+
}
|
|
3578
|
+
return prefix;
|
|
3589
3579
|
}
|
|
3590
|
-
function
|
|
3591
|
-
if (
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3580
|
+
function normalizeCredentialDestinations(value) {
|
|
3581
|
+
if (value === void 0) return [];
|
|
3582
|
+
if (!Array.isArray(value)) throw new TypeError("Credential destinations are invalid");
|
|
3583
|
+
const destinations = value.map((raw) => {
|
|
3584
|
+
const destination = object4(raw);
|
|
3585
|
+
const present = object4(destination?.present);
|
|
3586
|
+
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))) {
|
|
3587
|
+
throw new TypeError("Credential destination is invalid");
|
|
3595
3588
|
}
|
|
3596
|
-
return
|
|
3597
|
-
|
|
3589
|
+
return {
|
|
3590
|
+
origin: `https://${host(destination.origin.slice("https://".length))}`,
|
|
3591
|
+
...destination.path !== void 0 ? { path: path(destination.path) } : {},
|
|
3592
|
+
present: presentation(present)
|
|
3593
|
+
};
|
|
3594
|
+
});
|
|
3595
|
+
const headers = destinations.map((destination) => JSON.stringify([destination.origin, destination.path ?? null, destination.present.header]));
|
|
3596
|
+
if (new Set(headers).size !== headers.length) throw new TypeError("Credential destinations of one origin and path name a header twice");
|
|
3597
|
+
return destinations;
|
|
3598
3598
|
}
|
|
3599
3599
|
function normalizeSandboxEgressPolicy(value) {
|
|
3600
3600
|
const input = object4(value);
|
|
@@ -3616,41 +3616,6 @@ function sandboxEgressDecision(policy2, hostname) {
|
|
|
3616
3616
|
if (index < 0) return { allowed: policy2.default === "allow", rule: "sandbox:default" };
|
|
3617
3617
|
return { allowed: policy2.rules[index].action === "allow", rule: `sandbox:${index}` };
|
|
3618
3618
|
}
|
|
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
3619
|
function normalizeSandboxLabels(value) {
|
|
3655
3620
|
if (value === void 0) return {};
|
|
3656
3621
|
const input = object4(value);
|
|
@@ -3674,15 +3639,15 @@ function absoluteSandboxPath(value) {
|
|
|
3674
3639
|
}
|
|
3675
3640
|
return `/${segments.join("/")}`;
|
|
3676
3641
|
}
|
|
3677
|
-
function normalizeSandboxWorkspacePath(
|
|
3678
|
-
if (typeof
|
|
3642
|
+
function normalizeSandboxWorkspacePath(path2, cwd = WORKSPACE_ROOT) {
|
|
3643
|
+
if (typeof path2 !== "string" || !path2 || typeof cwd !== "string" || !cwd || /[\u0000-\u001f\u007f]/u.test(path2) || /[\u0000-\u001f\u007f]/u.test(cwd)) {
|
|
3679
3644
|
throw new TypeError("sandbox workspace path is invalid");
|
|
3680
3645
|
}
|
|
3681
3646
|
const base = absoluteSandboxPath(cwd.startsWith("/") ? cwd : `${WORKSPACE_ROOT}/${cwd}`);
|
|
3682
3647
|
if (base !== WORKSPACE_ROOT && !base.startsWith(`${WORKSPACE_ROOT}/`)) {
|
|
3683
3648
|
throw new TypeError("sandbox working directory is outside /workspace");
|
|
3684
3649
|
}
|
|
3685
|
-
const normalized = absoluteSandboxPath(
|
|
3650
|
+
const normalized = absoluteSandboxPath(path2.startsWith("/") ? path2 : `${base}/${path2}`);
|
|
3686
3651
|
if (normalized !== WORKSPACE_ROOT && !normalized.startsWith(`${WORKSPACE_ROOT}/`)) {
|
|
3687
3652
|
throw new TypeError("sandbox path is outside /workspace");
|
|
3688
3653
|
}
|
|
@@ -3878,7 +3843,7 @@ function startTrainingRequest(value) {
|
|
|
3878
3843
|
async function checkpointArtifactRef(value) {
|
|
3879
3844
|
return await sha256Hex(canonicalJson(value));
|
|
3880
3845
|
}
|
|
3881
|
-
var
|
|
3846
|
+
var SLOT = /^[a-z0-9][a-z0-9._-]{0,127}$/u;
|
|
3882
3847
|
var HASH5 = /^[a-f0-9]{64}$/u;
|
|
3883
3848
|
var MODEL_RESOURCE_ID = /^[a-z0-9][a-z0-9-]{0,62}$/u;
|
|
3884
3849
|
function httpsUrl(value, field2) {
|
|
@@ -3898,7 +3863,7 @@ function slotMetadata(value) {
|
|
|
3898
3863
|
const output = {};
|
|
3899
3864
|
for (const [slot, raw] of entries) {
|
|
3900
3865
|
const item = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
|
|
3901
|
-
if (!
|
|
3866
|
+
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
3867
|
throw new TypeError("Gateway Credential slots are invalid");
|
|
3903
3868
|
}
|
|
3904
3869
|
httpsUrl(item.documentationUrl, "Gateway Credential slot documentation URL");
|
|
@@ -3911,7 +3876,7 @@ function configEgressBindings(value) {
|
|
|
3911
3876
|
if (!Array.isArray(value)) throw new TypeError("Gateway config egress bindings are invalid");
|
|
3912
3877
|
return value.map((raw) => {
|
|
3913
3878
|
const item = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
|
|
3914
|
-
if (!item || !
|
|
3879
|
+
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
3880
|
throw new TypeError("Gateway config egress bindings are invalid");
|
|
3916
3881
|
}
|
|
3917
3882
|
return {
|
|
@@ -3924,7 +3889,7 @@ function configEgressBindings(value) {
|
|
|
3924
3889
|
function discoverySetup(value) {
|
|
3925
3890
|
if (value === void 0) return void 0;
|
|
3926
3891
|
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 ?? "")) || !
|
|
3892
|
+
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
3893
|
throw new TypeError("Gateway discovery setup is invalid");
|
|
3929
3894
|
}
|
|
3930
3895
|
return { operation: String(item.operation), resultConfigProperty: String(item.resultConfigProperty) };
|
|
@@ -3989,7 +3954,7 @@ function gatewayModelOffer(value) {
|
|
|
3989
3954
|
const modalities = (field2) => {
|
|
3990
3955
|
const values = source[field2];
|
|
3991
3956
|
if (values === void 0) return void 0;
|
|
3992
|
-
if (!Array.isArray(values) || values.length === 0 || values.some((item) => typeof item !== "string" || !
|
|
3957
|
+
if (!Array.isArray(values) || values.length === 0 || values.some((item) => typeof item !== "string" || !SLOT.test(item)) || new Set(values).size !== values.length) {
|
|
3993
3958
|
throw new TypeError("Gateway Model offer is invalid");
|
|
3994
3959
|
}
|
|
3995
3960
|
return values;
|
|
@@ -4877,10 +4842,10 @@ function codeScorerIR(value) {
|
|
|
4877
4842
|
if (!ir || ir.v !== 1 || !exactKeys5(ir, ["v", "rule"])) throw new TypeError("Code Scorer IR is invalid");
|
|
4878
4843
|
return { v: 1, rule: scorerRule(ir.rule, 0, { rules: 0 }) };
|
|
4879
4844
|
}
|
|
4880
|
-
function pointer(value,
|
|
4881
|
-
if (
|
|
4845
|
+
function pointer(value, path2) {
|
|
4846
|
+
if (path2 === "") return { found: true, value };
|
|
4882
4847
|
let current = value;
|
|
4883
|
-
for (const encoded of
|
|
4848
|
+
for (const encoded of path2.slice(1).split("/")) {
|
|
4884
4849
|
const key = encoded.replace(/~1/gu, "/").replace(/~0/gu, "~");
|
|
4885
4850
|
if (Array.isArray(current)) {
|
|
4886
4851
|
if (!/^(?:0|[1-9][0-9]*)$/u.test(key) || Number(key) >= current.length) return { found: false, value: void 0 };
|
|
@@ -4893,8 +4858,8 @@ function pointer(value, path) {
|
|
|
4893
4858
|
}
|
|
4894
4859
|
return { found: true, value: current };
|
|
4895
4860
|
}
|
|
4896
|
-
function fail(
|
|
4897
|
-
return { pass: false, checks: 1, failures: [{ path, reason }] };
|
|
4861
|
+
function fail(path2, reason) {
|
|
4862
|
+
return { pass: false, checks: 1, failures: [{ path: path2, reason }] };
|
|
4898
4863
|
}
|
|
4899
4864
|
function pass() {
|
|
4900
4865
|
return { pass: true, checks: 1, failures: [] };
|
|
@@ -5390,8 +5355,9 @@ export {
|
|
|
5390
5355
|
modelProtocolRequest,
|
|
5391
5356
|
modelProtocolResult,
|
|
5392
5357
|
murmur3_32,
|
|
5358
|
+
normalizeCredentialDestinations,
|
|
5393
5359
|
normalizeModelGatewayConfig,
|
|
5394
|
-
|
|
5360
|
+
normalizeSandboxConnectionKeys,
|
|
5395
5361
|
normalizeSandboxEgressPolicy,
|
|
5396
5362
|
normalizeSandboxLabels,
|
|
5397
5363
|
normalizeSandboxNetworkPolicy,
|
|
@@ -5419,7 +5385,6 @@ export {
|
|
|
5419
5385
|
resourceTools,
|
|
5420
5386
|
runLabels,
|
|
5421
5387
|
sandboxControls,
|
|
5422
|
-
sandboxEgressCredentialRuleFor,
|
|
5423
5388
|
sandboxEgressDecision,
|
|
5424
5389
|
sandboxEgressHostMatches,
|
|
5425
5390
|
sandboxLimit,
|