@constal/sdk 4.4.0 → 5.0.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 CHANGED
@@ -96,29 +96,6 @@ configuration, and control-plane operations. Returned objects are independent
96
96
  copies. A configured operation is not a promise of authorization: Policy still
97
97
  applies when it is invoked.
98
98
 
99
- ## Agent delivery
100
-
101
- Bind another Agent Resource to the caller, then address that bound Agent by CRN:
102
-
103
- ```ts
104
- const peer = ctx.resources.reviewer;
105
- const receipt = await ctx.send(peer, { request: "Review this change" },
106
- { session: "review-123" });
107
-
108
- const delivery = await ctx.send<{ verdict: string }>(peer,
109
- { request: "Review this change" }, { completion: "run-result" });
110
- const answer = await delivery.result;
111
- ```
112
-
113
- Each delivery queues a distinct Run in the target Agent's Session. Receipt mode
114
- requires a Session and acknowledges the durable enqueue; result mode may omit
115
- the Session to create a fresh one and returns a cancellable Handle for the target
116
- Run's result. The target executes under the initiating principal's authority.
117
- Policy evaluates `agent:invoke` on the exact bound target for each new send, and
118
- the platform rechecks that authority when the target accepts the message.
119
- Session and Run reads remain separate Policy actions. `ctx.commit` continues to
120
- address the caller's own ledger.
121
-
122
99
  For model-selected operations, add the optional `resourceTools` to the Agent's
123
100
  ordinary Tool catalog:
124
101
 
@@ -181,6 +158,56 @@ array. Declare its normal `needs` and `maxEffect` when loading uses Resources.
181
158
  source when supplied, and content hash. These are ordinary authorized Tool calls.
182
159
  Skill instructions do not grant additional authority.
183
160
 
161
+ ## Ledger addresses and delivery
162
+
163
+ A ledger address names a Session's main ledger,
164
+ `agent:<agent>/session:<session>`, or a spawned loop's,
165
+ `agent:<agent>/session:<session>/spawn:<handle>`, within the Run's tenant,
166
+ namespace, and Customer. `ctx.run.ledger` is the current Run's own address (null
167
+ for an operator branch, an eval fork, a compensation, or a loop one of them
168
+ spawned, and for a Run of an existing Session whose id has a `/` or a control
169
+ character or is longer than 256 characters, which ingress no longer accepts for
170
+ a new one), and the Handle
171
+ `ctx.spawn` returns names its loop in `ledger`, the same across the spawn's
172
+ retries. A Run omits `of` and `to` for its own ledger; `session:<id>` is
173
+ refused.
174
+
175
+ ```ts
176
+ const notes = await ctx.ledger.view("notes", { of: "agent:memory/session:team" });
177
+ await ctx.commit({ text: "Fix the failing build", data: { issue: 7 } },
178
+ { to: "agent:task/session:fix-7", deliver: "live", delegate: true });
179
+ const investigation = ctx.spawn(investigate, { issue: 7 });
180
+ await ctx.commit("Also check the flaky test", { to: investigation.ledger, deliver: "live" });
181
+ const woken = ctx.await("next", { afterRun: "delivery", timeout: 3_600_000 });
182
+ ```
183
+
184
+ `ctx.ledger.view` reads another ledger at its head. `ctx.commit` with `to` is
185
+ the one way agent code delivers to another ledger: `deliver: "queue"`, the
186
+ default, queues the item; `"live"` steers the addressed Run or starts one. A
187
+ live item is a non-empty string or `{ text, data? }`, and a delivery to a spawn
188
+ is live. `delegate: true` makes this Session the owner of the receiving Session,
189
+ which takes its owner only before its first Run. A delegation to a Session whose
190
+ live Run's cancel awaits its Driver waits behind that Run and starts the next
191
+ one; any other live delivery steers that Run. The platform then delivers to
192
+ the owner, as a `RunReport`, each end of that Session's root Runs (`complete`
193
+ with its result, `failed`, `stopped`) but one a stop of the owner's ledger
194
+ caused, each hold of one at its turn or spend limit (`held`), and each refused
195
+ or dropped start of one whose event did not come from the owner's Session
196
+ (`refused`). A delivery refused when it reaches
197
+ its Session, or failing there for good, is reported to its sender as a
198
+ `RunReport` with status `refused`. `ctx.await(label, { afterRun: "delivery" })`
199
+ settles when a delivery steers the waiting Run and resolves to `{ seq, eventId }`
200
+ of the steer that woke it; the delivery itself stays in the ledger.
201
+
202
+ Policy decides a view of another Session (`ledger:read`; the pages its cursor
203
+ then reads need no further check) and a delivery to another Session at its
204
+ commit (`agent:invoke` on the receiving Agent, `session:steer` when live,
205
+ `run:cancel` when delegating). A refused view or
206
+ delivery throws its refusal, which is journaled, so a replay throws the same
207
+ error at the same position: a Policy denial is `PolicyDecisionFailed` with its
208
+ `decisionHash`, and any other refusal an `Error` with the platform's message and
209
+ `status`.
210
+
184
211
  ## Session schedules
185
212
 
186
213
  Schedule a future invocation of the current Agent and Session:
@@ -200,8 +227,7 @@ Recurring schedules preserve missed occurrences by default; explicitly request
200
227
 
201
228
  `ctx.listSchedules()` pages the owning Session's schedules; calling `schedule()`
202
229
  again with the same name replaces future work. `ctx.cancelSchedule(name)` stops
203
- future work and identifies accepted or unresolved deliveries. Another bound
204
- Agent can be selected with `agent` and an explicit `session`. Use `ctx.await()`
230
+ future work and identifies accepted or unresolved deliveries. Use `ctx.await()`
205
231
  for sleeping within the current Run.
206
232
 
207
233
  See [Schedule Agent follow-ups](https://constal.ai/docs/agents/schedules) for replay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constal/sdk",
3
- "version": "4.4.0",
3
+ "version": "5.0.0",
4
4
  "description": "Public TypeScript SDK for authoring Constal agents, integrations, policies, channels, and credential providers",
5
5
  "keywords": [
6
6
  "constal",
package/publish/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@constal/sdk",
3
- "version": "4.4.0",
3
+ "version": "5.0.0",
4
4
  "exports": [
5
5
  "AGENT_UI_DEFAULTS",
6
6
  "Action",
@@ -14,11 +14,8 @@
14
14
  "Agent",
15
15
  "AgentCredentialSetupRequirement",
16
16
  "AgentDef",
17
- "AgentDeliveryReceipt",
18
17
  "AgentDeployPolicy",
19
18
  "AgentGovernanceMeter",
20
- "AgentResultDelivery",
21
- "AgentSendOpts",
22
19
  "AgentSetupMetadata",
23
20
  "AgentSetupRequirement",
24
21
  "AgentSetupWorkflow",
@@ -149,7 +149,9 @@ declare class ApiError extends Error {
149
149
  readonly status: number;
150
150
  readonly body: string;
151
151
  readonly disposition: "terminal" | "uncertain";
152
- constructor(status: number, body: string, disposition?: "terminal" | "uncertain");
152
+ readonly retryAfterMs?: number | undefined;
153
+ /** `retryAfterMs`: the interval the remote API stated, such as its `retry-after`; absent when it stated none. */
154
+ constructor(status: number, body: string, disposition?: "terminal" | "uncertain", retryAfterMs?: number | undefined);
153
155
  }
154
156
  /** The integration can prove that no external request was sent. */
155
157
  declare class IntegrationRequestNotSent extends Error {
@@ -1943,13 +1945,9 @@ type ScheduleWhen = {
1943
1945
  after?: never;
1944
1946
  missed?: ScheduleMissed;
1945
1947
  };
1946
- /** Future invocations of this Agent, or an explicitly bound Agent in an explicit Session. */
1948
+ /** Future invocations of this Agent in this Session. A scheduled Run reaches another ledger with ctx.commit(item, { to }). */
1947
1949
  type ScheduleOptions<Input = unknown> = ScheduleWhen & {
1948
1950
  input: Input;
1949
- /** Omission selects the current Agent and its normal Session routing. */
1950
- agent?: CRN;
1951
- /** Omission selects the current Session. Another Agent requires an explicit Session. */
1952
- session?: string;
1953
1951
  };
1954
1952
  type ScheduleTiming = {
1955
1953
  kind: "after";
@@ -2262,7 +2260,9 @@ interface SpawnBudget {
2262
2260
  wallMs: number;
2263
2261
  }
2264
2262
  /** Exact local Resource and Tool names retained by a child Run. Omitted names
2265
- * are unavailable to the child even when they are bound to the parent. */
2263
+ * are unavailable to the child even when they are bound to the parent.
2264
+ * Attenuation bounds what the child runs, not what it reads or the Runs its deliveries start: Policy decides its
2265
+ * views and its deliveries, and a Run that a delivery starts runs under the receiving ledger's own grants. */
2266
2266
  interface SpawnAttenuation {
2267
2267
  bindings: readonly string[];
2268
2268
  tools: readonly string[];
@@ -2292,7 +2292,8 @@ interface AwaitOpts<T> {
2292
2292
  /** Optional caller-selected response size limit, in UTF-8 bytes. */
2293
2293
  maxBytes?: number;
2294
2294
  /** "message": the Session's next queued input answers the wait with its value. "delivery": the wait settles when a
2295
- * delivery steers this Run after the wait opened; it returns no value and the delivery stays in the ledger. */
2295
+ * delivery steers this Run after the wait opened, and resolves to `{ seq, eventId }` of the steer that woke it; the
2296
+ * delivery itself stays in the ledger and is consumed by nothing. */
2296
2297
  afterRun?: "ignore" | "message" | "delivery";
2297
2298
  /** Explicitly public presentation; never include Credential material or private evidence. */
2298
2299
  presentation?: AwaitPresentation;
@@ -2313,28 +2314,10 @@ interface InvocationHandle<T> extends Handle<T> {
2313
2314
  }
2314
2315
  /** A spawn's Handle names the spawned loop's ledger, the same across the spawn's retries. */
2315
2316
  interface SpawnHandle<T> extends Handle<T> {
2317
+ /** Reading it throws a TypeError in a Session whose id the address grammar excludes (more than 256 characters, a `/` or
2318
+ * a control character): such a Session has no ledger addresses. */
2316
2319
  readonly ledger: LedgerAddress;
2317
2320
  }
2318
- /** A message to an exactly bound Agent creates one distinct target Run. */
2319
- type AgentSendOpts = {
2320
- session: string;
2321
- completion?: "receipt";
2322
- } | {
2323
- session?: string;
2324
- completion: "run-result";
2325
- timeoutMs?: number;
2326
- };
2327
- interface AgentDeliveryReceipt {
2328
- id: string;
2329
- state: "enqueued";
2330
- target: {
2331
- agent: CRN;
2332
- session: string;
2333
- };
2334
- }
2335
- interface AgentResultDelivery<T> extends AgentDeliveryReceipt {
2336
- result: Handle<T>;
2337
- }
2338
2321
  interface CommitOpts {
2339
2322
  tier?: Tier;
2340
2323
  gate?: string | GateEvidence | {
@@ -2343,11 +2326,16 @@ interface CommitOpts {
2343
2326
  /** Filled by the runtime after a scorer-backed gate; callers must not provide it. */
2344
2327
  gateVerdict?: GateVerdict;
2345
2328
  compensate?: Compensation;
2329
+ /** Delivers the item to another ledger: `agent:<agent>/session:<session>` (that Session's main ledger) or
2330
+ * `agent:<agent>/session:<session>/spawn:<handle>` (a spawned loop's); or commits it to `memory`. Omit it for this
2331
+ * Run's own ledger; `session:<id>` is refused. */
2346
2332
  to?: LedgerAddress;
2347
2333
  checkpoint?: {
2348
2334
  upTo: FactRef;
2349
2335
  };
2350
2336
  expectedHead?: FactRef;
2337
+ /** "queue" (the default) or "live", which steers the addressed Run or starts one. A live item is a non-empty string or
2338
+ * { text, data? } with a non-empty text. A delivery to a spawn is live. */
2351
2339
  deliver?: DeliveryMode;
2352
2340
  /** Makes this Run's Session the owner of the Session whose main ledger `to` names. */
2353
2341
  delegate?: boolean;
@@ -2705,8 +2693,8 @@ interface RunInfo {
2705
2693
  };
2706
2694
  mode: Mode;
2707
2695
  /** This Run's own ledger address: its Session's main ledger for a root Run, its spawn's for a spawned Run, null for a
2708
- * Run that nothing addresses (an operator branch, an eval fork, a compensation). */
2709
- ledger?: LedgerAddress | null;
2696
+ * Run that nothing addresses (an operator branch, an eval fork, a compensation, or a loop one of them spawned). */
2697
+ ledger: LedgerAddress | null;
2710
2698
  /** Present for an independently scheduled invocation; input remains unchanged. */
2711
2699
  schedule?: ScheduleTrigger;
2712
2700
  }
@@ -2770,6 +2758,9 @@ interface Ctx {
2770
2758
  /** Judge one state with constrained, probabilistic answers instead of a generated turn. Journaled and priced like a model call. */
2771
2759
  evaluate<Q extends EvaluationQuestions>(spec: EvaluationSpec<Q>): Promise<EvaluationRecord<Q>>;
2772
2760
  ledger: {
2761
+ /** `of` names another ledger: `agent:<agent>/session:<session>` (that Session's main ledger, read at its head),
2762
+ * `agent:<agent>/session:<session>/spawn:<handle>` (a spawned loop's), `memory` or `table:<table>@<branch>`.
2763
+ * Omit it for this Run's own ledger, pinned at dispatch; `session:<id>` is refused. */
2773
2764
  view<S = HistoryView>(name?: string, opts?: {
2774
2765
  of?: LedgerAddress;
2775
2766
  }): Promise<S>;
@@ -2788,7 +2779,7 @@ interface Ctx {
2788
2779
  cancelSchedule(name: string): Promise<ScheduleCancellation>;
2789
2780
  /** Inspect this Session's schedules through a journaled, paginated read. */
2790
2781
  listSchedules(options?: ListSchedulesOptions): Promise<SchedulePage>;
2791
- spawn<T>(task: Task<T>, input: unknown, opts?: SpawnOpts): Handle<T>;
2782
+ spawn<T>(task: Task<T>, input: unknown, opts?: SpawnOpts): SpawnHandle<T>;
2792
2783
  map<I, O, R = never>(f: PartitionFn<I, O, R>, over: Over<I>, opts: MapOpts): Handle<MapFact>;
2793
2784
  reduce<I, O>(g: FoldFn<I, O> | SqlFold, over: Over<I>, opts?: ReduceOpts): Handle<ReduceFact>;
2794
2785
  step<T>(name: string, fn: () => Promise<T>): Promise<T>;
@@ -2799,13 +2790,6 @@ interface Ctx {
2799
2790
  sandboxPool(resource: CRN): SandboxPool;
2800
2791
  invoke<T>(resource: CRN, op: string, args: unknown, opts?: InvokeOpts): Promise<T>;
2801
2792
  invokeAsync<T>(resource: CRN, op: string, args: unknown, opts?: InvokeOpts): InvocationHandle<T>;
2802
- send<T>(agent: CRN, input: unknown, opts: AgentSendOpts & {
2803
- completion: "run-result";
2804
- }): Promise<AgentResultDelivery<T>>;
2805
- send(agent: CRN, input: unknown, opts: {
2806
- session: string;
2807
- completion?: "receipt";
2808
- }): Promise<AgentDeliveryReceipt>;
2809
2793
  request(policy: PolicyCRN, grant: CapabilityGrant): Handle<CapabilityRef>;
2810
2794
  analytics: AnalyticsClient;
2811
2795
  run: RunInfo;
@@ -2961,7 +2945,8 @@ interface CanonicalEventDraft<T = unknown> {
2961
2945
  occurredAt?: number;
2962
2946
  deliver?: DeliveryMode;
2963
2947
  /** When respond() runs: "receipt" once the event is durably in its Session's inbox; "run-result" once the Run it
2964
- * starts settles, up to 120 s. Default: "receipt" for queue, "run-result" for live. */
2948
+ * starts settles, up to 120 s. Default: "receipt" for queue, "run-result" for live. `queue` with "run-result" is an
2949
+ * invalid draft. */
2965
2950
  completion?: "receipt" | "run-result";
2966
2951
  /** Channel-owned reply address pinned at admission; Agent input cannot replace it. */
2967
2952
  reply?: {
@@ -2974,6 +2959,9 @@ interface IgnoredChannelEvent {
2974
2959
  ignored: true;
2975
2960
  reason: string;
2976
2961
  response: ChannelResponse;
2962
+ /** Names of this Channel's bindings whose Credentials the platform checks with their providers before it answers,
2963
+ * such as on a provider's own installation lifecycle event. Only a request with a Customer resolves them. */
2964
+ recheck?: string[];
2977
2965
  }
2978
2966
  /** Authenticated source delivery captured once and dispatched to authorized subscribers. */
2979
2967
  interface ChannelIngressEvent {
@@ -4330,6 +4318,10 @@ interface CredentialVerifyResult {
4330
4318
  verified: boolean;
4331
4319
  /** Non-secret external identity and access facts verified by this provider. */
4332
4320
  claims?: Record<string, string | number | boolean | string[]>;
4321
+ /** With verified:false only: the provider states that the installation this version stands for no longer exists.
4322
+ * The platform revokes this version and the Credential's older live versions. A failure that may pass, and any
4323
+ * answer that is not such a statement (a suspension, a mismatch, a refusal), is thrown instead. */
4324
+ revoked?: true;
4333
4325
  }
4334
4326
  interface CredentialDestroyResult {
4335
4327
  destroyed: boolean;
@@ -4672,4 +4664,4 @@ declare function parseLedgerAddress(value: unknown): LedgerAddressParts | null;
4672
4664
  declare function formatLedgerAddress(parts: LedgerAddressParts): LedgerAddress;
4673
4665
 
4674
4666
  export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, 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, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, formatLedgerAddress, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, renderTrainingCompletion, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, sandboxControls, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
4675
- export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeliveryReceipt, AgentDeployPolicy, AgentGovernanceMeter, AgentResultDelivery, AgentSendOpts, 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, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, 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, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, 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, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LoadedSkill, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelInvocationArgs, ModelInvocationResult, 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, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, 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, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Skill, SkillDescription, SkillLibrary, SkillSource, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingUsageUnits, TurnDraft, TurnGate, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
4667
+ 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, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, 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, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, 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, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LoadedSkill, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelInvocationArgs, ModelInvocationResult, 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, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, 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, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Skill, SkillDescription, SkillLibrary, SkillSource, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingUsageUnits, TurnDraft, TurnGate, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
package/publish/index.js CHANGED
@@ -2667,16 +2667,19 @@ var MEMORY_OPERATION_DECLARATIONS = [
2667
2667
 
2668
2668
  // packages/sdk/src/integration.ts
2669
2669
  var ApiError = class extends Error {
2670
- constructor(status, body, disposition = "uncertain") {
2670
+ /** `retryAfterMs`: the interval the remote API stated, such as its `retry-after`; absent when it stated none. */
2671
+ constructor(status, body, disposition = "uncertain", retryAfterMs) {
2671
2672
  super(`${status}: ${body}`);
2672
2673
  this.status = status;
2673
2674
  this.body = body;
2674
2675
  this.disposition = disposition;
2676
+ this.retryAfterMs = retryAfterMs;
2675
2677
  this.name = "ApiError";
2676
2678
  }
2677
2679
  status;
2678
2680
  body;
2679
2681
  disposition;
2682
+ retryAfterMs;
2680
2683
  };
2681
2684
  var IntegrationRequestNotSent = class extends Error {
2682
2685
  constructor(message2 = "integration request was not sent") {