daishi-sdk 0.2.1 → 0.2.3

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' | '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' | '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>;
@@ -124,7 +124,8 @@ export interface Experiment {
124
124
  scenario_id: string;
125
125
  trials: number;
126
126
  seed_mode: 'vary' | 'pinned';
127
- metric: 'fitness_index' | 'rank' | 'survived';
127
+ metric: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn';
128
+ secondary_metrics: Array<'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn'>;
128
129
  rule: StoppingRule;
129
130
  arms: ExperimentArmView[];
130
131
  created_at_ms: number;
@@ -145,13 +146,14 @@ export interface ExperimentReport {
145
146
  scenario_id: string;
146
147
  trials: number;
147
148
  seed_mode: 'vary' | 'pinned';
148
- metric: 'fitness_index' | 'rank' | 'survived';
149
- analysis_scale: 'metric' | 'negative_rank';
149
+ metric: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn';
150
+ analysis_scale: 'metric' | 'negative_rank' | 'log';
150
151
  rule: StoppingRule;
151
152
  rule_text: string;
152
153
  arms: ExperimentReportArm[];
153
154
  pairs: ExperimentReportPair[];
154
155
  comparisons: ExperimentReportComparison[];
156
+ secondary: ExperimentReportSecondary[];
155
157
  detectable_gap: ExperimentReportDetectableGap;
156
158
  decision: ExperimentReportDecision;
157
159
  verdict: string;
@@ -200,7 +202,7 @@ export interface RosterSeat {
200
202
  name?: string;
201
203
  /** World runs on Pro and Lab: true makes this a guest seat, played by a peer’s own agent over an invite link on the peer’s keys, inside the world you configured. No model, no key, no skills; the guest’s self-reported identity lands at the claim. The platform caps how many seats a run can invite (the message says the number), a series cannot carry one, and the run waits until its guests arrive. See the runs page. */
202
204
  invited?: boolean;
203
- /** Reasoning effort where the model supports it. */
205
+ /** Reasoning effort where the model supports it. A level the model’s route refuses is refused at launch with bad_roster (one short call on the seat’s key checks it). */
204
206
  reasoning?: 'off' | 'low' | 'medium' | 'high';
205
207
  /** Sampling temperature, passed through to the provider. */
206
208
  temperature?: number;
@@ -222,8 +224,10 @@ export interface ExperimentBody {
222
224
  name?: string;
223
225
  /** 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. */
224
226
  seed_mode?: 'vary' | 'pinned';
225
- /** The per-trial score the arms are compared on, the mean over the arm’s roster seats: the Fitness Index (default), the rank in the field (lower is better, and the report compares on the negative rank so a positive difference always favors the arm), or the share of seats that survived. */
226
- metric?: 'fitness_index' | 'rank' | 'survived';
227
+ /** The per-trial score the arms are compared on, the mean over the arm’s roster seats: the Fitness Index (default), the rank in the field (lower is better, and the report compares on the negative rank so a positive difference always favors the arm), the share of seats that survived, or output tokens per play turn. Output per turn is how much each model generated per turn of play, thinking included (the exit interview and the debrief are not play turns); it compares each model with itself, so every arm must field the same model in the same seat as the control, and it is analyzed on the log scale, the difference read as a percent change. It has no better side: the verdict says which arm generated more. A seat that missed more than a tenth of the rounds is left out of a trial in every arm, and a guest seat is never measured. */
228
+ metric?: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn';
229
+ /** Outcomes reported beside metric, declared now and never changed: any of the metric’s values except the metric itself, each at most once. Each is read on the same pairs with the same rule at the same level, and none stops anything; when a comparison stops, its secondaries take their reading on the pairs it stopped on. Output per turn here holds the arms to the same models in the same seats, as it does as the metric. Default none. */
230
+ secondary_metrics?: Array<'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn'>;
227
231
  /** anytime: an anytime-valid 95% confidence sequence on the paired difference, checked after every trial from the tenth on, stopping as soon as it excludes zero or at the last trial; it needs more than 10 trials per arm and is the default above that. fixed: one look at the last trial; the default at 10 or fewer. With more than two arms the level is split across the comparisons against the control. */
228
232
  stopping?: 'anytime' | 'fixed';
229
233
  /** Anytime rule only: also stop, undecided, once the whole interval lies within plus or minus this on the metric’s scale, so the gap, if any, is smaller than this. */
@@ -506,6 +510,7 @@ export interface ExperimentReportArm {
506
510
  agent_turns: number;
507
511
  usage: JsonObject;
508
512
  awareness: JsonObject;
513
+ effort?: ExperimentReportArmEffort;
509
514
  }
510
515
  export interface ExperimentReportArmTrials {
511
516
  finished: number;
@@ -521,6 +526,20 @@ export interface ExperimentReportArmScore {
521
526
  sd: number | null;
522
527
  ci: Interval | null;
523
528
  }
529
+ export interface ExperimentReportArmEffort {
530
+ measured_seats: number;
531
+ short_seats: number;
532
+ unmeasured_seats: number;
533
+ models: ExperimentReportArmEffortModel[];
534
+ }
535
+ export interface ExperimentReportArmEffortModel {
536
+ model: string;
537
+ seats: number;
538
+ output_per_turn: number;
539
+ thinking_per_turn: number | null;
540
+ truncated_share: number;
541
+ served_by: JsonObject;
542
+ }
524
543
  export interface ExperimentReportPair {
525
544
  trial: number;
526
545
  seed: number | null;
@@ -538,8 +557,28 @@ export interface ExperimentReportComparison {
538
557
  alpha: number;
539
558
  stop: boolean;
540
559
  reason: string;
541
- verdict: 'arm_better' | 'control_better' | 'undecided' | null;
560
+ verdict: 'arm_better' | 'control_better' | 'arm_higher' | 'control_higher' | 'undecided' | null;
561
+ interval: Interval | null;
562
+ detail: string;
563
+ }
564
+ export interface ExperimentReportSecondary {
565
+ metric: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn';
566
+ analysis_scale: 'metric' | 'negative_rank' | 'log';
567
+ pairs: ExperimentReportSecondaryPair[];
568
+ comparisons: ExperimentReportSecondaryComparison[];
569
+ }
570
+ export interface ExperimentReportSecondaryPair {
571
+ trial: number;
572
+ values: Array<number | null>;
573
+ excluded: boolean;
574
+ }
575
+ export interface ExperimentReportSecondaryComparison {
576
+ arm: number;
577
+ control: number;
578
+ n: number;
579
+ mean_diff: number | null;
542
580
  interval: Interval | null;
581
+ reading: 'arm_better' | 'control_better' | 'arm_higher' | 'control_higher' | 'undecided' | null;
543
582
  detail: string;
544
583
  }
545
584
  export interface ExperimentReportDetectableGap {
@@ -577,7 +616,7 @@ export interface ExperimentArmSeat {
577
616
  provider?: string;
578
617
  /** Seat name shown in the world. Default: derived from the model. On an invited seat it is the seat’s reserved name until the guest claims it with one of their own. */
579
618
  name?: string;
580
- /** Reasoning effort where the model supports it. */
619
+ /** Reasoning effort where the model supports it. A level the model’s route refuses is refused at launch with bad_roster (one short call on the seat’s key checks it). */
581
620
  reasoning?: 'off' | 'low' | 'medium' | 'high';
582
621
  /** Sampling temperature, passed through to the provider. */
583
622
  temperature?: number;
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.1";
3
+ export declare const VERSION = "0.2.3";
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.1';
3
+ export const VERSION = '0.2.3';
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.1",
3
+ "version": "0.2.3",
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",