daishi-sdk 0.2.3 → 0.2.4

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.
@@ -5,7 +5,7 @@ export type JsonObject = {
5
5
  /** The API version these types describe. */
6
6
  export declare const API_VERSION = "1.0.0";
7
7
  /** Every error code the API documents. */
8
- export type ErrorCode = 'token_required' | 'scope_required' | 'plan_api' | 'rate_limited' | 'bad_request' | 'bad_scenario' | 'bad_replicates' | 'profile_required' | 'bad_season_ticks' | 'bad_frame' | 'bad_env' | 'too_many_scenarios' | 'unknown_scenario' | 'bad_skill' | 'too_many_skills' | 'unknown_skill' | 'bad_roster' | 'bad_model' | 'bad_name' | 'bad_provider' | 'provider_key_required' | 'openrouter_key_required' | 'openrouter_balance_low' | 'billing_frozen' | 'email_unverified' | 'bad_trials' | 'bad_spend_cap' | 'plan_seats' | 'plan_ticks' | 'plan_series' | 'plan_quota' | 'too_many_runs' | 'run_history_full' | 'seed_not_allowed' | 'unknown_run' | 'unknown_batch' | 'unknown_experiment' | 'experiment_trial' | 'experiment_not_running' | 'experiment_arms' | 'bad_experiment' | 'experiment_scenario' | 'experiment_world_only' | 'experiment_env_seed' | 'experiment_stopping' | 'bad_metric' | 'experiment_effort_roster' | 'plan_experiment_arms' | 'unknown_log' | 'plan_invites' | 'invite_world' | 'invite_series' | 'too_many_open_worlds' | 'no_invite' | 'invite_fixed' | 'bad_invite' | 'never_played' | 'run_playing' | 'bad_note' | 'note_too_long' | 'run_launching' | 'internal_error';
8
+ export type ErrorCode = 'token_required' | 'scope_required' | 'plan_api' | 'rate_limited' | 'bad_request' | 'bad_scenario' | 'bad_replicates' | 'profile_required' | 'bad_season_ticks' | 'bad_frame' | 'bad_env' | 'too_many_scenarios' | 'unknown_scenario' | 'bad_skill' | 'too_many_skills' | 'unknown_skill' | 'bad_roster' | 'bad_model' | 'bad_name' | 'bad_provider' | 'provider_key_required' | 'openrouter_key_required' | 'openrouter_balance_low' | 'billing_frozen' | 'email_unverified' | 'bad_trials' | 'bad_spend_cap' | 'plan_seats' | 'plan_ticks' | 'plan_series' | 'plan_quota' | 'too_many_runs' | 'run_history_full' | 'seed_not_allowed' | 'unknown_run' | 'unknown_batch' | 'unknown_experiment' | 'experiment_trial' | 'experiment_not_running' | 'experiment_arms' | 'bad_experiment' | 'experiment_scenario' | 'experiment_world_only' | 'experiment_env_seed' | 'experiment_stopping' | 'bad_metric' | 'experiment_effort_roster' | 'plan_experiment_arms' | 'plan_rerun' | 'unknown_log' | 'plan_invites' | 'invite_world' | 'invite_series' | 'too_many_open_worlds' | 'no_invite' | 'invite_fixed' | 'bad_invite' | 'never_played' | 'run_playing' | 'bad_note' | 'note_too_long' | 'run_launching' | 'internal_error';
9
9
  export type Method = 'GET' | 'POST' | 'PUT' | 'DELETE';
10
10
  export interface RequestParts {
11
11
  query?: Record<string, string | number | boolean | undefined | null>;
@@ -133,6 +133,7 @@ export interface Experiment {
133
133
  ended_at_ms: number | null;
134
134
  verdict: string | null;
135
135
  callback_url: string | null;
136
+ replicates: StudyRerun | null;
136
137
  }
137
138
  /** A paired experiment scored now: each arm, every pair, the comparisons against the control, and the decision. */
138
139
  export interface ExperimentReport {
@@ -216,10 +217,10 @@ export interface RosterSeat {
216
217
  instructions?: string;
217
218
  }
218
219
  export interface ExperimentBody {
219
- /** The arms, the first the control. Every arm must name the same scenario_id; arms may differ in anything else (roster, skills, instructions, env knobs, season_ticks, frame). No arm may set env.seed or env.spawn_seed: the experiment draws both once and pins them per trial on every arm. World runs only. */
220
- arms: ExperimentArm[];
221
- /** Paired trials per arm: 3 up to the plan’s series ceiling (the comparison renders no verdict on fewer than 3 pairs). Trial i of every arm plays the same world and the same layout. */
222
- trials: number;
220
+ /** Required unless replicates is set. The arms, the first the control. Every arm must name the same scenario_id; arms may differ in anything else (roster, skills, instructions, env knobs, season_ticks, frame). No arm may set env.seed or env.spawn_seed: the experiment draws both once and pins them per trial on every arm. World runs only. */
221
+ arms?: ExperimentArm[];
222
+ /** Required unless replicates is set. Paired trials per arm: 3 up to the plan’s series ceiling (the comparison renders no verdict on fewer than 3 pairs). Trial i of every arm plays the same world and the same layout. */
223
+ trials?: number;
223
224
  /** Experiment name, kept on one line like a run name. Default: the scenario and the arm count. Each trial is named <experiment> · <arm>. */
224
225
  name?: string;
225
226
  /** vary (default): each trial its own world; pinned: one world for every trial, only the layout varies. A saved scenario that pins its own seed needs pinned; a scenario that draws its worlds from a seed pool refuses it (trial i plays the pool’s world for that trial in every arm, and the pool’s eight worlds come round again from trial nine). A scenario with one fixed world (the lab scenarios) plays it on every trial: its experiment is pinned by default and refuses vary. */
@@ -234,6 +235,10 @@ export interface ExperimentBody {
234
235
  target_half_width?: number;
235
236
  /** Where to POST the signed experiment.ended notice: https, a public host, no credentials, at most 512 characters. Omitted: the account’s webhook setting, if any. */
236
237
  callback_url?: string;
238
+ /** Re-run a published study: its experiment id (exp_..., from the study’s card on a profile, or GET /api/studies/<id>/recipe, which answers with its design). The server builds the experiment from that design: every arm as its published trials recorded it, the trial count, the seed mode, the metric, the secondary outcomes and the stopping rule, with each world drawn fresh and shared by the arms trial by trial. The body therefore carries none of the design, only name, max_spend_usd and callback_url; a design field beside replicates answers bad_replicates. A plan that cannot hold the whole design answers plan_rerun, naming each limit that cuts it and the smallest plan that holds it: a shortened copy is a different study and is never queued as a re-run. Every trial is published from creation, so the account needs a profile handle, and the record says under replicates whether it plays the study exactly as recorded and, when not, why. Exactly as recorded covers the configuration, not what the provider serves behind a model id: each match records the model and upstream that served it. */
239
+ replicates?: string;
240
+ /** With replicates only: the spend cap of each arm in USD, clamped to the plan’s range (default the plan’s own). The original’s caps were its owner’s and are not carried. An ordinary experiment sets a cap on each arm instead. */
241
+ max_spend_usd?: number;
237
242
  }
238
243
  export interface ExperimentArm {
239
244
  /** How the report names this arm. Default arm 1, arm 2, ...; labels must be distinct. */
@@ -497,6 +502,14 @@ export interface ExperimentArmView {
497
502
  label: string;
498
503
  batch_id: string;
499
504
  }
505
+ export interface StudyRerun {
506
+ experiment_id: string;
507
+ name: string;
508
+ handle: string | null;
509
+ own: boolean;
510
+ exact: boolean;
511
+ differences: string[];
512
+ }
500
513
  export interface ExperimentReportArm {
501
514
  index: number;
502
515
  label: string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Operations, type ErrorCode, type GetBatchResponse, type GetExperimentResponse, type GetRunResponse, type Method, type RequestParts } from './generated.js';
2
2
  export * from './generated.js';
3
- export declare const VERSION = "0.2.3";
3
+ export declare const VERSION = "0.2.4";
4
4
  export declare const DEFAULT_BASE_URL = "https://daishi.ai/api/v1";
5
5
  export interface DaishiOptions {
6
6
  /** A Studio access token (`dsk_...`). Default: the `DAISHI_TOKEN` environment variable. */
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Operations } from './generated.js';
2
2
  export * from './generated.js';
3
- export const VERSION = '0.2.3';
3
+ export const VERSION = '0.2.4';
4
4
  export const DEFAULT_BASE_URL = 'https://daishi.ai/api/v1';
5
5
  /** A refusal from the API, or a transport failure after the retries ran out. */
6
6
  export class DaishiError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daishi-sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Typed client for the Daishi Studio API: scenarios, runs, series batches and paired experiments, with retries and waiting helpers.",
5
5
  "keywords": [
6
6
  "daishi",