runbios-sdk 0.2.1-rc.138 → 0.2.1-rc.143

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/dist/index.d.ts CHANGED
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export declare const VERSION = "0.2.1-rc.138";
39
+ export declare const VERSION = "0.2.1-rc.143";
40
40
  export declare class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  readonly models: Models;
@@ -75,4 +75,6 @@ export { Training } from './resources/training.js';
75
75
  export { Wallet } from './resources/wallet.js';
76
76
  export { GPU, type GPURecommendation } from './resources/gpu.js';
77
77
  export { Inference, validateChatRequest, parseSSE, buildInferenceRequest, contextSizingBasis, type ContextSizingBasis, CONTEXT_DEFAULT_CEILING, CONTEXT_EDITABLE_FLOOR, type ChatMessage, type FunctionTool, type ChatCompletionParams, type ChatCompletionResponse, type ChatCompletionChunk, } from './resources/inference.js';
78
- export type { BiOSConfig, PaginatedResponse, ApiErrorBody, AvailableGpuAlternative, CapacityMinimumRequirement, InferenceBookingAccepted, Model, ModelSearchParams, ModelSearchResponse, ModelDetailResponse, ModelConfig, Dataset, DatasetListParams, DatasetListResponse, DatasetUploadParams, DatasetPreview, DatasetPreviewParams, DatasetImportHFParams, DatasetRegisterHFParams, DatasetHubSearchParams, DatasetHubPreviewParams, DatasetValidation, DatasetFormatVariant, DatasetFormatSpec, DatasetFormatSpecs, DatasetStorageUsage, TrainingMethod, RLHFAlgorithm, AdapterType, TrainingJobStatus, TrainingStatusFilter, TrainingCreateParams, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, TrainingResourceMetrics, TrainingDeviceMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, GPUChoice, WalletBalance, Transaction, TransactionListResponse, TransactionListParams, GPUInfo, GPUPricingResponse, GPUOptionsParams, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingAdvisorRecommendation, TrainingAdvisorUserShape, TrainingAdvisorJustification, TrainingAdvisorBasis, GPUOption, GPUOptionSuggestion, GPUOptionsResponse, InferenceStatus, InferenceCreateParams, InferenceUpdateParams, InferenceDeployment, InferenceDeploymentSummary, InferenceCreateResponse, InferenceListResponse, InferenceUpdateResponse, InferenceLifecycleResponse, InferenceDeleteResponse, InferenceGPUOptionMarket, InferenceGPUOption, InferenceGPUAlternative, InferenceGPUOptionsParams, InferenceGPUOptionsResponse, InferenceCanonicalRequest, InferencePreflightWarning, InferencePreflightResponse, AdapterCompatibility, AdapterCompatibilityResponse, AdapterCompatibilityParams, SupportedArchitecture, ArchitectureScope, SupportedArchitecturesResponse, ApiKey, ApiKeyScope, ApiKeyIntrospection, Organization, OrgMember, OrgInvite, Workspace, Integration, IntegrationCreateParams, StorageUsage, StorageObject, PromptTokensDetails, ChatCompletionUsage, } from './types.js';
78
+ export type { BiOSConfig, PaginatedResponse, ApiErrorBody, AvailableGpuAlternative, CapacityMinimumRequirement, InferenceBookingAccepted, Model, ModelSearchParams, ModelSearchResponse, ModelDetailResponse, ModelConfig, Dataset, DatasetListParams, DatasetListResponse, DatasetUploadParams, DatasetPreview, DatasetPreviewParams, DatasetImportHFParams, DatasetRegisterHFParams, DatasetHubSearchParams, DatasetHubPreviewParams, DatasetValidation, DatasetFormatVariant, DatasetFormatSpec, DatasetFormatSpecs, DatasetStorageUsage, TrainingMethod, RLHFAlgorithm, AdapterType, TrainingJobStatus, TrainingStatusFilter, TrainingCreateParams, TrainingListParams, TrainingListResponse, TrainingJob, TrainingMetrics, TrainingResourceMetrics, TrainingDeviceMetrics, MetricPoint, MetricGraphConfig, TrainingCheckpoint, TrainingLogs, TrainingLogEntry, TrainingStopResponse, TrainingResumeResponse, CanonicalTrainingRequest, TrainingPreflightDataset, TrainingPreflightWarning, TrainingPreflightResponse, TrainingCapabilityChoice, TrainingConfigFieldCapability, TrainingCapabilities, GPUChoice, WalletBalance, Transaction, TransactionListResponse, TransactionListParams, GPUInfo, GPUPricingResponse, GPUOptionsParams, TrainingRecommendParams, TrainingAdvisorVerdict, TrainingAdvisorRecommendation, TrainingAdvisorUserShape, TrainingAdvisorJustification, TrainingAdvisorBasis, GPUOption, GPUOptionSuggestion, GPUOptionsResponse, InferenceStatus, InferenceCreateParams, InferenceUpdateParams, InferenceDeployment, InferenceDeploymentSummary, InferenceCreateResponse, InferenceListResponse, InferenceUpdateResponse, InferenceLifecycleResponse, InferenceDeleteResponse, InferenceGPUOptionMarket, InferenceGPUOption, InferenceGPUAlternative, InferenceGPUOptionsParams, InferenceGPUOptionsResponse, InferenceCanonicalRequest, InferencePreflightWarning, InferencePreflightResponse, AdapterCompatibility, AdapterCompatibilityResponse, AdapterCompatibilityParams, SupportedArchitecture, ArchitectureScope, SupportedArchitecturesResponse, ApiKey, ApiKeyScope, ApiKeyIntrospection, Organization, OrgMember, OrgInvite, Workspace, Integration, IntegrationCreateParams, StorageUsage, StorageObject, PromptTokensDetails, ChatCompletionUsage, TrainingCadence, TrainingCombinator, ServingKind, TrainingRulePausedReason, LoopTrainingMethod, TrainType, GradersScope, TrainingTrigger, TrainingRunState, TrainingVerdict, TrainingDecision, NotifyState, EvaluationStatus, EvaluationItemStatus, EvaluationWinner, EvaluationWarningCode, ConsentVia, TrainingToolCall, TrainingMessage, TrainingRuleServing, TrainingGPURung, TrainingRule, TrainingRuleConsent, TrainingRulePreflightRefusal, TrainingRuleKeyRef, TrainingRuleKeyCheck, TrainingRulePreflight, TrainingRuleBuildSpec, TrainingRuleTriggerInput, TrainingRuleTrainingInput, TrainingRuleDeployInput, TrainingRuleMoneyInput, TrainingRuleEvaluationInput, TrainingRulePromotionInput, TrainingRuleAcceptTerms, TrainingRulePreflightRequest, TrainingRuleCreateRequest, TrainingRuleUpdateRequest, TrainingRuleConsentRequest, TrainingRuleListParams, TrainingRunPromoteRequest, TrainingRunRejectRequest, TrainingRunRollbackRequest, TrainingRunCancelRequest, TrainingRunListParams, TrainingRun, TrainingRunSummary, TrainingRunEvent, TrainingRunLinks, TrainingRunActions, EvaluationRef, EvaluationDecoding, EvaluationJudgeDimension, EvaluationDimensionScore, EvaluationGraderScore, EvaluationWarning, EvaluationMargin, JudgeAgreementDimension, JudgeAgreement, Evaluation, EvaluationItemSide, EvaluationItem, EvaluationItemListParams, JudgeAgreementParams, AgentSettings, AgentSettingsRequest, InferenceAlias, InferenceAliasRequest, TrainingRuleListResponse, TrainingRuleResponse, TrainingRuleMutationResponse, TrainingRuleDeleteResponse, TrainingRunListResponse, TrainingRunResponse, TrainingRunActionResponse, EvaluationItemsResponse, AgentSettingsResponse, InferenceAliasListResponse, InferenceAliasResponse, InferenceAliasDeleteResponse, } from './types.js';
79
+ /** The closed set of run states a training run never leaves. */
80
+ export { TERMINAL_RUN_STATES } from './types.js';
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export const VERSION = '0.2.1-rc.138';
39
+ export const VERSION = '0.2.1-rc.143';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  models;
@@ -103,3 +103,5 @@ export { Training } from './resources/training.js';
103
103
  export { Wallet } from './resources/wallet.js';
104
104
  export { GPU } from './resources/gpu.js';
105
105
  export { Inference, validateChatRequest, parseSSE, buildInferenceRequest, contextSizingBasis, CONTEXT_DEFAULT_CEILING, CONTEXT_EDITABLE_FLOOR, } from './resources/inference.js';
106
+ /** The closed set of run states a training run never leaves. */
107
+ export { TERMINAL_RUN_STATES } from './types.js';
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { InferenceDeployment, InferenceDeploymentSummary, InferenceBookingAccepted, InferenceCreateParams, InferenceCreateResponse, InferenceDeleteResponse, InferenceGPUOptionsParams, InferenceGPUOptionsResponse, InferenceLifecycleResponse, InferenceListParams, InferenceListResponse, InferenceNotificationListResponse, InferencePreflightResponse, InferenceUpdateResponse, InferenceUpdateParams } from '../types.js';
2
+ import type { InferenceDeployment, InferenceDeploymentSummary, InferenceBookingAccepted, InferenceCreateParams, InferenceCreateResponse, InferenceDeleteResponse, InferenceGPUOptionsParams, InferenceGPUOptionsResponse, InferenceLifecycleResponse, InferenceListParams, InferenceListResponse, InferenceNotificationListResponse, InferencePreflightResponse, InferenceUpdateResponse, InferenceUpdateParams, InferenceAlias, InferenceAliasRequest, InferenceAliasDeleteResponse } from '../types.js';
3
3
  /**
4
4
  * Serving context-length policy, owned and enforced by the server. Mirrored
5
5
  * here for documentation only -- never to pre-empt a server verdict.
@@ -213,6 +213,31 @@ export declare class Inference {
213
213
  restart(id: string): Promise<InferenceLifecycleResponse>;
214
214
  update(id: string, params: InferenceUpdateParams): Promise<InferenceUpdateResponse>;
215
215
  delete(id: string): Promise<InferenceDeleteResponse>;
216
+ /**
217
+ * Point a name at a deployment, creating the alias or moving an existing one.
218
+ *
219
+ * THIS CHANGES WHAT ANSWERS YOUR TRAFFIC the moment it returns. The reply
220
+ * carries `previous_target_inference_id`, which is what to put back if the
221
+ * new target turns out to be wrong.
222
+ *
223
+ * `origin` records why the handle moved -- a run id, a person, a script --
224
+ * and is worth setting: an alias that changed with no reason recorded is an
225
+ * incident nobody can reconstruct.
226
+ *
227
+ * Refused when the name already belongs to a live deployment
228
+ * (`ALIAS_NAME_IS_A_DEPLOYMENT`), when the target is not running, degraded or
229
+ * provisioning (`TARGET_NOT_SERVABLE`), and with `404` when the target is not
230
+ * in this workspace.
231
+ */
232
+ setAlias(name: string, params: InferenceAliasRequest): Promise<InferenceAlias>;
233
+ /** Every alias in the workspace, with what each one points at today. */
234
+ listAliases(): Promise<InferenceAlias[]>;
235
+ /**
236
+ * Remove an alias. The name goes back to the deployment that owns it, if one
237
+ * does; callers still using the alias stop resolving, so move it rather than
238
+ * delete it when something is still calling it.
239
+ */
240
+ deleteAlias(name: string): Promise<InferenceAliasDeleteResponse>;
216
241
  /**
217
242
  * Model-fit GPU choices joined to the authoritative deployment market
218
243
  * snapshot. MODEL-ADDRESSED (recommended, book-first §2): pass `model` (or
@@ -629,6 +629,51 @@ export class Inference {
629
629
  delete(id) {
630
630
  return this.http.fetchDelete(`/api/inference/${encodeURIComponent(id)}`);
631
631
  }
632
+ // --------------------------------------------------------------------------
633
+ // Aliases -- re-pointable public handles
634
+ // --------------------------------------------------------------------------
635
+ //
636
+ // An alias is a name your callers use that you can move to a different
637
+ // deployment without them changing anything. It is what the automatic
638
+ // training loop re-points when it promotes a candidate, and it is what makes
639
+ // a rollback one row write rather than a redeployment.
640
+ //
641
+ // Reads carry `deployments:read` and writes `deployments:write`: an alias
642
+ // decides which model answers a customer's traffic, so it is fenced like the
643
+ // deployment it points at rather than like a label.
644
+ /**
645
+ * Point a name at a deployment, creating the alias or moving an existing one.
646
+ *
647
+ * THIS CHANGES WHAT ANSWERS YOUR TRAFFIC the moment it returns. The reply
648
+ * carries `previous_target_inference_id`, which is what to put back if the
649
+ * new target turns out to be wrong.
650
+ *
651
+ * `origin` records why the handle moved -- a run id, a person, a script --
652
+ * and is worth setting: an alias that changed with no reason recorded is an
653
+ * incident nobody can reconstruct.
654
+ *
655
+ * Refused when the name already belongs to a live deployment
656
+ * (`ALIAS_NAME_IS_A_DEPLOYMENT`), when the target is not running, degraded or
657
+ * provisioning (`TARGET_NOT_SERVABLE`), and with `404` when the target is not
658
+ * in this workspace.
659
+ */
660
+ async setAlias(name, params) {
661
+ const res = await this.http.fetchPut(`/api/inference/aliases/${encodeURIComponent(name)}`, params);
662
+ return res.alias;
663
+ }
664
+ /** Every alias in the workspace, with what each one points at today. */
665
+ async listAliases() {
666
+ const res = await this.http.fetchGet('/api/inference/aliases');
667
+ return res.aliases || [];
668
+ }
669
+ /**
670
+ * Remove an alias. The name goes back to the deployment that owns it, if one
671
+ * does; callers still using the alias stop resolving, so move it rather than
672
+ * delete it when something is still calling it.
673
+ */
674
+ async deleteAlias(name) {
675
+ return this.http.fetchDelete(`/api/inference/aliases/${encodeURIComponent(name)}`);
676
+ }
632
677
  /**
633
678
  * Model-fit GPU choices joined to the authoritative deployment market
634
679
  * snapshot. MODEL-ADDRESSED (recommended, book-first §2): pass `model` (or
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopBuildRule, LoopBuildRuleParams, LoopStats, LoopJudge, LoopJudgeParams, LoopAgentCredential, LoopAgentStatus, LoopSampleRun, LoopSampleRunParams, LoopJudgeRun, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult } from '../types.js';
2
+ import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopBuildRule, LoopBuildRuleParams, LoopBuildRuleUpdateParams, LoopStats, LoopJudge, LoopJudgeParams, LoopAgentCredential, LoopAgentStatus, LoopSampleRun, LoopSampleRunParams, LoopJudgeRun, LoopJudgeRunItems, LoopJudgeRunItemStatus, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult, TrainingRule, TrainingRulePreflight, TrainingRulePreflightRequest, TrainingRuleCreateRequest, TrainingRuleUpdateRequest, TrainingRuleConsentRequest, TrainingRuleListParams, TrainingRuleListResponse, TrainingRuleResponse, TrainingRuleMutationResponse, TrainingRuleDeleteResponse, TrainingRun, TrainingRunListParams, TrainingRunListResponse, TrainingRunResponse, TrainingRunActionResponse, TrainingRunPromoteRequest, TrainingRunRejectRequest, TrainingRunRollbackRequest, TrainingRunCancelRequest, Evaluation, EvaluationItemListParams, EvaluationItemsResponse, JudgeAgreement, JudgeAgreementParams, AgentSettings, AgentSettingsRequest } from '../types.js';
3
3
  /**
4
4
  * The Conscious Loop -- capture what your model was asked and answered, record
5
5
  * whether it was right, and turn those judgements into training data.
@@ -398,6 +398,25 @@ export declare class Loop {
398
398
  * nothing: ask again and the same items come back.
399
399
  */
400
400
  takeWork(runId: string, limit?: number): Promise<LoopJudgeWork>;
401
+ /**
402
+ * What happened to each conversation in a run, and why.
403
+ *
404
+ * `takeWork` hands out what is still PENDING, so a finished run answers it
405
+ * with an empty list. This answers with every item and the outcome on it:
406
+ * `status`, `scored_at`, and `error` — the reason the caller gave for an
407
+ * item it could not score, which is where a wrong model slug or a refused
408
+ * key actually shows up. A run that ends "scored 0, failed 3" is otherwise a
409
+ * number with no detail behind it.
410
+ *
411
+ * Pass `status: 'failed'` for the usual question. At most 500 items come
412
+ * back at a time; when `has_more` is true, call again with the `next_offset`
413
+ * from the reply.
414
+ */
415
+ listRunItems(runId: string, opts?: {
416
+ status?: LoopJudgeRunItemStatus;
417
+ limit?: number;
418
+ offset?: number;
419
+ }): Promise<LoopJudgeRunItems>;
401
420
  /**
402
421
  * Hand the scores back. A verdict for a conversation outside this run, or
403
422
  * scoring something the rubric never asked for, is refused and reported in
@@ -420,6 +439,12 @@ export declare class Loop {
420
439
  * automatic judges and sample runs make model calls billed to the
421
440
  * workspace. Idempotent.
422
441
  *
442
+ * A judge whose model the serving gateway will not route is NOT resumed:
443
+ * making it automatic would buy a run that fails every conversation. It
444
+ * stays paused, `judges_still_paused` counts those, and each one carries
445
+ * `auto_pause_reason` saying so. Point it at a model that is served and
446
+ * turn the agent on again.
447
+ *
423
448
  * `monthly_spend_cap_cents` caps what that key may spend on model calls in
424
449
  * a calendar month. Omitted = no cap on a fresh key, and an existing cap is
425
450
  * left as it is; sent while the agent is already on, it moves the cap on
@@ -457,4 +482,199 @@ export declare class Loop {
457
482
  createSampleRun(params: LoopSampleRunParams): Promise<LoopSampleRun>;
458
483
  listSampleRuns(): Promise<LoopSampleRun[]>;
459
484
  getSampleRun(runId: string): Promise<LoopSampleRun>;
485
+ /**
486
+ * Price a training rule before anyone agrees to it. Writes nothing.
487
+ *
488
+ * Takes the create body without `accept_terms` and answers with the estimate
489
+ * a member has to see first: the pinned model revision, the worst hourly
490
+ * price each GPU ladder can reach, how many hours each ceiling buys, any
491
+ * refusals that would stop a create, the API keys that cannot follow a
492
+ * cutover because they lack `deployments:read`, and `terms_text` -- the
493
+ * exact sentence to show, with real figures in it.
494
+ *
495
+ * Send the `terms_version` it returns back in `createTrainingRule`. Read the
496
+ * figures out of this response rather than inventing ceilings of your own.
497
+ */
498
+ preflightTrainingRule(params: TrainingRulePreflightRequest): Promise<TrainingRulePreflight>;
499
+ /**
500
+ * Create a training rule and record the consent that pays for it.
501
+ *
502
+ * ACCEPTING THE TERMS AUTHORISES SPENDING FROM YOUR WALLET WHILE YOU ARE NOT
503
+ * PRESENT. From here on the platform may, on its own schedule and without
504
+ * asking again, build a training set, run a training job on rented GPUs,
505
+ * book a second deployment to compare against the one serving your traffic,
506
+ * and pay for the model calls that judge the two. Those charges come out of
507
+ * the wallet of the member whose credentials make this call, up to the
508
+ * ceilings in `money`, and they keep recurring for as long as the rule is
509
+ * enabled. If `promotion.auto_promote` is set, the platform will also
510
+ * re-point your public handle at the new model with nobody reviewing it.
511
+ *
512
+ * `accept_terms` is therefore required, and this method refuses to send the
513
+ * request without it rather than letting the server decide. Call
514
+ * {@link preflightTrainingRule} first, show the person whose wallet pays the
515
+ * `terms_text` and the figures it returns, get an explicit yes, and send the
516
+ * `terms_version` they were shown. Do not invent ceilings or price caps on
517
+ * their behalf.
518
+ *
519
+ * @example
520
+ * ```ts
521
+ * const estimate = await client.loop.preflightTrainingRule(draft);
522
+ * // show estimate.terms_text and the ceilings to the member, get a yes
523
+ * const rule = await client.loop.createTrainingRule({
524
+ * ...draft,
525
+ * accept_terms: { terms_version: estimate.terms_version },
526
+ * });
527
+ * ```
528
+ */
529
+ createTrainingRule(params: TrainingRuleCreateRequest): Promise<TrainingRule>;
530
+ /**
531
+ * Every training rule in the workspace, with what each one last did and why.
532
+ *
533
+ * `last_reason` and `paused_reason` are the fields worth reading: a rule
534
+ * quiet because it is waiting looks exactly like one quiet because its
535
+ * consent went stale.
536
+ */
537
+ listTrainingRules(params?: TrainingRuleListParams): Promise<TrainingRuleListResponse>;
538
+ /**
539
+ * Read one rule with its recent runs, what it has spent this month, and how
540
+ * far its judge agrees with your own reviewers.
541
+ *
542
+ * Returned whole rather than unwrapped to the rule: `month_spent_cents` is
543
+ * the number that says whether the monthly ceiling is about to stop it.
544
+ */
545
+ getTrainingRule(id: string): Promise<TrainingRuleResponse>;
546
+ /**
547
+ * Edit or pause a rule. Absent means unchanged; a null clears the fields
548
+ * that can be cleared.
549
+ *
550
+ * A money-bearing change -- a ceiling, a model, a GPU ladder, the promotion
551
+ * policy -- bumps `revision`, clears the recorded consent and STOPS the rule
552
+ * firing until someone accepts the new amounts. The reply says so in
553
+ * `consent_required`, and carries a fresh `preflight` with the new figures.
554
+ * Pass `expected_revision` to be refused with `REVISION_MISMATCH` rather
555
+ * than overwrite an edit somebody else made in the meantime.
556
+ */
557
+ updateTrainingRule(id: string, params: TrainingRuleUpdateRequest): Promise<TrainingRuleMutationResponse>;
558
+ /**
559
+ * Accept the rule's current terms, so it may fire again.
560
+ *
561
+ * ACCEPTING THE TERMS AUTHORISES SPENDING FROM YOUR WALLET WHILE YOU ARE NOT
562
+ * PRESENT, on the amounts as they stand right now. This is the same
563
+ * authorisation {@link createTrainingRule} records, given again because a
564
+ * money-bearing edit cleared the old one: training, a candidate deployment
565
+ * and the judge's model calls are charged to the wallet of the member making
566
+ * this call, up to the rule's ceilings, every time it fires.
567
+ *
568
+ * Show the member the current `terms_text` from a fresh
569
+ * {@link preflightTrainingRule} or from the `preflight` on the update reply,
570
+ * and send the `revision` those figures belong to. A stale revision is
571
+ * refused with `409`, which is the point: it means the amounts moved again
572
+ * after they were read.
573
+ */
574
+ consentTrainingRule(id: string, params: TrainingRuleConsentRequest): Promise<TrainingRule>;
575
+ /**
576
+ * Fire a rule now, without waiting for its cadence.
577
+ *
578
+ * Bypasses the schedule and `min_new_rows` only. The row floors, the money
579
+ * ceilings and the consent all still apply, so this can answer `409
580
+ * CONSENT_REQUIRED` or `422 NOT_ENOUGH_ROWS` with the counts it needed.
581
+ */
582
+ runTrainingRule(id: string): Promise<TrainingRun>;
583
+ /**
584
+ * Delete a rule. An active run is cancelled; runs that already finished, and
585
+ * anything already promoted, are kept.
586
+ */
587
+ deleteTrainingRule(id: string): Promise<TrainingRuleDeleteResponse>;
588
+ /**
589
+ * Edit or pause a build rule -- the standing instruction that assembles the
590
+ * training set a training rule then trains on.
591
+ *
592
+ * Changing `spec.deployment_id` while an enabled training rule owns this
593
+ * build rule is refused with `409`: it would silently retrain the next model
594
+ * on a different source's conversations.
595
+ */
596
+ updateBuildRule(id: string, params: LoopBuildRuleUpdateParams): Promise<LoopBuildRule>;
597
+ /** Firings, newest first. Filter by rule or by the state they are sitting in. */
598
+ listTrainingRuns(params?: TrainingRunListParams): Promise<TrainingRunListResponse>;
599
+ /**
600
+ * One run with its timeline, the addresses of everything it created, and
601
+ * what you may do with it right now.
602
+ *
603
+ * `timeline` is written in the same transaction as each state change, so it
604
+ * is the record of what actually happened rather than a reconstruction.
605
+ * `available_actions` is the honest answer to "can I promote this": a button
606
+ * that cannot work should never be offered.
607
+ */
608
+ getTrainingRun(id: string): Promise<TrainingRunResponse>;
609
+ /**
610
+ * Promote the candidate by hand: re-point the public handle at the new model.
611
+ *
612
+ * This changes what answers your customers. Pass `expected_revision` to be
613
+ * refused rather than promote against a consent that moved underneath the
614
+ * decision, and `force` only to promote a comparison the evaluation called
615
+ * inconclusive -- without it that case is refused with
616
+ * `INCONCLUSIVE_REQUIRES_FORCE`.
617
+ */
618
+ promoteTrainingRun(id: string, params?: TrainingRunPromoteRequest): Promise<TrainingRunActionResponse>;
619
+ /** Retire the candidate. What serves your traffic does not change. */
620
+ rejectTrainingRun(id: string, params?: TrainingRunRejectRequest): Promise<TrainingRunActionResponse>;
621
+ /**
622
+ * Undo a promotion, inside the rollback window the run reports in
623
+ * `rollback_available_until` (30 days).
624
+ *
625
+ * The reply carries `serving`: this is the one action besides promotion that
626
+ * changes what answers your traffic, so what it was put back to is returned
627
+ * rather than left to be looked up.
628
+ */
629
+ rollbackTrainingRun(id: string, params?: TrainingRunRollbackRequest): Promise<TrainingRunActionResponse>;
630
+ /**
631
+ * Stop a run that is still moving. Work already paid for is still billed --
632
+ * cancelling a training job does not refund the hours it burned.
633
+ */
634
+ cancelTrainingRun(id: string, params?: TrainingRunCancelRequest): Promise<TrainingRunActionResponse>;
635
+ /**
636
+ * The comparison behind a verdict: both models on the same held-out rows,
637
+ * with identical decoding, judge and grader names resolved.
638
+ *
639
+ * Read `warnings` before you read `win_rate`. A win rate over a holdout too
640
+ * small to mean anything, or one measured by a judge that disagrees with
641
+ * your own reviewers, is reported with the warning that says so rather than
642
+ * withheld. `margin_used` is the thresholds this verdict was measured
643
+ * against, frozen with the report, so a later policy change cannot rewrite
644
+ * what a past decision meant.
645
+ */
646
+ getEvaluation(id: string): Promise<Evaluation>;
647
+ /**
648
+ * The paired conversations behind the numbers: one prompt, both answers, the
649
+ * scores each earned, and which won.
650
+ *
651
+ * Filter by `winner` to read the losses first, which is where a verdict is
652
+ * actually checked. `limit` is capped at 100 by the service.
653
+ */
654
+ listEvaluationItems(id: string, params?: EvaluationItemListParams): Promise<EvaluationItemsResponse>;
655
+ /**
656
+ * How far a judge agrees with your own reviewers, over the conversations
657
+ * both have scored.
658
+ *
659
+ * This is a gate, not a badge: a rule's `min_judge_agreement` refuses to
660
+ * promote on the word of a judge that does not agree with the people whose
661
+ * product it is. `enough_pairs` is the field to read first -- "not enough
662
+ * reviewer overlap yet" is an answer, and 100% of two pairs is not.
663
+ */
664
+ getJudgeAgreement(judgeId: string, params?: JudgeAgreementParams): Promise<JudgeAgreement>;
665
+ /**
666
+ * The workspace's agent options: which model it defaults to, the system
667
+ * prompts it judges and samples with, and the monthly cap on what its model
668
+ * calls may spend.
669
+ */
670
+ getAgentSettings(): Promise<AgentSettings>;
671
+ /**
672
+ * Change them. An absent key leaves that setting exactly where it is; a
673
+ * present null returns it to the platform default. Those are three
674
+ * instructions, not two, so `{}` changes nothing.
675
+ *
676
+ * `eval_monthly_cap_cents` is pushed to the workspace's managed key, so it
677
+ * caps what the agent can spend even if a rule's own ceilings are higher.
678
+ */
679
+ updateAgentSettings(params: AgentSettingsRequest): Promise<AgentSettings>;
460
680
  }