@constal/sdk 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constal/sdk",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Public TypeScript SDK for authoring Constal agents, integrations, policies, channels, and credential providers",
5
5
  "keywords": [
6
6
  "constal",
package/publish/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@constal/sdk",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "exports": [
5
5
  "AGENT_UI_DEFAULTS",
6
6
  "Action",
@@ -209,6 +209,7 @@
209
209
  "Handle",
210
210
  "HandleOutcome",
211
211
  "Hash",
212
+ "HistoryPage",
212
213
  "HistoryView",
213
214
  "HmacVerification",
214
215
  "IgnoredChannelEvent",
@@ -421,6 +422,7 @@
421
422
  "ShareEvaluationRequest",
422
423
  "ShareEvaluationVerdict",
423
424
  "ShareEvaluationView",
425
+ "ShareHistory",
424
426
  "SharePrice",
425
427
  "ShareRequest",
426
428
  "ShareReviewDecision",
@@ -439,6 +441,7 @@
439
441
  "StageOutputSpec",
440
442
  "StartTrainingRequest",
441
443
  "SteerEvent",
444
+ "StepJournal",
442
445
  "SuiteFact",
443
446
  "SwallowedYield",
444
447
  "TRAINING_PROVIDER_CAPABILITY",
@@ -2624,8 +2624,23 @@ interface HistoryView {
2624
2624
  message: unknown;
2625
2625
  checkpoint: Fact | null;
2626
2626
  facts: Fact[];
2627
+ /** The steers this page holds, oldest first: on the Run's own ledger, those after its checkpoint up to the event head
2628
+ * the view is pinned at. */
2627
2629
  steers: SteerEvent[];
2630
+ /** The cursor to the Facts before `facts`, which `page()` reads; null when there are none. */
2628
2631
  more: string | null;
2632
+ /** The cursor to the steers after `steers`, which `page()` reads; null when there are none. Absent from platforms before
2633
+ * SDK 6.1.0, whose page held at most its oldest 200 steers. */
2634
+ steersMore?: string | null;
2635
+ }
2636
+ /** A page `ctx.ledger.page()` reads: from a `more` cursor the Facts before the last ones read, newest last; from a `steersMore`
2637
+ * cursor the steers after the last ones read, oldest first, with no Facts. */
2638
+ interface HistoryPage {
2639
+ facts: Fact[];
2640
+ more: string | null;
2641
+ /** Present on a steer page. */
2642
+ steers?: SteerEvent[];
2643
+ steersMore?: string | null;
2629
2644
  }
2630
2645
  interface RollbackReport {
2631
2646
  rollbackId: string;
@@ -3077,7 +3092,8 @@ interface ReduceFact {
3077
3092
  stage: StageInfo;
3078
3093
  }
3079
3094
  type ScopeJournalKind = "turn" | "tool" | "step";
3080
- type LocalJournalKind = "clock" | "random" | "score" | "commit" | "await" | "spawn" | "map" | "reduce" | "view" | "page" | "truncate" | "cancel" | "capability" | "schedule";
3095
+ /** `journal`: what the Agent read of `ctx.journal.paged` at that point, recorded as its `value` so a replay reads the same. */
3096
+ type LocalJournalKind = "clock" | "random" | "score" | "commit" | "await" | "spawn" | "map" | "reduce" | "view" | "page" | "truncate" | "cancel" | "capability" | "schedule" | "journal";
3081
3097
  type JournalKind = ScopeJournalKind | LocalJournalKind | "invoke" | "send";
3082
3098
  /** Stable identity available to Agent code. Platform execution and deployment
3083
3099
  * metadata intentionally remain outside the public Agent context. */
@@ -3169,6 +3185,22 @@ interface EvaluationRecord<Q extends EvaluationQuestions = EvaluationQuestions>
3169
3185
  provider: string;
3170
3186
  model: string;
3171
3187
  }
3188
+ /**
3189
+ * This step's journal at the Agent's current position. Every dispatch of a step carries its journal, and the step replays
3190
+ * it: a durable Agent's journal starts afresh each time `step()` returns, a script Agent's lasts the Run. Once a dispatch
3191
+ * no longer fits one message the rest is stored and read back at every dispatch, so a durable Agent that loops within one
3192
+ * `step()` can return from it once `paged` is true.
3193
+ *
3194
+ * `entries` follows from the Agent's position and reading it records nothing. Reading `paged` journals what it read, so a
3195
+ * replay reads at each point what the live step read there. Read them where everything the step started has been awaited.
3196
+ */
3197
+ interface StepJournal {
3198
+ /** The entries the step's journal holds at this point. */
3199
+ readonly entries: number;
3200
+ /** True once the step's next dispatch, with its journal and the values its replay reads, would no longer fit one message:
3201
+ * end the step now. */
3202
+ readonly paged: boolean;
3203
+ }
3172
3204
  interface Ctx {
3173
3205
  turn(spec: TurnSpec): Promise<TurnRecord>;
3174
3206
  /** Judge one state with constrained, probabilistic answers instead of a generated turn. Journaled and priced like a model call. */
@@ -3176,14 +3208,13 @@ interface Ctx {
3176
3208
  ledger: {
3177
3209
  /** `of` names another ledger: `agent:<agent>/session:<session>` (that Session's main ledger, read at its head),
3178
3210
  * `agent:<agent>/session:<session>/spawn:<handle>` (a spawned loop's), `memory` or `table:<table>@<branch>`.
3179
- * Omit it for this Run's own ledger, pinned at dispatch; `session:<id>` is refused. */
3211
+ * Omit it for this Run's own ledger, pinned at dispatch; `session:<id>` is refused. Every `history` view is read from
3212
+ * its Session, so it can fail as other ctx requests do. */
3180
3213
  view<S = HistoryView>(name?: string, opts?: {
3181
3214
  of?: LedgerAddress;
3182
3215
  }): Promise<S>;
3183
- page(cursor: string): Promise<{
3184
- facts: Fact[];
3185
- more: string | null;
3186
- }>;
3216
+ /** The page a view's or page's `more` or `steersMore` cursor names. */
3217
+ page(cursor: string): Promise<HistoryPage>;
3187
3218
  branch(at: FactRef): BranchRef;
3188
3219
  truncate(to: FactRef): Handle<RollbackReport>;
3189
3220
  };
@@ -3208,6 +3239,8 @@ interface Ctx {
3208
3239
  invokeAsync<T>(resource: CRN, op: string, args: unknown, opts?: InvokeOpts): InvocationHandle<T>;
3209
3240
  request(policy: PolicyCRN, grant: CapabilityGrant): Handle<CapabilityRef>;
3210
3241
  analytics: AnalyticsClient;
3242
+ /** This step's journal at the Agent's current position. Undefined where the platform's runtime predates it. */
3243
+ readonly journal?: StepJournal;
3211
3244
  run: RunInfo;
3212
3245
  }
3213
3246
  interface AgentDef<S = unknown> {
@@ -4517,6 +4550,13 @@ interface Share {
4517
4550
  prices: SharePrice[];
4518
4551
  /** Required when actions include evaluate; null otherwise. */
4519
4552
  evaluation: ShareEvaluation | null;
4553
+ /**
4554
+ * The past Runs the Share also delivers, which the grantor sets: those that ended from `since` until the Share was accepted.
4555
+ * Needs read; null delivers none, and a Share Constal grants has none.
4556
+ */
4557
+ history: {
4558
+ since: number;
4559
+ } | null;
4520
4560
  expiresAt: number | null;
4521
4561
  status: "invited" | "active" | "revoked" | "expired";
4522
4562
  authorizationSeq: number;
@@ -4527,7 +4567,35 @@ interface Share {
4527
4567
  revokedAt: number | null;
4528
4568
  }
4529
4569
  /** The terms a grantor sets: all it chooses when creating a Share, those that change when updating one. */
4530
- type ShareRequest = Partial<Pick<Share, "displayName" | "selector" | "actions" | "prices" | "evaluation" | "expiresAt">>;
4570
+ type ShareRequest = Partial<Pick<Share, "displayName" | "selector" | "actions" | "prices" | "evaluation" | "history" | "expiresAt">>;
4571
+ /**
4572
+ * The delivery of a Share's past Runs under one authorizationSeq, which starts once the Share is accepted, or saved, with
4573
+ * `history` set, charged at the Share's prices as live traces are: the Runs it checked, the traces it delivered, and what they
4574
+ * were charged. A change to the Share's terms cancels it (`error.code` `ShareChanged`) and starts one under the new terms; so
4575
+ * do revoking or expiring the Share or removing read (`ShareRevoked`), and turning the grantor's sharing off (`SharingOff`).
4576
+ * The recipient cancelling it leaves `error` null; a running delivery that billing holds back carries `AccountBalanceExceeded`.
4577
+ * Warnings name traces by their pseudonyms.
4578
+ */
4579
+ interface ShareHistory {
4580
+ id: string;
4581
+ share: string;
4582
+ authorizationSeq: number;
4583
+ state: "queued" | "running" | "succeeded" | "failed" | "cancelled";
4584
+ window: {
4585
+ start: number;
4586
+ end: number;
4587
+ };
4588
+ runs: number;
4589
+ delivered: number;
4590
+ chargeMicroUsd: number;
4591
+ warnings: string[];
4592
+ error: {
4593
+ code: string;
4594
+ message: string;
4595
+ } | null;
4596
+ createdAt: number;
4597
+ updatedAt: number;
4598
+ }
4531
4599
  /** A Share's evaluation spec, checked: Resources named in its namespace, at most 32 Scorers, concurrency 1 to 32, a budget. */
4532
4600
  declare function shareEvaluation(value: unknown): ShareEvaluation;
4533
4601
  /** A Share's ordered price rules, at most 32, each a selector (null matches every trace) and a whole microUsd price. */
@@ -5280,4 +5348,4 @@ declare function parseLedgerAddress(value: unknown): LedgerAddressParts | null;
5280
5348
  declare function formatLedgerAddress(parts: LedgerAddressParts): LedgerAddress;
5281
5349
 
5282
5350
  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, 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, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxEgressCredentialRules, normalizeSandboxEgressPolicy, normalizeSandboxLabels, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, runLabels, sandboxControls, sandboxEgressDecision, sandboxEgressHostMatches, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, 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 };
5283
- 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, 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, 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, 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, SandboxEgressCredentialRule, SandboxEgressPolicy, SandboxEgressRule, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxLabels, 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, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, SharePrice, ShareRequest, ShareReviewDecision, 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, 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 };
5351
+ 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, 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, 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, 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, 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, SandboxEgressCredentialRule, SandboxEgressPolicy, SandboxEgressRule, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxLabels, 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, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, ShareHistory, SharePrice, ShareRequest, ShareReviewDecision, Skill, SkillDescription, SkillLibrary, SkillSource, 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
@@ -2307,7 +2307,7 @@ async function evaluatePolicyDefinition(definition, input) {
2307
2307
 
2308
2308
  // packages/sdk/src/data-sharing.ts
2309
2309
  var ACTIONS = ["read", "evaluate", "contribute"];
2310
- var TERMS = /* @__PURE__ */ new Set(["displayName", "selector", "actions", "prices", "evaluation", "expiresAt"]);
2310
+ var TERMS = /* @__PURE__ */ new Set(["displayName", "selector", "actions", "prices", "evaluation", "history", "expiresAt"]);
2311
2311
  var EVALUATION = ["namespace", "agent", "dataset", "scorers", "concurrency", "budgetMicroUsd"];
2312
2312
  function record5(value) {
2313
2313
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
@@ -2381,6 +2381,13 @@ function shareRequest(value) {
2381
2381
  }
2382
2382
  if (Object.hasOwn(source, "prices")) terms.prices = sharePrices(source.prices);
2383
2383
  if (Object.hasOwn(source, "evaluation")) terms.evaluation = source.evaluation === null ? null : shareEvaluation(source.evaluation);
2384
+ if (Object.hasOwn(source, "history")) {
2385
+ const history = record5(source.history);
2386
+ if (source.history !== null && (!history || Object.keys(history).some((key) => key !== "since") || !Number.isSafeInteger(history.since) || history.since <= 0)) {
2387
+ throw new TypeError("Share history must be null or { since: a time in milliseconds }");
2388
+ }
2389
+ terms.history = history ? { since: history.since } : null;
2390
+ }
2384
2391
  if (Object.hasOwn(source, "expiresAt")) {
2385
2392
  if (source.expiresAt !== null && (!Number.isSafeInteger(source.expiresAt) || source.expiresAt <= 0)) {
2386
2393
  throw new TypeError("Share expiresAt must be null or a time in milliseconds");
@@ -3090,7 +3097,7 @@ ${message2.content}`;
3090
3097
  }
3091
3098
  return merged;
3092
3099
  }
3093
- function openAiMessage(message2, options) {
3100
+ function openAiMessage(message2, options = {}) {
3094
3101
  if (message2.role === "tool") return {
3095
3102
  role: "tool",
3096
3103
  tool_call_id: message2.toolCallId,