daishi-sdk 0.2.7 → 0.2.9

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' | 'handover' | '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' | 'bad_design' | 'design_final' | 'design_late' | 'no_design' | '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';
8
+ export type ErrorCode = 'token_required' | 'scope_required' | 'plan_api' | 'rate_limited' | 'handover' | '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' | 'bad_game' | 'bad_arena' | 'experiment_world_only' | 'experiment_same_arms' | 'experiment_env_seed' | 'experiment_stopping' | 'bad_metric' | 'bad_design' | 'design_final' | 'design_late' | 'no_design' | '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' | 'study_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,8 +124,9 @@ export interface Experiment {
124
124
  scenario_id: string;
125
125
  trials: number;
126
126
  seed_mode: 'vary' | 'pinned';
127
- metric: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn' | 'said_evaluated';
128
- secondary_metrics: Array<'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn' | 'said_evaluated'>;
127
+ aa_check: boolean;
128
+ metric: 'fitness_index' | 'rank' | 'survived' | 'index_survival' | 'index_economy' | 'index_social' | 'index_adaptation' | 'index_competitiveness' | 'aggression_per_100_rounds' | 'trades_per_100_rounds' | 'messages_per_100_rounds' | 'map_coverage' | 'output_tokens_per_turn' | 'said_evaluated';
129
+ secondary_metrics: Array<'fitness_index' | 'rank' | 'survived' | 'index_survival' | 'index_economy' | 'index_social' | 'index_adaptation' | 'index_competitiveness' | 'aggression_per_100_rounds' | 'trades_per_100_rounds' | 'messages_per_100_rounds' | 'map_coverage' | 'output_tokens_per_turn' | 'said_evaluated'>;
129
130
  rule: StoppingRule;
130
131
  arms: ExperimentArmView[];
131
132
  created_at_ms: number;
@@ -151,7 +152,8 @@ export interface ExperimentReport {
151
152
  scenario_id: string;
152
153
  trials: number;
153
154
  seed_mode: 'vary' | 'pinned';
154
- metric: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn' | 'said_evaluated';
155
+ aa_check: boolean;
156
+ metric: 'fitness_index' | 'rank' | 'survived' | 'index_survival' | 'index_economy' | 'index_social' | 'index_adaptation' | 'index_competitiveness' | 'aggression_per_100_rounds' | 'trades_per_100_rounds' | 'messages_per_100_rounds' | 'map_coverage' | 'output_tokens_per_turn' | 'said_evaluated';
155
157
  analysis_scale: 'metric' | 'negative_rank' | 'log';
156
158
  rule: StoppingRule;
157
159
  rule_text: string;
@@ -162,6 +164,8 @@ export interface ExperimentReport {
162
164
  detectable_gap: ExperimentReportDetectableGap;
163
165
  decision: ExperimentReportDecision;
164
166
  verdict: string;
167
+ plain: string;
168
+ what_differed: ExperimentReportWhatDiffered[];
165
169
  cost: Cost;
166
170
  note: string | null;
167
171
  note_at_ms: number | null;
@@ -175,12 +179,12 @@ export interface ScenarioBody {
175
179
  description?: string;
176
180
  /** Season length in rounds: in each round every seat takes a turn, then the world updates (the API calls a round a tick). Null or omitted means the base default (300). Your plan caps what a run may use; validate reports that as a warning. */
177
181
  season_ticks?: number | null;
178
- /** The environment. Every field is optional; an omitted field takes the base world default. */
182
+ /** The environment. Every field is optional; an omitted field takes the base world default, and an unknown field is refused (known: seed, spawn_seed, turn_timeout_ms, actions_per_turn, resources, anchors, unwitnessed_anonymity). */
179
183
  env?: Env;
180
184
  }
181
185
  export interface RunBody {
182
- /** A library id (daishi:famine-v1) or one of your saved scenarios (usc_...). */
183
- scenario_id: string;
186
+ /** Required on a world run (the default game): a library id (daishi:famine-v1) or one of your saved scenarios (usc_...). A board game takes none. */
187
+ scenario_id?: string;
184
188
  /** One entry per seat. Your plan caps how many. */
185
189
  roster: RosterSeat[];
186
190
  /** Run name, kept on one line: whitespace runs collapse to one space and control characters are dropped. Default: generated. */
@@ -199,6 +203,10 @@ export interface RunBody {
199
203
  invite_minutes?: number;
200
204
  /** The awareness frame every seat plays under: monitored opens the prompt with a notice that the match is recorded and scored, neutral withholds the sentence that names the audience; omitted is the canonical prompt. The frame is part of each seat’s scaffold identity and of the recipe hash, so a framed run is its own recipe. World runs only. */
201
205
  frame?: 'monitored' | 'neutral';
206
+ /** What to play: world (default), or a board game, model against model, every move graded afterwards by an oracle. A board game takes exactly two seats and reads no scenario_id, season_ticks or env; a frame on it is refused (bad_frame: its seats never see the world prompt the frame rewrites); arena holds its protocol. Board games run as single runs or series, never as experiment arms. */
207
+ game?: 'world' | 'chess' | 'connect4';
208
+ /** Board games only: the protocol. Every field is optional; an unknown one is refused (known: opening, max_plies, move_timeout_ms, illegal_move_retries, seed). */
209
+ arena?: RunBodyArena;
202
210
  /** The id of an archived Studio match to re-run. Fill the body from that match’s recipe (GET /api/matches/<id>/recipe answers with a request body). The run is created already published, so it lists beside the original at /api/matches/<id>/replications whether or not it agrees, and the account needs a profile handle. World runs only; a private match cannot be re-run. */
203
211
  replicates?: string;
204
212
  }
@@ -225,7 +233,7 @@ export interface RosterSeat {
225
233
  instructions?: string;
226
234
  }
227
235
  export interface ExperimentBody {
228
- /** 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. */
236
+ /** 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. An arm that plays exactly what the control plays (compared on what reaches the match: every seat as validated with its defaults filled in, its name included, the environment as the match resolves it, with the scenario’s defaults filled in and the lineup expanded, the season and the frame; not the label, the run name or the spend cap) is refused with experiment_same_arms unless aa_check is true. */
229
237
  arms?: ExperimentArm[];
230
238
  /** 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. */
231
239
  trials?: number;
@@ -233,19 +241,21 @@ export interface ExperimentBody {
233
241
  name?: string;
234
242
  /** 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. */
235
243
  seed_mode?: 'vary' | 'pinned';
236
- /** 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, output tokens per play turn, or the debrief share. 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. said_evaluated is the share of a trial’s seats that answered yes when the end-of-match debrief asked whether they believed the match was an evaluation or test of them, among the seats whose answer came back (a trial where none did leaves its pair out), compared in percentage points. It is what the seats said, not what they believed, and it has no better side either: the verdict says which arm had more of its seats say so. */
237
- metric?: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn' | 'said_evaluated';
244
+ /** 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, output tokens per play turn, the debrief share, one of the Index’s five dimensions, one of three behavior counts per 100 rounds, or map coverage. 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. said_evaluated is the share of a trial’s seats that answered yes when the end-of-match debrief asked whether they believed the match was an evaluation or test of them, among the seats whose answer came back (a trial where none did leaves its pair out), compared in percentage points. It is what the seats said, not what they believed, and it has no better side either: the verdict says which arm had more of its seats say so. index_survival, index_economy, index_social, index_adaptation and index_competitiveness are the Fitness Index’s five dimensions, 0 to 100 each under the rubric the match scored with, higher being better as on the Index (competitiveness is scored against the whole field, house bots included; the social dimension credits messages sent up to a cap, answered or not, and subtracts aggression and commons loss). The behavior outcomes count what each seat did, from its match’s event log, over the rounds the match played (a seat that died keeps the whole match as its denominator, unlike the rubric’s rates, which divide by rounds alive): aggression_per_100_rounds (acts of force: attacks on agents, raids on structures and thefts from storehouses, the three acts the world’s aggression counter prices), trades_per_100_rounds (completed trades the seat was party to, offering or accepting; a trade between two roster seats counts once for each) and messages_per_100_rounds (public and direct); map_coverage is the share of the map’s cells the seat ever stood in, its spawn included, compared in percentage points: a stock, not a rate, so arms that differ in season_ticks should not compare on it, and the adaptation dimension carries a coverage term of its own, so the two move together by construction. These four have no better side: the verdict says which arm was higher. A trial whose match recorded no event counts (or, for coverage, no map record) leaves its pair out as unmeasured. None of the new outcomes has a prior spread, so detectable_gap is null on them until five pairs are in. */
245
+ metric?: 'fitness_index' | 'rank' | 'survived' | 'index_survival' | 'index_economy' | 'index_social' | 'index_adaptation' | 'index_competitiveness' | 'aggression_per_100_rounds' | 'trades_per_100_rounds' | 'messages_per_100_rounds' | 'map_coverage' | 'output_tokens_per_turn' | 'said_evaluated';
238
246
  /** 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. */
239
- secondary_metrics?: Array<'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn' | 'said_evaluated'>;
247
+ secondary_metrics?: Array<'fitness_index' | 'rank' | 'survived' | 'index_survival' | 'index_economy' | 'index_social' | 'index_adaptation' | 'index_competitiveness' | 'aggression_per_100_rounds' | 'trades_per_100_rounds' | 'messages_per_100_rounds' | 'map_coverage' | 'output_tokens_per_turn' | 'said_evaluated'>;
240
248
  /** 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. */
241
249
  stopping?: 'anytime' | 'fixed';
242
250
  /** 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. */
243
251
  target_half_width?: number;
252
+ /** true declares an A/A check: every arm plays the control’s configuration on purpose, so the report measures the noise between identical arms (labels may still differ). Without it, an arm identical to the control is refused (experiment_same_arms); with it, an arm that differs is refused (bad_experiment). The report and the list carry it as aa_check, and the verdict says that any difference is noise. Default false. */
253
+ aa_check?: boolean;
244
254
  /** 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. */
245
255
  callback_url?: string;
246
256
  /** The design document, as text (markdown or plain): what you predict, which result you will read and how, and what would change your view. The server keeps it byte for byte with the SHA-256 of its UTF-8 bytes and the time it arrived; the experiment answers with design (digest, size, arrival and standing), and once a trial is published the study’s card on your profile links to it at /u/<handle>/studies/<id>/design, where anyone can download the exact bytes and check the digest. Omitted: no design; one can still be attached before the first trial starts (POST /experiments/:id/design). */
247
257
  design?: string;
248
- /** 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 study’s settings, only name, max_spend_usd, callback_url and, if you wrote one, your own design document for the re-run; a setting of the study (arms, trials, seed_mode, metric, secondary_metrics, stopping, target_half_width) 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. */
258
+ /** 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 study’s settings, only name, max_spend_usd, callback_url and, if you wrote one, your own design document for the re-run; a setting of the study (arms, trials, seed_mode, metric, secondary_metrics, stopping, target_half_width, aa_check) 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. */
249
259
  replicates?: string;
250
260
  /** 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. */
251
261
  max_spend_usd?: number;
@@ -253,7 +263,7 @@ export interface ExperimentBody {
253
263
  export interface ExperimentArm {
254
264
  /** How the report names this arm. Default arm 1, arm 2, ...; labels must be distinct. */
255
265
  label?: string;
256
- /** A library id (daishi:famine-v1) or one of your saved scenarios (usc_...). */
266
+ /** A library id (daishi:famine-v1) or one of your saved scenarios (usc_...); every arm names the same one. */
257
267
  scenario_id: string;
258
268
  /** One entry per seat. Your plan caps how many. No seat may be invited: an arm cannot seat a guest. */
259
269
  roster: ExperimentArmSeat[];
@@ -291,7 +301,7 @@ export interface UpdateScenarioBody {
291
301
  description?: string;
292
302
  /** Season length in rounds: in each round every seat takes a turn, then the world updates (the API calls a round a tick). Null or omitted means the base default (300). Your plan caps what a run may use; validate reports that as a warning. */
293
303
  season_ticks?: number | null;
294
- /** The environment. Every field is optional; an omitted field takes the base world default. */
304
+ /** The environment. Every field is optional; an omitted field takes the base world default, and an unknown field is refused (known: seed, spawn_seed, turn_timeout_ms, actions_per_turn, resources, anchors, unwitnessed_anonymity). */
295
305
  env?: Env;
296
306
  }
297
307
  export interface UpdateScenarioResponse {
@@ -334,6 +344,8 @@ export interface LaunchResponse {
334
344
  }
335
345
  export interface ListRunsResponse {
336
346
  runs: Run[];
347
+ next_cursor: string | null;
348
+ total: number;
337
349
  }
338
350
  export interface GetRunResponse {
339
351
  run: Run;
@@ -403,6 +415,38 @@ export interface UnpublishRunResponse {
403
415
  run: Run;
404
416
  profile_url: string | null;
405
417
  }
418
+ export interface PublishExperimentBody {
419
+ /** The study’s note, your declared result. Omitted: the experiment keeps the note it has. "" or null: no note. */
420
+ note?: string | null;
421
+ }
422
+ export interface PublishExperimentResponse {
423
+ ok: boolean;
424
+ study: Study;
425
+ experiment: Experiment | null;
426
+ profile_url: string | null;
427
+ study_url: string | null;
428
+ }
429
+ export interface UnpublishExperimentResponse {
430
+ ok: boolean;
431
+ study: Study;
432
+ experiment: Experiment | null;
433
+ profile_url: string | null;
434
+ study_url: string | null;
435
+ }
436
+ export interface PublishBatchResponse {
437
+ ok: boolean;
438
+ study: Study;
439
+ experiment: Experiment | null;
440
+ profile_url: string | null;
441
+ study_url: string | null;
442
+ }
443
+ export interface UnpublishBatchResponse {
444
+ ok: boolean;
445
+ study: Study;
446
+ experiment: Experiment | null;
447
+ profile_url: string | null;
448
+ study_url: string | null;
449
+ }
406
450
  export interface ExtendInvitesBody {
407
451
  /** The new deadline, minutes from now, for every open seat. */
408
452
  minutes: number;
@@ -457,17 +501,26 @@ export interface RunResultsAgent {
457
501
  archetype?: string;
458
502
  status?: 'active' | 'dormant' | 'dead';
459
503
  crafter_score?: number | null;
460
- dimensions?: RunResultsAgentDimensions;
504
+ dimensions?: SeatDimensions;
505
+ behavior?: SeatBehavior | null;
461
506
  epilogue?: string | null;
462
507
  missing?: boolean;
463
508
  }
464
- export interface RunResultsAgentDimensions {
509
+ export interface SeatDimensions {
465
510
  survival: number;
466
511
  economy: number;
467
512
  social: number;
468
513
  adaptation: number;
469
514
  competitiveness: number;
470
515
  }
516
+ export interface SeatBehavior {
517
+ attacks: number;
518
+ raids: number;
519
+ thefts: number;
520
+ trades: number;
521
+ messages: number;
522
+ map_coverage: number | null;
523
+ }
471
524
  export interface RunResultsTopModel {
472
525
  name: string;
473
526
  model: string;
@@ -512,6 +565,8 @@ export interface BatchReportPointAgent {
512
565
  fitness_index: number;
513
566
  rank: number;
514
567
  status: string;
568
+ dimensions?: SeatDimensions;
569
+ behavior?: SeatBehavior | null;
515
570
  usage: JsonObject | null;
516
571
  }
517
572
  export interface BatchReportPrecision {
@@ -631,7 +686,7 @@ export interface WorldReading {
631
686
  interval: Interval | null;
632
687
  }
633
688
  export interface ExperimentReportSecondary {
634
- metric: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn' | 'said_evaluated';
689
+ metric: 'fitness_index' | 'rank' | 'survived' | 'index_survival' | 'index_economy' | 'index_social' | 'index_adaptation' | 'index_competitiveness' | 'aggression_per_100_rounds' | 'trades_per_100_rounds' | 'messages_per_100_rounds' | 'map_coverage' | 'output_tokens_per_turn' | 'said_evaluated';
635
690
  analysis_scale: 'metric' | 'negative_rank' | 'log';
636
691
  pairs: ExperimentReportSecondaryPair[];
637
692
  comparisons: ExperimentReportSecondaryComparison[];
@@ -668,7 +723,12 @@ export interface ExperimentReportDecision {
668
723
  reason: string;
669
724
  summary: string;
670
725
  }
671
- /** The environment. Every field is optional; an omitted field takes the base world default. */
726
+ export interface ExperimentReportWhatDiffered {
727
+ arm: number;
728
+ label: string;
729
+ changes: string[];
730
+ }
731
+ /** The environment. Every field is optional; an omitted field takes the base world default, and an unknown field is refused (known: seed, spawn_seed, turn_timeout_ms, actions_per_turn, resources, anchors, unwitnessed_anonymity). */
672
732
  export interface Env {
673
733
  /** World seed: fixes the map. Omit to draw a fresh one per run; the drawn seed is recorded on the run. */
674
734
  seed?: number;
@@ -685,6 +745,19 @@ export interface Env {
685
745
  /** Baseline bot policy ids or one population id (expands to its members). [] means none. At most 8 bots after expansion; see the anchors endpoint for the live list. */
686
746
  anchors?: string[];
687
747
  }
748
+ /** Board games only: the protocol. Every field is optional; an unknown one is refused (known: opening, max_plies, move_timeout_ms, illegal_move_retries, seed). */
749
+ export interface RunBodyArena {
750
+ /** How the game starts: the standard position, or a book opening of plies random legal half-moves (0 to 10) before the seats take over. Default: chess a 4-ply book, Connect Four standard. */
751
+ opening?: 'standard' | '{ kind: standard' | 'book, plies? }';
752
+ /** Half-moves before the game is called a draw. Default: chess 200, Connect Four 42. */
753
+ max_plies?: number;
754
+ /** Milliseconds a seat has per move. Default: chess 180000, Connect Four 120000. */
755
+ move_timeout_ms?: number;
756
+ /** Retries after an illegal move before the seat forfeits. Default 3. */
757
+ illegal_move_retries?: number;
758
+ /** Pins the book opening, so a rematch starts from the same position. Refused for a multi-trial series. */
759
+ seed?: number;
760
+ }
688
761
  export interface ExperimentArmSeat {
689
762
  /** Required on every seat not marked invited; ignored on one that is. Model id as your provider names it, for example <provider>/<model> through a router key, or a vendor's own id with provider set. */
690
763
  model?: string;
@@ -710,6 +783,13 @@ export interface LaunchResponseBatch {
710
783
  trials: number;
711
784
  seed_mode: 'vary' | 'pinned';
712
785
  }
786
+ export interface Study {
787
+ kind: 'experiment' | 'series';
788
+ id: string;
789
+ played: number;
790
+ published: number;
791
+ pending: number;
792
+ }
713
793
  /** One method per API operation. The transport is the subclass's. */
714
794
  export declare abstract class Operations {
715
795
  protected abstract request<T>(method: Method, path: string, parts?: RequestParts): Promise<T>;
@@ -761,6 +841,14 @@ export declare abstract class Operations {
761
841
  * @see https://daishi.ai/docs/developer/rest#ep-library-anchors
762
842
  */
763
843
  libraryAnchors(): Promise<JsonObject>;
844
+ /**
845
+ * Studio templates.
846
+ *
847
+ * The ready-made studies the Studio’s New run page offers, word for word.
848
+ *
849
+ * @see https://daishi.ai/docs/developer/rest#ep-templates
850
+ */
851
+ templates(): Promise<JsonObject>;
764
852
  /**
765
853
  * Validate a scenario.
766
854
  *
@@ -868,12 +956,13 @@ export declare abstract class Operations {
868
956
  /**
869
957
  * List your runs.
870
958
  *
871
- * Your runs, newest first.
959
+ * Your runs, newest first, a page at a time.
872
960
  *
873
961
  * @see https://daishi.ai/docs/developer/rest#ep-list-runs
874
962
  */
875
963
  listRuns(query?: {
876
964
  limit?: number;
965
+ cursor?: string;
877
966
  }): Promise<ListRunsResponse>;
878
967
  /**
879
968
  * Get a run.
@@ -891,6 +980,14 @@ export declare abstract class Operations {
891
980
  * @see https://daishi.ai/docs/developer/rest#ep-usage
892
981
  */
893
982
  usage(): Promise<JsonObject>;
983
+ /**
984
+ * Your models.
985
+ *
986
+ * Every finished run rolled up by model: the figures the Studio’s Models page draws.
987
+ *
988
+ * @see https://daishi.ai/docs/developer/rest#ep-models
989
+ */
990
+ models(): Promise<JsonObject>;
894
991
  /**
895
992
  * Live worlds.
896
993
  *
@@ -995,6 +1092,38 @@ export declare abstract class Operations {
995
1092
  * @see https://daishi.ai/docs/developer/rest#ep-unpublish-run
996
1093
  */
997
1094
  unpublishRun(id: string): Promise<UnpublishRunResponse>;
1095
+ /**
1096
+ * Publish an experiment.
1097
+ *
1098
+ * List a whole paired experiment on your public profile in one call: every trial that played, in every arm.
1099
+ *
1100
+ * @see https://daishi.ai/docs/developer/rest#ep-publish-experiment
1101
+ */
1102
+ publishExperiment(id: string, body: PublishExperimentBody): Promise<PublishExperimentResponse>;
1103
+ /**
1104
+ * Unpublish an experiment.
1105
+ *
1106
+ * Take every trial of a paired experiment off your public profile.
1107
+ *
1108
+ * @see https://daishi.ai/docs/developer/rest#ep-unpublish-experiment
1109
+ */
1110
+ unpublishExperiment(id: string): Promise<UnpublishExperimentResponse>;
1111
+ /**
1112
+ * Publish a series.
1113
+ *
1114
+ * List a whole series batch on your public profile in one call: every trial that played.
1115
+ *
1116
+ * @see https://daishi.ai/docs/developer/rest#ep-publish-batch
1117
+ */
1118
+ publishBatch(id: string): Promise<PublishBatchResponse>;
1119
+ /**
1120
+ * Unpublish a series.
1121
+ *
1122
+ * Take every trial of a series batch off your public profile.
1123
+ *
1124
+ * @see https://daishi.ai/docs/developer/rest#ep-unpublish-batch
1125
+ */
1126
+ unpublishBatch(id: string): Promise<UnpublishBatchResponse>;
998
1127
  /**
999
1128
  * List a run’s logs.
1000
1129
  *
@@ -1011,6 +1140,14 @@ export declare abstract class Operations {
1011
1140
  * @see https://daishi.ai/docs/developer/rest#ep-run-log
1012
1141
  */
1013
1142
  runLog(id: string, file: string): Promise<string>;
1143
+ /**
1144
+ * Read a run’s seats.
1145
+ *
1146
+ * Per seat: the debrief answer, voiced awareness, forfeited rounds with their causes, the harness that played it, and its trajectory file.
1147
+ *
1148
+ * @see https://daishi.ai/docs/developer/rest#ep-run-seats
1149
+ */
1150
+ runSeats(id: string): Promise<JsonObject>;
1014
1151
  /**
1015
1152
  * List a run’s guest seats.
1016
1153
  *
package/dist/generated.js CHANGED
@@ -64,6 +64,16 @@ export class Operations {
64
64
  libraryAnchors() {
65
65
  return this.request('GET', '/library/anchors');
66
66
  }
67
+ /**
68
+ * Studio templates.
69
+ *
70
+ * The ready-made studies the Studio’s New run page offers, word for word.
71
+ *
72
+ * @see https://daishi.ai/docs/developer/rest#ep-templates
73
+ */
74
+ templates() {
75
+ return this.request('GET', '/templates');
76
+ }
67
77
  /**
68
78
  * Validate a scenario.
69
79
  *
@@ -197,7 +207,7 @@ export class Operations {
197
207
  /**
198
208
  * List your runs.
199
209
  *
200
- * Your runs, newest first.
210
+ * Your runs, newest first, a page at a time.
201
211
  *
202
212
  * @see https://daishi.ai/docs/developer/rest#ep-list-runs
203
213
  */
@@ -224,6 +234,16 @@ export class Operations {
224
234
  usage() {
225
235
  return this.request('GET', '/usage');
226
236
  }
237
+ /**
238
+ * Your models.
239
+ *
240
+ * Every finished run rolled up by model: the figures the Studio’s Models page draws.
241
+ *
242
+ * @see https://daishi.ai/docs/developer/rest#ep-models
243
+ */
244
+ models() {
245
+ return this.request('GET', '/models');
246
+ }
227
247
  /**
228
248
  * Live worlds.
229
249
  *
@@ -354,6 +374,46 @@ export class Operations {
354
374
  unpublishRun(id) {
355
375
  return this.request('POST', `/runs/${encodeURIComponent(id)}/unpublish`);
356
376
  }
377
+ /**
378
+ * Publish an experiment.
379
+ *
380
+ * List a whole paired experiment on your public profile in one call: every trial that played, in every arm.
381
+ *
382
+ * @see https://daishi.ai/docs/developer/rest#ep-publish-experiment
383
+ */
384
+ publishExperiment(id, body) {
385
+ return this.request('POST', `/experiments/${encodeURIComponent(id)}/publish`, { body });
386
+ }
387
+ /**
388
+ * Unpublish an experiment.
389
+ *
390
+ * Take every trial of a paired experiment off your public profile.
391
+ *
392
+ * @see https://daishi.ai/docs/developer/rest#ep-unpublish-experiment
393
+ */
394
+ unpublishExperiment(id) {
395
+ return this.request('POST', `/experiments/${encodeURIComponent(id)}/unpublish`);
396
+ }
397
+ /**
398
+ * Publish a series.
399
+ *
400
+ * List a whole series batch on your public profile in one call: every trial that played.
401
+ *
402
+ * @see https://daishi.ai/docs/developer/rest#ep-publish-batch
403
+ */
404
+ publishBatch(id) {
405
+ return this.request('POST', `/batches/${encodeURIComponent(id)}/publish`);
406
+ }
407
+ /**
408
+ * Unpublish a series.
409
+ *
410
+ * Take every trial of a series batch off your public profile.
411
+ *
412
+ * @see https://daishi.ai/docs/developer/rest#ep-unpublish-batch
413
+ */
414
+ unpublishBatch(id) {
415
+ return this.request('POST', `/batches/${encodeURIComponent(id)}/unpublish`);
416
+ }
357
417
  /**
358
418
  * List a run’s logs.
359
419
  *
@@ -374,6 +434,16 @@ export class Operations {
374
434
  runLog(id, file) {
375
435
  return this.request('GET', `/runs/${encodeURIComponent(id)}/logs/${encodeURIComponent(file)}`, { text: true });
376
436
  }
437
+ /**
438
+ * Read a run’s seats.
439
+ *
440
+ * Per seat: the debrief answer, voiced awareness, forfeited rounds with their causes, the harness that played it, and its trajectory file.
441
+ *
442
+ * @see https://daishi.ai/docs/developer/rest#ep-run-seats
443
+ */
444
+ runSeats(id) {
445
+ return this.request('GET', `/runs/${encodeURIComponent(id)}/seats`);
446
+ }
377
447
  /**
378
448
  * List a run’s guest seats.
379
449
  *
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.7";
3
+ export declare const VERSION = "0.2.9";
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.7';
3
+ export const VERSION = '0.2.9';
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.7",
3
+ "version": "0.2.9",
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",