daishi-sdk 0.2.6 → 0.2.8
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/generated.d.ts +127 -2
- package/dist/generated.js +71 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/generated.d.ts
CHANGED
|
@@ -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' | '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' | '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>;
|
|
@@ -162,6 +162,8 @@ export interface ExperimentReport {
|
|
|
162
162
|
detectable_gap: ExperimentReportDetectableGap;
|
|
163
163
|
decision: ExperimentReportDecision;
|
|
164
164
|
verdict: string;
|
|
165
|
+
plain: string;
|
|
166
|
+
what_differed: ExperimentReportWhatDiffered[];
|
|
165
167
|
cost: Cost;
|
|
166
168
|
note: string | null;
|
|
167
169
|
note_at_ms: number | null;
|
|
@@ -334,6 +336,8 @@ export interface LaunchResponse {
|
|
|
334
336
|
}
|
|
335
337
|
export interface ListRunsResponse {
|
|
336
338
|
runs: Run[];
|
|
339
|
+
next_cursor: string | null;
|
|
340
|
+
total: number;
|
|
337
341
|
}
|
|
338
342
|
export interface GetRunResponse {
|
|
339
343
|
run: Run;
|
|
@@ -403,6 +407,38 @@ export interface UnpublishRunResponse {
|
|
|
403
407
|
run: Run;
|
|
404
408
|
profile_url: string | null;
|
|
405
409
|
}
|
|
410
|
+
export interface PublishExperimentBody {
|
|
411
|
+
/** The study’s note, your declared result. Omitted: the experiment keeps the note it has. "" or null: no note. */
|
|
412
|
+
note?: string | null;
|
|
413
|
+
}
|
|
414
|
+
export interface PublishExperimentResponse {
|
|
415
|
+
ok: boolean;
|
|
416
|
+
study: Study;
|
|
417
|
+
experiment: Experiment | null;
|
|
418
|
+
profile_url: string | null;
|
|
419
|
+
study_url: string | null;
|
|
420
|
+
}
|
|
421
|
+
export interface UnpublishExperimentResponse {
|
|
422
|
+
ok: boolean;
|
|
423
|
+
study: Study;
|
|
424
|
+
experiment: Experiment | null;
|
|
425
|
+
profile_url: string | null;
|
|
426
|
+
study_url: string | null;
|
|
427
|
+
}
|
|
428
|
+
export interface PublishBatchResponse {
|
|
429
|
+
ok: boolean;
|
|
430
|
+
study: Study;
|
|
431
|
+
experiment: Experiment | null;
|
|
432
|
+
profile_url: string | null;
|
|
433
|
+
study_url: string | null;
|
|
434
|
+
}
|
|
435
|
+
export interface UnpublishBatchResponse {
|
|
436
|
+
ok: boolean;
|
|
437
|
+
study: Study;
|
|
438
|
+
experiment: Experiment | null;
|
|
439
|
+
profile_url: string | null;
|
|
440
|
+
study_url: string | null;
|
|
441
|
+
}
|
|
406
442
|
export interface ExtendInvitesBody {
|
|
407
443
|
/** The new deadline, minutes from now, for every open seat. */
|
|
408
444
|
minutes: number;
|
|
@@ -616,6 +652,19 @@ export interface ExperimentReportComparison {
|
|
|
616
652
|
verdict: 'arm_better' | 'control_better' | 'arm_higher' | 'control_higher' | 'undecided' | null;
|
|
617
653
|
interval: Interval | null;
|
|
618
654
|
detail: string;
|
|
655
|
+
exact: ExactCheck | null;
|
|
656
|
+
by_world: WorldReading | null;
|
|
657
|
+
}
|
|
658
|
+
export interface ExactCheck {
|
|
659
|
+
unit: 'pair' | 'world';
|
|
660
|
+
units: number;
|
|
661
|
+
p: number;
|
|
662
|
+
min_p: number;
|
|
663
|
+
}
|
|
664
|
+
export interface WorldReading {
|
|
665
|
+
worlds: number;
|
|
666
|
+
repeated: number;
|
|
667
|
+
interval: Interval | null;
|
|
619
668
|
}
|
|
620
669
|
export interface ExperimentReportSecondary {
|
|
621
670
|
metric: 'fitness_index' | 'rank' | 'survived' | 'output_tokens_per_turn' | 'said_evaluated';
|
|
@@ -636,18 +685,30 @@ export interface ExperimentReportSecondaryComparison {
|
|
|
636
685
|
interval: Interval | null;
|
|
637
686
|
reading: 'arm_better' | 'control_better' | 'arm_higher' | 'control_higher' | 'undecided' | null;
|
|
638
687
|
detail: string;
|
|
688
|
+
exact: ExactCheck | null;
|
|
689
|
+
by_world: WorldReading | null;
|
|
639
690
|
}
|
|
640
691
|
export interface ExperimentReportDetectableGap {
|
|
641
692
|
sd_diff: number | null;
|
|
642
693
|
source: 'observed' | 'prior';
|
|
643
694
|
gap: number | null;
|
|
644
695
|
power: number;
|
|
696
|
+
by_world: ExperimentReportDetectableGapByWorld | null;
|
|
697
|
+
}
|
|
698
|
+
export interface ExperimentReportDetectableGapByWorld {
|
|
699
|
+
worlds: number;
|
|
700
|
+
gap: number | null;
|
|
645
701
|
}
|
|
646
702
|
export interface ExperimentReportDecision {
|
|
647
703
|
stop: boolean;
|
|
648
704
|
reason: string;
|
|
649
705
|
summary: string;
|
|
650
706
|
}
|
|
707
|
+
export interface ExperimentReportWhatDiffered {
|
|
708
|
+
arm: number;
|
|
709
|
+
label: string;
|
|
710
|
+
changes: string[];
|
|
711
|
+
}
|
|
651
712
|
/** The environment. Every field is optional; an omitted field takes the base world default. */
|
|
652
713
|
export interface Env {
|
|
653
714
|
/** World seed: fixes the map. Omit to draw a fresh one per run; the drawn seed is recorded on the run. */
|
|
@@ -690,6 +751,13 @@ export interface LaunchResponseBatch {
|
|
|
690
751
|
trials: number;
|
|
691
752
|
seed_mode: 'vary' | 'pinned';
|
|
692
753
|
}
|
|
754
|
+
export interface Study {
|
|
755
|
+
kind: 'experiment' | 'series';
|
|
756
|
+
id: string;
|
|
757
|
+
played: number;
|
|
758
|
+
published: number;
|
|
759
|
+
pending: number;
|
|
760
|
+
}
|
|
693
761
|
/** One method per API operation. The transport is the subclass's. */
|
|
694
762
|
export declare abstract class Operations {
|
|
695
763
|
protected abstract request<T>(method: Method, path: string, parts?: RequestParts): Promise<T>;
|
|
@@ -741,6 +809,14 @@ export declare abstract class Operations {
|
|
|
741
809
|
* @see https://daishi.ai/docs/developer/rest#ep-library-anchors
|
|
742
810
|
*/
|
|
743
811
|
libraryAnchors(): Promise<JsonObject>;
|
|
812
|
+
/**
|
|
813
|
+
* Studio templates.
|
|
814
|
+
*
|
|
815
|
+
* The ready-made studies the Studio’s New run page offers, word for word.
|
|
816
|
+
*
|
|
817
|
+
* @see https://daishi.ai/docs/developer/rest#ep-templates
|
|
818
|
+
*/
|
|
819
|
+
templates(): Promise<JsonObject>;
|
|
744
820
|
/**
|
|
745
821
|
* Validate a scenario.
|
|
746
822
|
*
|
|
@@ -848,12 +924,13 @@ export declare abstract class Operations {
|
|
|
848
924
|
/**
|
|
849
925
|
* List your runs.
|
|
850
926
|
*
|
|
851
|
-
* Your runs, newest first.
|
|
927
|
+
* Your runs, newest first, a page at a time.
|
|
852
928
|
*
|
|
853
929
|
* @see https://daishi.ai/docs/developer/rest#ep-list-runs
|
|
854
930
|
*/
|
|
855
931
|
listRuns(query?: {
|
|
856
932
|
limit?: number;
|
|
933
|
+
cursor?: string;
|
|
857
934
|
}): Promise<ListRunsResponse>;
|
|
858
935
|
/**
|
|
859
936
|
* Get a run.
|
|
@@ -871,6 +948,14 @@ export declare abstract class Operations {
|
|
|
871
948
|
* @see https://daishi.ai/docs/developer/rest#ep-usage
|
|
872
949
|
*/
|
|
873
950
|
usage(): Promise<JsonObject>;
|
|
951
|
+
/**
|
|
952
|
+
* Your models.
|
|
953
|
+
*
|
|
954
|
+
* Every finished run rolled up by model: the figures the Studio’s Models page draws.
|
|
955
|
+
*
|
|
956
|
+
* @see https://daishi.ai/docs/developer/rest#ep-models
|
|
957
|
+
*/
|
|
958
|
+
models(): Promise<JsonObject>;
|
|
874
959
|
/**
|
|
875
960
|
* Live worlds.
|
|
876
961
|
*
|
|
@@ -975,6 +1060,38 @@ export declare abstract class Operations {
|
|
|
975
1060
|
* @see https://daishi.ai/docs/developer/rest#ep-unpublish-run
|
|
976
1061
|
*/
|
|
977
1062
|
unpublishRun(id: string): Promise<UnpublishRunResponse>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Publish an experiment.
|
|
1065
|
+
*
|
|
1066
|
+
* List a whole paired experiment on your public profile in one call: every trial that played, in every arm.
|
|
1067
|
+
*
|
|
1068
|
+
* @see https://daishi.ai/docs/developer/rest#ep-publish-experiment
|
|
1069
|
+
*/
|
|
1070
|
+
publishExperiment(id: string, body: PublishExperimentBody): Promise<PublishExperimentResponse>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Unpublish an experiment.
|
|
1073
|
+
*
|
|
1074
|
+
* Take every trial of a paired experiment off your public profile.
|
|
1075
|
+
*
|
|
1076
|
+
* @see https://daishi.ai/docs/developer/rest#ep-unpublish-experiment
|
|
1077
|
+
*/
|
|
1078
|
+
unpublishExperiment(id: string): Promise<UnpublishExperimentResponse>;
|
|
1079
|
+
/**
|
|
1080
|
+
* Publish a series.
|
|
1081
|
+
*
|
|
1082
|
+
* List a whole series batch on your public profile in one call: every trial that played.
|
|
1083
|
+
*
|
|
1084
|
+
* @see https://daishi.ai/docs/developer/rest#ep-publish-batch
|
|
1085
|
+
*/
|
|
1086
|
+
publishBatch(id: string): Promise<PublishBatchResponse>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Unpublish a series.
|
|
1089
|
+
*
|
|
1090
|
+
* Take every trial of a series batch off your public profile.
|
|
1091
|
+
*
|
|
1092
|
+
* @see https://daishi.ai/docs/developer/rest#ep-unpublish-batch
|
|
1093
|
+
*/
|
|
1094
|
+
unpublishBatch(id: string): Promise<UnpublishBatchResponse>;
|
|
978
1095
|
/**
|
|
979
1096
|
* List a run’s logs.
|
|
980
1097
|
*
|
|
@@ -991,6 +1108,14 @@ export declare abstract class Operations {
|
|
|
991
1108
|
* @see https://daishi.ai/docs/developer/rest#ep-run-log
|
|
992
1109
|
*/
|
|
993
1110
|
runLog(id: string, file: string): Promise<string>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Read a run’s seats.
|
|
1113
|
+
*
|
|
1114
|
+
* Per seat: the debrief answer, voiced awareness, forfeited rounds with their causes, the harness that played it, and its trajectory file.
|
|
1115
|
+
*
|
|
1116
|
+
* @see https://daishi.ai/docs/developer/rest#ep-run-seats
|
|
1117
|
+
*/
|
|
1118
|
+
runSeats(id: string): Promise<JsonObject>;
|
|
994
1119
|
/**
|
|
995
1120
|
* List a run’s guest seats.
|
|
996
1121
|
*
|
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.
|
|
3
|
+
export declare const VERSION = "0.2.8";
|
|
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
|
+
export const VERSION = '0.2.8';
|
|
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