@constal/sdk 6.11.0 → 6.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/package.json +1 -1
- package/publish/api.json +10 -2
- package/publish/index.d.ts +225 -49
- package/publish/index.js +0 -17
package/README.md
CHANGED
|
@@ -232,6 +232,33 @@ for sleeping within the current Run.
|
|
|
232
232
|
See [Schedule Agent follow-ups](https://constal.ai/docs/agents/schedules) for replay,
|
|
233
233
|
delivery, authority, and cancellation semantics.
|
|
234
234
|
|
|
235
|
+
## Calls with a connection
|
|
236
|
+
|
|
237
|
+
`ctx.fetch` makes an https request with one of the Run's owner's connections,
|
|
238
|
+
named by its binding key. The Agent never holds the Credential's value:
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
const response = await ctx.fetch("https://api.example.com/v1/tickets", {
|
|
242
|
+
method: "POST",
|
|
243
|
+
headers: { "content-type": "application/json" },
|
|
244
|
+
body: JSON.stringify({ title: "Fix the failing build" }),
|
|
245
|
+
}, { connection: "tickets" });
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
`connection` is required. The platform finds the enabled Credential binding of
|
|
249
|
+
that key in the Agent's tenant and namespace owned by the Run's customer, or by
|
|
250
|
+
its tenant when the Run has none, and matches the request against the
|
|
251
|
+
Credential's `destinations`: https only, the most specific destination wins, and
|
|
252
|
+
a request none matches is refused. It decides the use with `credential:use`
|
|
253
|
+
Policy (`origin.kind` is `agent`), sets the header the destination's `present`
|
|
254
|
+
names in place of any the Agent sent, never follows a redirect, and redacts the
|
|
255
|
+
value from the answer's headers and body.
|
|
256
|
+
|
|
257
|
+
The answer, its body whole, is journaled at the call's position: a replay gets
|
|
258
|
+
the same Response without calling again, and a refused call throws the same
|
|
259
|
+
error, with the platform's `status`. Inside a Tool, GET, HEAD and OPTIONS are
|
|
260
|
+
read-only, PUT and DELETE idempotent, and any other method non-idempotent.
|
|
261
|
+
|
|
235
262
|
## Model evaluation
|
|
236
263
|
|
|
237
264
|
`ctx.evaluate` judges one state against typed questions through an evaluation
|
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.13.0",
|
|
4
4
|
"exports": [
|
|
5
5
|
"AGENT_UI_DEFAULTS",
|
|
6
6
|
"Action",
|
|
@@ -351,7 +351,6 @@
|
|
|
351
351
|
"RunReport",
|
|
352
352
|
"RunStatusDetail",
|
|
353
353
|
"RunSuiteRequest",
|
|
354
|
-
"SANDBOX_DOOR_MAX_WAIT_MS",
|
|
355
354
|
"SANDBOX_EGRESS_LIMITS",
|
|
356
355
|
"SANDBOX_POOL_OPERATIONS",
|
|
357
356
|
"SANDBOX_PROVIDER_FAILURE_CLASSES",
|
|
@@ -375,14 +374,21 @@
|
|
|
375
374
|
"SandboxFileScope",
|
|
376
375
|
"SandboxGovernanceControls",
|
|
377
376
|
"SandboxGovernanceMeter",
|
|
377
|
+
"SandboxHistoryEvent",
|
|
378
|
+
"SandboxIndexedEvent",
|
|
379
|
+
"SandboxLabelCapabilities",
|
|
378
380
|
"SandboxLabels",
|
|
381
|
+
"SandboxLifecycleEvent",
|
|
379
382
|
"SandboxNetworkMode",
|
|
380
383
|
"SandboxNetworkPolicy",
|
|
384
|
+
"SandboxOrphanEvent",
|
|
385
|
+
"SandboxOrphanWithdrawnEvent",
|
|
381
386
|
"SandboxPersistence",
|
|
382
387
|
"SandboxPool",
|
|
383
388
|
"SandboxPoolCreateRequest",
|
|
384
389
|
"SandboxPoolOperation",
|
|
385
390
|
"SandboxPortCapabilities",
|
|
391
|
+
"SandboxProviderAllocation",
|
|
386
392
|
"SandboxProviderFailureClass",
|
|
387
393
|
"SandboxProviderUnavailable",
|
|
388
394
|
"SandboxSecretsRoute",
|
|
@@ -390,6 +396,8 @@
|
|
|
390
396
|
"SandboxSnapshotCapabilities",
|
|
391
397
|
"SandboxState",
|
|
392
398
|
"SandboxUpdateRequest",
|
|
399
|
+
"SandboxUsageEvent",
|
|
400
|
+
"SandboxUsageItem",
|
|
393
401
|
"SandboxView",
|
|
394
402
|
"SandboxWaitOptions",
|
|
395
403
|
"Schedule",
|
package/publish/index.d.ts
CHANGED
|
@@ -1479,6 +1479,29 @@ interface PriceTableRef {
|
|
|
1479
1479
|
version: string;
|
|
1480
1480
|
hash: Hash;
|
|
1481
1481
|
}
|
|
1482
|
+
interface UsageReport {
|
|
1483
|
+
cpuMs: number | null;
|
|
1484
|
+
wallMs: number;
|
|
1485
|
+
providerUnits?: Record<string, number>;
|
|
1486
|
+
priceTable: PriceTableRef;
|
|
1487
|
+
microUsd: number;
|
|
1488
|
+
quality: "reported" | "measured" | "estimated";
|
|
1489
|
+
/** The provider the usage ran on, where the Resource's configuration names several (a sandbox pool's `providers`): the
|
|
1490
|
+
* report is priced at that provider's rates under `priceTable`. */
|
|
1491
|
+
provider?: string;
|
|
1492
|
+
/**
|
|
1493
|
+
* Usage the invocation goes on incurring after its outcome - a sandbox's idle tail - priced as forecast. The
|
|
1494
|
+
* platform holds each item for this invocation's Run until no later report of the same Resource can still revise
|
|
1495
|
+
* it, then settles it once, by id.
|
|
1496
|
+
*/
|
|
1497
|
+
deferred?: DeferredUsageReport[];
|
|
1498
|
+
/** Final, smaller amounts for deferred items earlier invocations of the same Resource reported, by id. */
|
|
1499
|
+
revisions?: DeferredUsageReport[];
|
|
1500
|
+
}
|
|
1501
|
+
interface DeferredUsageReport {
|
|
1502
|
+
id: string;
|
|
1503
|
+
usage: UsageReport;
|
|
1504
|
+
}
|
|
1482
1505
|
type SandboxNetworkMode = "block-all" | "cidr-allow" | "domain-allow" | "unrestricted";
|
|
1483
1506
|
type SandboxNetworkPolicy = {
|
|
1484
1507
|
mode: "block-all";
|
|
@@ -1985,45 +2008,113 @@ declare const SANDBOX_SIZES: {
|
|
|
1985
2008
|
type SandboxSize = keyof typeof SANDBOX_SIZES;
|
|
1986
2009
|
|
|
1987
2010
|
/**
|
|
1988
|
-
* The
|
|
1989
|
-
* addressed by id in a namespace, under `/v1/namespaces/{namespace}/sandboxes`, and every caller uses these routes:
|
|
1990
|
-
*
|
|
1991
|
-
* - a tenant's API key, on the platform's public routes (caas.sh calls them over its CONSTAL_PLATFORM binding);
|
|
1992
|
-
* - an agent's Run, through its sandbox-pool Resource, which reaches the same routes at `https://platform.internal`
|
|
1993
|
-
* with the Run's own authority instead of a key.
|
|
1994
|
-
*
|
|
1995
|
-
* Each call is authorized where it arrives, inline: the key (or Run), the Policy scope of its operation (`scope` below) on
|
|
1996
|
-
* the pool it names, and the balance at create and start (`balance`). Nothing is pre-issued. The platform then calls the sandbox's coordinator, one per sandbox id
|
|
1997
|
-
* (packages/platform-protocol/src/sandbox-door-calls.ts), which answers when the provider answers.
|
|
2011
|
+
* The events of a deployment's sandbox service:
|
|
1998
2012
|
*
|
|
1999
|
-
*
|
|
2000
|
-
*
|
|
2001
|
-
*
|
|
2013
|
+
* - `sandbox.lifecycle` and `sandbox.usage`, written by the sandbox's coordinator in the transaction that changed its view
|
|
2014
|
+
* or metered its time or its egress, numbered per sandbox (`seq`) across both types. The coordinator keeps them for the sandbox's
|
|
2015
|
+
* lifetime, its history (the door's history operation), and its alarm delivers each to its namespace's sandbox index
|
|
2016
|
+
* after the call that wrote it answered, again until the index takes it, so a failed delivery loses none. Delivery is at
|
|
2017
|
+
* least once and in no order: the index keeps a sandbox's newest view by `seq`, and counts a usage item once by its `id`;
|
|
2018
|
+
* - `sandbox.orphan` and `sandbox.orphan.withdrawn`, written by the watcher of a provider account (one per tenant,
|
|
2019
|
+
* namespace and provider account) and delivered so to the same index, which keeps an orphan by its `provider`,
|
|
2020
|
+
* `account` and `instance` as the one of their events with the latest `at` says, a withdrawal winning a tie.
|
|
2002
2021
|
*
|
|
2003
|
-
*
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
*
|
|
2022
|
+
* The index answers the door's list and usage operations (packages/sdk/src/sandbox-door.ts).
|
|
2023
|
+
*/
|
|
2024
|
+
/**
|
|
2025
|
+
* What a sandbox's coordinator metered, as it settles it with the platform; `id` makes its debit once. Its `usage` carries
|
|
2026
|
+
* both egress units, `egress_bytes` (SANDBOX_EGRESS_METER) and `proxy_egress_bytes` (SANDBOX_PROXY_EGRESS_UNIT), among its
|
|
2027
|
+
* `providerUnits`:
|
|
2007
2028
|
*
|
|
2008
|
-
*
|
|
2009
|
-
*
|
|
2010
|
-
*
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2029
|
+
* - `running:<fromAt>`, one stretch of its running time, on its size's allocation, with no egress;
|
|
2030
|
+
* - `egress:<fromAt>`, the bytes it sent out that one read of its egress found, with no running time (`wallMs` 0): on its
|
|
2031
|
+
* own network, from its provider's metrics, and through an egress proxy, as the proxy reported them.
|
|
2032
|
+
*/
|
|
2033
|
+
interface SandboxUsageItem {
|
|
2034
|
+
id: string;
|
|
2035
|
+
fromAt: number;
|
|
2036
|
+
untilAt: number;
|
|
2037
|
+
usage: UsageReport;
|
|
2038
|
+
}
|
|
2039
|
+
/** What a sandbox's coordinator writes of its sandbox: the sandbox as the door names it, its labels then, and its number. */
|
|
2040
|
+
interface SandboxCoordinatorEvent {
|
|
2041
|
+
version: 1;
|
|
2042
|
+
/** 1, 2, 3 …: the order the coordinator wrote its sandbox's lifecycle and usage events in. */
|
|
2043
|
+
seq: number;
|
|
2044
|
+
/** Epoch milliseconds when the coordinator wrote it. */
|
|
2045
|
+
at: number;
|
|
2046
|
+
tenant: string;
|
|
2047
|
+
namespace: string;
|
|
2048
|
+
pool: string;
|
|
2049
|
+
/** The sandbox's door id. */
|
|
2050
|
+
sandbox: string;
|
|
2051
|
+
labels: SandboxLabels;
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* A change to a sandbox's view (its state, its provider instance, or a field a create or update set) or to the pool account
|
|
2055
|
+
* it runs under.
|
|
2056
|
+
*/
|
|
2057
|
+
interface SandboxLifecycleEvent extends SandboxCoordinatorEvent {
|
|
2058
|
+
type: "sandbox.lifecycle";
|
|
2059
|
+
/** The sandbox once changed, as the door answers it, but for its environment, which may hold secrets. */
|
|
2060
|
+
view: Omit<SandboxView, "env">;
|
|
2061
|
+
/** The pool account's Credential (its CRN) the sandbox runs under, null for the deployment's own account of its provider. */
|
|
2062
|
+
account: string | null;
|
|
2063
|
+
}
|
|
2064
|
+
/** Running time or egress the coordinator metered, as it settles it with the platform. */
|
|
2065
|
+
interface SandboxUsageEvent extends SandboxCoordinatorEvent {
|
|
2066
|
+
type: "sandbox.usage";
|
|
2067
|
+
item: SandboxUsageItem;
|
|
2068
|
+
}
|
|
2069
|
+
/**
|
|
2070
|
+
* A provider instance tagged with the tenant and namespace that none of their sandboxes on that provider account holds (its
|
|
2071
|
+
* tags name no sandbox, or the sandbox they name answers it is none of its), which the account's watcher found listing it,
|
|
2072
|
+
* settled (neither starting nor stopping), a relist apart, and reports once. Nothing deletes it: the account's owner decides
|
|
2073
|
+
* what it is. It names the pool account and not a pool because the instance carries only its tenant's, namespace's,
|
|
2074
|
+
* account's and claimed sandbox's tags, and so no pool can be known for it.
|
|
2014
2075
|
*
|
|
2015
|
-
*
|
|
2016
|
-
*
|
|
2017
|
-
*
|
|
2076
|
+
* One watcher lists one pool account of a namespace, and knows only that account's sandboxes. So where two of a
|
|
2077
|
+
* namespace's accounts reach one account at the provider (two Credentials of one provider key or team, or a Credential and
|
|
2078
|
+
* the deployment's own account), each watcher lists the other's sandboxes too, and reports them as its orphans.
|
|
2018
2079
|
*/
|
|
2019
|
-
|
|
2020
|
-
|
|
2080
|
+
interface SandboxOrphanEvent {
|
|
2081
|
+
type: "sandbox.orphan";
|
|
2082
|
+
version: 1;
|
|
2083
|
+
/** Epoch milliseconds when the watcher found it. */
|
|
2084
|
+
at: number;
|
|
2085
|
+
tenant: string;
|
|
2086
|
+
namespace: string;
|
|
2087
|
+
/** The provider's name, as SandboxView's `provider.name` has it. */
|
|
2088
|
+
provider: string;
|
|
2089
|
+
/** The pool account's Credential (its CRN), or null for the deployment's own account of the provider. */
|
|
2090
|
+
account: string | null;
|
|
2091
|
+
/** The provider's own id for the instance. */
|
|
2092
|
+
instance: string;
|
|
2093
|
+
}
|
|
2094
|
+
/**
|
|
2095
|
+
* An orphan reported before (SandboxOrphanEvent) that is an orphan no more. Either the sandbox its tags name then answered
|
|
2096
|
+
* the account's watcher that it is its own: the report was of an instance that sandbox's create had made and not yet
|
|
2097
|
+
* answered. Or the provider has it no more: it is gone, its account's owner having deleted it, say. Or the account's key
|
|
2098
|
+
* was removed, and its watcher watches it no more. Each report is withdrawn at most once, by the watcher that made it. The
|
|
2099
|
+
* index keeps the withdrawal, so a report no later than it, delivered after it, does not bring the orphan back.
|
|
2100
|
+
*/
|
|
2101
|
+
interface SandboxOrphanWithdrawnEvent extends Omit<SandboxOrphanEvent, "type" | "at"> {
|
|
2102
|
+
type: "sandbox.orphan.withdrawn";
|
|
2103
|
+
/** Epoch milliseconds when the watcher was told the instance is a sandbox's, found it gone, or stopped watching its account. */
|
|
2104
|
+
at: number;
|
|
2105
|
+
}
|
|
2106
|
+
/** A sandbox's own events, as its coordinator keeps them: its history. */
|
|
2107
|
+
type SandboxHistoryEvent = SandboxLifecycleEvent | SandboxUsageEvent;
|
|
2108
|
+
/** The events a namespace's sandbox index takes: its coordinators' and its account watchers'. */
|
|
2109
|
+
type SandboxIndexedEvent = SandboxHistoryEvent | SandboxOrphanEvent | SandboxOrphanWithdrawnEvent;
|
|
2110
|
+
|
|
2021
2111
|
/**
|
|
2022
2112
|
* A sandbox's state: the provider's own (`starting`, `running`, `stopping`, `stopped`, and `failed` when the provider
|
|
2023
2113
|
* reports the sandbox broken) and the two the platform owns: `deleted`, and `failed` for a create or start the coordinator
|
|
2024
2114
|
* gave up on.
|
|
2025
2115
|
*/
|
|
2026
|
-
|
|
2116
|
+
declare const SANDBOX_STATES: readonly ["starting", "running", "stopping", "stopped", "failed", "deleted"];
|
|
2117
|
+
type SandboxState = typeof SANDBOX_STATES[number];
|
|
2027
2118
|
/**
|
|
2028
2119
|
* A sandbox's egress, enforced by its provider's own network API: every destination, none, or only those listed. A
|
|
2029
2120
|
* provider without one takes only `all` (SandboxCapabilities.egress).
|
|
@@ -2131,12 +2222,24 @@ type SandboxPersistence = {
|
|
|
2131
2222
|
* provider takes no `connectionKeys`.
|
|
2132
2223
|
*/
|
|
2133
2224
|
type SandboxSecretsRoute = "proxy" | "forwarding" | "interception" | "header-injection" | "none";
|
|
2225
|
+
/**
|
|
2226
|
+
* The provider's own labels of a sandbox: it keeps those its create is given, and its list answers them, so what it holds,
|
|
2227
|
+
* a change of its own or its dashboard's among it, is the sandbox's `provider.labels`; `write`: it changes them on a
|
|
2228
|
+
* sandbox it made, so an update's `labels` reach it too. The sandbox's own `labels` are its caller's on every provider.
|
|
2229
|
+
* Where it keeps none (SandboxCapabilities.labels null), there are no provider labels.
|
|
2230
|
+
*/
|
|
2231
|
+
interface SandboxLabelCapabilities {
|
|
2232
|
+
write: boolean;
|
|
2233
|
+
}
|
|
2134
2234
|
/**
|
|
2135
2235
|
* What a provider's own API offers, as its adapter declares it: what a create takes besides its image and size (`create`),
|
|
2136
2236
|
* exec, files, egress, ports and snapshots (null where the provider has none), what survives a stop (`persistence`),
|
|
2137
|
-
* whether the provider can also pause a sandbox with its memory (`pauseWithMemory`),
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2237
|
+
* whether the provider can also pause a sandbox with its memory (`pauseWithMemory`), how secrets reach its traffic,
|
|
2238
|
+
* whether its own metrics API keeps a sandbox's resource usage over time (`metrics`), whether its API lists an account's
|
|
2239
|
+
* sandboxes by the tags each create writes (`list`), which is how what the provider does to a sandbox is observed, and
|
|
2240
|
+
* whether it keeps a sandbox's labels and changes them (`labels`). A request that needs what is absent is refused with
|
|
2241
|
+
* `Unsupported` and `capability` naming the path, such as `exec.cwd`, `egress.live`, `files.write`, `secrets`, `metrics`
|
|
2242
|
+
* or `labels.write`.
|
|
2140
2243
|
*/
|
|
2141
2244
|
interface SandboxCapabilities {
|
|
2142
2245
|
/** Whether a create takes the image's start command (`command`) and environment (`env`). */
|
|
@@ -2152,17 +2255,32 @@ interface SandboxCapabilities {
|
|
|
2152
2255
|
persistence: SandboxPersistence;
|
|
2153
2256
|
pauseWithMemory: boolean;
|
|
2154
2257
|
secrets: SandboxSecretsRoute;
|
|
2258
|
+
/** Whether the provider's own metrics API answers a sandbox's resource usage over time: the door's metrics operation. */
|
|
2259
|
+
metrics: boolean;
|
|
2260
|
+
/**
|
|
2261
|
+
* Whether the provider's API lists one account's sandboxes by the tags each create writes (its tenant's, namespace's,
|
|
2262
|
+
* account's and sandbox's), so one list per account, at its pool's relist interval, right after a create and on the
|
|
2263
|
+
* provider's webhook where it sends one, observes what changed at the provider, a sandbox it stopped, failed or deleted
|
|
2264
|
+
* itself among them; without it, each sandbox's own object at the provider observes what its sandbox did on its own. No
|
|
2265
|
+
* request needs it, so none is refused for its absence.
|
|
2266
|
+
*/
|
|
2267
|
+
list: boolean;
|
|
2268
|
+
/** The provider's own labels of a sandbox (SandboxLabelCapabilities); null where it keeps none. */
|
|
2269
|
+
labels: SandboxLabelCapabilities | null;
|
|
2155
2270
|
}
|
|
2156
2271
|
/** POST /sandboxes. */
|
|
2157
2272
|
interface SandboxCreateRequest {
|
|
2158
|
-
/** The sandbox's id (SANDBOX_DOOR_ID); omitted:
|
|
2273
|
+
/** The sandbox's id (SANDBOX_DOOR_ID), one the caller chose; omitted: one the door mints, kept under the create's key. */
|
|
2159
2274
|
id?: string;
|
|
2160
2275
|
/**
|
|
2161
|
-
* The sandbox-pool Resource it runs on (its provider, account, region, and default image and size)
|
|
2162
|
-
*
|
|
2276
|
+
* The sandbox-pool Resource it runs on (its provider, account, region, and default image and size), by its CRN; the
|
|
2277
|
+
* sandbox keeps the name sandboxDoorPoolName gives it.
|
|
2278
|
+
*/
|
|
2279
|
+
pool: CRN;
|
|
2280
|
+
/**
|
|
2281
|
+
* What the provider boots: an image reference it can boot, or a snapshot's `image`; omitted: the pool's, which a pool one of
|
|
2282
|
+
* whose providers has no default image refuses (Invalid, `image`).
|
|
2163
2283
|
*/
|
|
2164
|
-
pool: string;
|
|
2165
|
-
/** What the provider boots: an image reference it can boot, or a snapshot's `image`; omitted: the pool's. */
|
|
2166
2284
|
image?: string;
|
|
2167
2285
|
/** A SANDBOX_SIZES name or an allocation, which usage is priced on; the provider gives its nearest shape at or above it. Omitted: the pool's. */
|
|
2168
2286
|
size?: SandboxSize | SandboxResources;
|
|
@@ -2176,12 +2294,22 @@ interface SandboxCreateRequest {
|
|
|
2176
2294
|
labels?: SandboxLabels;
|
|
2177
2295
|
/** The tenant's owner connections (binding keys) the secrets layer adds to the sandbox's requests; omitted or []: none. */
|
|
2178
2296
|
connectionKeys?: string[];
|
|
2297
|
+
/**
|
|
2298
|
+
* How long it runs idle before its coordinator stops it (SandboxView.idleStopMs), in milliseconds; omitted: it is never
|
|
2299
|
+
* stopped when idle, whatever its pool's `idleStopMs`, which prices the idle tail.
|
|
2300
|
+
*/
|
|
2301
|
+
idleStopMs?: number;
|
|
2179
2302
|
}
|
|
2180
|
-
/**
|
|
2303
|
+
/**
|
|
2304
|
+
* PATCH /sandboxes/{id}: each field replaces its value whole. `network` on a running sandbox needs `egress.live`;
|
|
2305
|
+
* `labels` are the sandbox's own on every provider, and on one that writes them (`labels.write`) reach the provider
|
|
2306
|
+
* before the update answers; `connectionKeys` and `idleStopMs` apply at once.
|
|
2307
|
+
*/
|
|
2181
2308
|
interface SandboxUpdateRequest {
|
|
2182
2309
|
network?: SandboxEgress;
|
|
2183
2310
|
labels?: SandboxLabels;
|
|
2184
2311
|
connectionKeys?: string[];
|
|
2312
|
+
idleStopMs?: number;
|
|
2185
2313
|
}
|
|
2186
2314
|
/** POST /sandboxes/{id}/exec: `cmd` and `args` are the argv; each other field needs its `exec` capability. */
|
|
2187
2315
|
interface SandboxExecRequest {
|
|
@@ -2192,6 +2320,13 @@ interface SandboxExecRequest {
|
|
|
2192
2320
|
stdin?: string;
|
|
2193
2321
|
timeoutMs?: number;
|
|
2194
2322
|
}
|
|
2323
|
+
/**
|
|
2324
|
+
* What a provider allocated a sandbox, as it answered it: its vCPUs, memory in GiB and disk in GB (SandboxResources' fields),
|
|
2325
|
+
* each null where the provider's answer left it out.
|
|
2326
|
+
*/
|
|
2327
|
+
type SandboxProviderAllocation = {
|
|
2328
|
+
[K in keyof SandboxResources]: number | null;
|
|
2329
|
+
};
|
|
2195
2330
|
/** A sandbox as the door answers it. */
|
|
2196
2331
|
interface SandboxView {
|
|
2197
2332
|
id: string;
|
|
@@ -2199,8 +2334,9 @@ interface SandboxView {
|
|
|
2199
2334
|
pool: string;
|
|
2200
2335
|
state: SandboxState;
|
|
2201
2336
|
/**
|
|
2202
|
-
* Why it stopped, failed or was deleted, when that was said: its caller's stop,
|
|
2203
|
-
* provider's own stop (its time limit), a create or start that failed
|
|
2337
|
+
* Why it stopped, failed or was deleted, when that was said: its caller's stop, its idle stop (idleStopMs), the tenant's
|
|
2338
|
+
* balance running out, the provider's own stop (its time limit), a create or start that failed, or a stop, failure or
|
|
2339
|
+
* deletion at its provider that its provider's observer saw. Null otherwise.
|
|
2204
2340
|
*/
|
|
2205
2341
|
reason: string | null;
|
|
2206
2342
|
image: string;
|
|
@@ -2209,13 +2345,27 @@ interface SandboxView {
|
|
|
2209
2345
|
command: string[] | null;
|
|
2210
2346
|
env: Record<string, string>;
|
|
2211
2347
|
network: SandboxEgress;
|
|
2348
|
+
/** Its labels: those its create or update named, its caller's alone; what its provider holds is `provider.labels`. */
|
|
2212
2349
|
labels: SandboxLabels;
|
|
2213
2350
|
connectionKeys: string[];
|
|
2214
|
-
/**
|
|
2351
|
+
/**
|
|
2352
|
+
* How long it runs idle before its coordinator stops it: its create's or update's; null when neither named one, and it is
|
|
2353
|
+
* never stopped when idle. It is idle from its start, or from the end of the last call on its instance (an exec and its
|
|
2354
|
+
* reads and cancel, a file, a snapshot, a port), while no such call is in flight and no command it ran still runs; a get,
|
|
2355
|
+
* an update or a lifecycle call is not one.
|
|
2356
|
+
*/
|
|
2357
|
+
idleStopMs: number | null;
|
|
2358
|
+
/**
|
|
2359
|
+
* Where it runs: the provider, its own id for the sandbox (null until it has one), the allocation it gave (its create's
|
|
2360
|
+
* answer, then as last observed at the provider; a field the provider left out null), beside `resources` asked for, the
|
|
2361
|
+
* labels it holds (its create's answer, a label write's, then as last observed, but for Constal's own tags; null where it
|
|
2362
|
+
* keeps none, `capabilities.labels`, and until a sandbox made before them is next observed), and what it offers.
|
|
2363
|
+
*/
|
|
2215
2364
|
provider: {
|
|
2216
2365
|
name: string;
|
|
2217
2366
|
id: string | null;
|
|
2218
|
-
allocation:
|
|
2367
|
+
allocation: SandboxProviderAllocation | null;
|
|
2368
|
+
labels: SandboxLabels | null;
|
|
2219
2369
|
capabilities: SandboxCapabilities;
|
|
2220
2370
|
};
|
|
2221
2371
|
createdAt: number;
|
|
@@ -2255,7 +2405,8 @@ interface SandboxSnapshot {
|
|
|
2255
2405
|
/**
|
|
2256
2406
|
* A sandbox-pool Resource's operations: the sandbox door's (SANDBOX_DOOR_OPERATIONS in sandbox-door.ts), each one call to it
|
|
2257
2407
|
* with the Run's own authority, named as the door names them. The door's port routes are not among them: an endpoint
|
|
2258
|
-
* answers the provider's own authorization, and a forward is the port's stream.
|
|
2408
|
+
* answers the provider's own authorization, and a forward is the port's stream. Nor are its command and snapshot lists: an
|
|
2409
|
+
* operation more would be another sandbox governance contract (its `requests` meter governs every operation here), which Policies pin.
|
|
2259
2410
|
*/
|
|
2260
2411
|
declare const SANDBOX_POOL_OPERATIONS: readonly ["create", "get", "start", "stop", "delete", "update", "exec", "execution", "cancel", "readFile", "writeFile", "deleteFile", "snapshot", "deleteSnapshot"];
|
|
2261
2412
|
type SandboxPoolOperation = typeof SANDBOX_POOL_OPERATIONS[number];
|
|
@@ -2271,7 +2422,7 @@ interface SandboxFileContent {
|
|
|
2271
2422
|
type SandboxFileBody = string | {
|
|
2272
2423
|
ref: Ref;
|
|
2273
2424
|
};
|
|
2274
|
-
/** A wait a call long-polls with, in milliseconds
|
|
2425
|
+
/** A wait a call long-polls with, in milliseconds, for as long as it asks; omitted or 0 answers at once. */
|
|
2275
2426
|
interface SandboxWaitOptions {
|
|
2276
2427
|
waitMs?: number;
|
|
2277
2428
|
invoke?: InvokeOpts;
|
|
@@ -2310,7 +2461,10 @@ interface CreatedSandbox {
|
|
|
2310
2461
|
/** A provider-neutral pool of sandboxes, each addressed by id. */
|
|
2311
2462
|
interface SandboxPool {
|
|
2312
2463
|
readonly resource: CRN;
|
|
2313
|
-
/**
|
|
2464
|
+
/**
|
|
2465
|
+
* Create a sandbox on the pool, answered once it settles (`running`, `failed`, or the provider's refusal); without an `id`,
|
|
2466
|
+
* the door names it from the invocation's idempotency key.
|
|
2467
|
+
*/
|
|
2314
2468
|
createSandbox(request?: SandboxPoolCreateRequest, opts?: InvokeOpts): Promise<CreatedSandbox>;
|
|
2315
2469
|
/** Address a sandbox of the pool by its id, such as one the Session keeps. No invocation. */
|
|
2316
2470
|
sandbox(id: string): Sandbox;
|
|
@@ -3302,8 +3456,12 @@ interface ReduceFact {
|
|
|
3302
3456
|
stage: StageInfo;
|
|
3303
3457
|
}
|
|
3304
3458
|
type ScopeJournalKind = "turn" | "tool" | "step";
|
|
3305
|
-
/**
|
|
3306
|
-
|
|
3459
|
+
/**
|
|
3460
|
+
* `journal`: what the Agent read of `ctx.journal.paged` at that point, recorded as its `value` so a replay reads the same.
|
|
3461
|
+
* `fetch`: a ctx.fetch's answer, which its Session journals (its `value`: status, status text, headers, base64 body), or its
|
|
3462
|
+
* refusal (`error`).
|
|
3463
|
+
*/
|
|
3464
|
+
type LocalJournalKind = "clock" | "random" | "score" | "commit" | "await" | "spawn" | "map" | "reduce" | "view" | "page" | "truncate" | "cancel" | "capability" | "schedule" | "journal" | "fetch";
|
|
3307
3465
|
type JournalKind = ScopeJournalKind | LocalJournalKind | "invoke" | "send";
|
|
3308
3466
|
/** Stable identity available to Agent code. Platform execution and deployment
|
|
3309
3467
|
* metadata intentionally remain outside the public Agent context. */
|
|
@@ -3449,6 +3607,24 @@ interface Ctx {
|
|
|
3449
3607
|
sandboxPool(resource: CRN): SandboxPool;
|
|
3450
3608
|
invoke<T>(resource: CRN, op: string, args: unknown, opts?: InvokeOpts): Promise<T>;
|
|
3451
3609
|
invokeAsync<T>(resource: CRN, op: string, args: unknown, opts?: InvokeOpts): InvocationHandle<T>;
|
|
3610
|
+
/**
|
|
3611
|
+
* An https request with one of the Run's owner's connections (docs/sandbox-egress-connections.md section 6). `connection`
|
|
3612
|
+
* is a binding key in the Agent's tenant and namespace: the enabled Credential binding of that key its owner holds, its
|
|
3613
|
+
* customer's when the Run has one, else its tenant's. There is no fetch without one, and nothing in the Run ever holds
|
|
3614
|
+
* the Credential's value. The platform matches the request against the Credential's `destinations` (https only; the most
|
|
3615
|
+
* specific wins; a request none matches is refused, as a connection was named), decides each use with `credential:use`
|
|
3616
|
+
* Policy (`origin.kind` `agent`, `egress.destination`, `egress.position`), presents the value as the matched destination's
|
|
3617
|
+
* `present` says, in place of any header of that name the Agent sent, forwards the request without following a redirect
|
|
3618
|
+
* (a 3xx is the answer), and redacts the value from the answer's headers and body.
|
|
3619
|
+
*
|
|
3620
|
+
* The answer (status, headers and whole body) is journaled at the call's position, so a replay answers it from the journal
|
|
3621
|
+
* without calling again; a refusal is journaled too, and throws the same Error with the platform's `status` at replay. A
|
|
3622
|
+
* request's method is its effect under a Tool's ceiling: GET, HEAD and OPTIONS read-only, PUT and DELETE idempotent, any
|
|
3623
|
+
* other non-idempotent.
|
|
3624
|
+
*/
|
|
3625
|
+
fetch(input: string | Request, init: RequestInit | undefined, opts: {
|
|
3626
|
+
connection: string;
|
|
3627
|
+
}): Promise<Response>;
|
|
3452
3628
|
request(policy: PolicyCRN, grant: CapabilityGrant): Handle<CapabilityRef>;
|
|
3453
3629
|
analytics: AnalyticsClient;
|
|
3454
3630
|
/**
|
|
@@ -5721,5 +5897,5 @@ declare function parseLedgerAddress(value: unknown): LedgerAddressParts | null;
|
|
|
5721
5897
|
/** Formats ledger address parts; throws when a part breaks its id rule. */
|
|
5722
5898
|
declare function formatLedgerAddress(parts: LedgerAddressParts): LedgerAddress;
|
|
5723
5899
|
|
|
5724
|
-
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,
|
|
5725
|
-
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, ChannelFetchRequest, ChannelFetchResult, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelObject, ChannelPresence, ChannelPresenceReceipt, 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, CreatedSandbox, 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, ModelContentPart, ModelCredentialHeader, ModelFilePart, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, ModelTechnicalCapabilities, ModelTextPart, 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, SandboxCapabilities, SandboxCreateRequest, SandboxEgress, SandboxEgressCapabilities, SandboxEgressDestination, SandboxEgressPolicy, SandboxEgressRule, SandboxExecCapabilities, SandboxExecRequest, SandboxExecution, SandboxExecutionState, SandboxFile, SandboxFileBody, SandboxFileCapabilities, SandboxFileContent, SandboxFileScope, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxLabels, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPersistence, SandboxPool, SandboxPoolCreateRequest, SandboxPoolOperation, SandboxPortCapabilities, SandboxProviderFailureClass, SandboxProviderUnavailable, SandboxSecretsRoute, SandboxSnapshot, SandboxSnapshotCapabilities, SandboxState, SandboxUpdateRequest, SandboxView, SandboxWaitOptions, 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 };
|
|
5900
|
+
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, SANDBOX_POOL_OPERATIONS, SANDBOX_PROVIDER_FAILURE_CLASSES, SANDBOX_PROVIDER_UNAVAILABLE, 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, 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, sandboxProviderUnavailable, 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 };
|
|
5901
|
+
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, ChannelFetchRequest, ChannelFetchResult, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelObject, ChannelPresence, ChannelPresenceReceipt, 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, CreatedSandbox, 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, ModelContentPart, ModelCredentialHeader, ModelFilePart, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, ModelTechnicalCapabilities, ModelTextPart, 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, SandboxCapabilities, SandboxCreateRequest, SandboxEgress, SandboxEgressCapabilities, SandboxEgressDestination, SandboxEgressPolicy, SandboxEgressRule, SandboxExecCapabilities, SandboxExecRequest, SandboxExecution, SandboxExecutionState, SandboxFile, SandboxFileBody, SandboxFileCapabilities, SandboxFileContent, SandboxFileScope, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxHistoryEvent, SandboxIndexedEvent, SandboxLabelCapabilities, SandboxLabels, SandboxLifecycleEvent, SandboxNetworkMode, SandboxNetworkPolicy, SandboxOrphanEvent, SandboxOrphanWithdrawnEvent, SandboxPersistence, SandboxPool, SandboxPoolCreateRequest, SandboxPoolOperation, SandboxPortCapabilities, SandboxProviderAllocation, SandboxProviderFailureClass, SandboxProviderUnavailable, SandboxSecretsRoute, SandboxSnapshot, SandboxSnapshotCapabilities, SandboxState, SandboxUpdateRequest, SandboxUsageEvent, SandboxUsageItem, SandboxView, SandboxWaitOptions, 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
|
@@ -4604,22 +4604,6 @@ function scoreLevel(answer2) {
|
|
|
4604
4604
|
return Math.min(Object.keys(answer2.legend).length - 1, Math.max(0, Math.round(answer2.score)));
|
|
4605
4605
|
}
|
|
4606
4606
|
|
|
4607
|
-
// packages/sdk/src/sandbox-door.ts
|
|
4608
|
-
var SANDBOX_DOOR_MAX_WAIT_MS = 25e3;
|
|
4609
|
-
var SANDBOX_DOOR_ERRORS = {
|
|
4610
|
-
Invalid: 400,
|
|
4611
|
-
AccountBalanceExceeded: 402,
|
|
4612
|
-
Forbidden: 403,
|
|
4613
|
-
NotFound: 404,
|
|
4614
|
-
AlreadyExists: 409,
|
|
4615
|
-
Conflict: 409,
|
|
4616
|
-
NotRunning: 409,
|
|
4617
|
-
Unsupported: 422,
|
|
4618
|
-
ProviderError: 502,
|
|
4619
|
-
[SANDBOX_PROVIDER_UNAVAILABLE]: 503,
|
|
4620
|
-
BillingAdmissionUnavailable: 503
|
|
4621
|
-
};
|
|
4622
|
-
|
|
4623
4607
|
// packages/sdk/src/container-image.ts
|
|
4624
4608
|
var REPOSITORY = /^[a-z0-9]+(?:(?:\.|_|__|-+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:\.|_|__|-+)[a-z0-9]+)*)*$/u;
|
|
4625
4609
|
var TAG = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$/u;
|
|
@@ -5361,7 +5345,6 @@ export {
|
|
|
5361
5345
|
ResourceInvalid,
|
|
5362
5346
|
ResourceUnbound,
|
|
5363
5347
|
RollbackTargetInvalid,
|
|
5364
|
-
SANDBOX_DOOR_MAX_WAIT_MS,
|
|
5365
5348
|
SANDBOX_EGRESS_LIMITS,
|
|
5366
5349
|
SANDBOX_POOL_OPERATIONS,
|
|
5367
5350
|
SANDBOX_PROVIDER_FAILURE_CLASSES,
|