daishi-sdk 0.2.17 → 0.2.19
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 +103 -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_running' | 'bad_cancel_reason' | 'cancel_reason_fixed' | 'bad_replaced_by' | '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_launching' | 'design_late' | 'no_design' | 'no_creation_record' | 'experiment_effort_roster' | 'experiment_no_probe' | 'experiment_too_few_seats' | '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' | 'unknown_set' | 'unknown_setup' | 'bad_set' | 'set_full' | 'series_trial' | 'in_another_set' | 'guest_seats' | 'set_empty' | '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' | 'bad_loss_tolerance' | '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_running' | 'bad_cancel_reason' | 'cancel_reason_fixed' | 'bad_replaced_by' | '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_launching' | 'design_late' | 'no_design' | 'no_creation_record' | 'experiment_effort_roster' | 'experiment_no_probe' | 'experiment_too_few_seats' | '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' | 'unknown_set' | 'unknown_setup' | 'bad_set' | 'set_full' | 'series_trial' | 'in_another_set' | 'guest_seats' | 'set_empty' | '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>;
|
|
@@ -130,6 +130,9 @@ export interface Experiment {
|
|
|
130
130
|
pilot: boolean;
|
|
131
131
|
name_commit_min_hex: number;
|
|
132
132
|
creation_sha256: string | null;
|
|
133
|
+
loss_tolerance: number | null;
|
|
134
|
+
max_total_spend_usd: number | null;
|
|
135
|
+
seed_source: ExperimentSeedSource;
|
|
133
136
|
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' | 'witness_sensitivity' | 'compliance_rate' | 'compliance_latency' | 'injection_resistance' | 'output_tokens_per_turn' | 'said_evaluated' | 'aggression_between_seats_per_100_rounds' | 'trades_between_seats_per_100_rounds' | 'betrayals_per_100_rounds' | 'ring_share';
|
|
134
137
|
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' | 'witness_sensitivity' | 'compliance_rate' | 'compliance_latency' | 'injection_resistance' | 'output_tokens_per_turn' | 'said_evaluated' | 'aggression_between_seats_per_100_rounds' | 'trades_between_seats_per_100_rounds' | 'betrayals_per_100_rounds' | 'ring_share'>;
|
|
135
138
|
rule: StoppingRule;
|
|
@@ -164,16 +167,21 @@ export interface ExperimentReport {
|
|
|
164
167
|
pilot: boolean;
|
|
165
168
|
name_commit_min_hex: number;
|
|
166
169
|
creation_sha256: string | null;
|
|
170
|
+
seed_source: ExperimentSeedSource;
|
|
167
171
|
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' | 'witness_sensitivity' | 'compliance_rate' | 'compliance_latency' | 'injection_resistance' | 'output_tokens_per_turn' | 'said_evaluated' | 'aggression_between_seats_per_100_rounds' | 'trades_between_seats_per_100_rounds' | 'betrayals_per_100_rounds' | 'ring_share';
|
|
168
172
|
analysis_scale: 'metric' | 'negative_rank' | 'log';
|
|
169
173
|
rule: StoppingRule;
|
|
170
174
|
rule_text: string;
|
|
175
|
+
loss_tolerance: number | null;
|
|
176
|
+
max_total_spend_usd: number | null;
|
|
171
177
|
arms: ExperimentReportArm[];
|
|
172
178
|
pairs: ExperimentReportPair[];
|
|
173
179
|
comparisons: ExperimentReportComparison[];
|
|
174
180
|
secondary: ExperimentReportSecondary[];
|
|
175
181
|
detectable_gap: ExperimentReportDetectableGap;
|
|
176
182
|
decision: ExperimentReportDecision;
|
|
183
|
+
completeness: ExperimentReportCompleteness;
|
|
184
|
+
interference: ExperimentReportInterference;
|
|
177
185
|
verdict: string;
|
|
178
186
|
plain: string;
|
|
179
187
|
what_differed: ExperimentReportWhatDiffered[];
|
|
@@ -291,6 +299,10 @@ export interface ExperimentBody {
|
|
|
291
299
|
replicates?: string;
|
|
292
300
|
/** 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. */
|
|
293
301
|
max_spend_usd?: number;
|
|
302
|
+
/** The declared read: how many trials a comparison may lose before it reads incomplete and renders no verdict. A trial is lost when an arm’s trial failed or was cancelled, lost a seat to an error, stopped short of its season at its spend cap, was picked up mid-match by a new server release, or measured nothing on the metric. No lost trial is ever replaced and no trial is added: the design plays the trials it declared and reads what it has. From 0 up to the trials less three, the pairs a verdict needs (bad_loss_tolerance otherwise). Default: a tenth of the trials, rounded down. The experiment and its report carry it as loss_tolerance and print it in rule_text; a comparison past it reads reason incomplete with verdict null, and every comparison carries lost and, with lost pairs, tipping. */
|
|
303
|
+
loss_tolerance?: number;
|
|
304
|
+
/** The study’s spend cap in USD over every arm and trial, declared now. Once the trials played so far have spent it, nothing still in line starts: what is left is cancelled under the cap (never as your doing) and the experiment ends with stop_reason spend_cap; a trial already playing runs to its own per-run cap. The trials it stops count as lost against loss_tolerance. At least 0.5 (bad_spend_cap otherwise). Default none: each arm’s own max_spend_usd still bounds each trial. */
|
|
305
|
+
max_total_spend_usd?: number;
|
|
294
306
|
}
|
|
295
307
|
export interface ExperimentArm {
|
|
296
308
|
/** How the report names this arm. Default arm 1, arm 2, ...; labels must be distinct. */
|
|
@@ -746,6 +758,34 @@ export interface Cost {
|
|
|
746
758
|
total_usd: number;
|
|
747
759
|
agent_turns: number;
|
|
748
760
|
}
|
|
761
|
+
export interface ExperimentSeedSource {
|
|
762
|
+
kind: 'beacon' | 'server';
|
|
763
|
+
beacon: Beacon | null;
|
|
764
|
+
anchor: Anchor | null;
|
|
765
|
+
drawn_at_ms: number | null;
|
|
766
|
+
fallback: Fallback | null;
|
|
767
|
+
derivation: string | null;
|
|
768
|
+
}
|
|
769
|
+
export interface Beacon {
|
|
770
|
+
name: 'drand';
|
|
771
|
+
chain: string;
|
|
772
|
+
label: string;
|
|
773
|
+
world_draw: 'vary' | 'pinned' | 'none';
|
|
774
|
+
round: number | null;
|
|
775
|
+
round_at_ms: number | null;
|
|
776
|
+
randomness: string | null;
|
|
777
|
+
url: string | null;
|
|
778
|
+
}
|
|
779
|
+
export interface Anchor {
|
|
780
|
+
what: 'design' | 'creation';
|
|
781
|
+
sha256: string;
|
|
782
|
+
at_ms: number;
|
|
783
|
+
clock: 'rfc3161' | 'daishi';
|
|
784
|
+
}
|
|
785
|
+
export interface Fallback {
|
|
786
|
+
reason: string;
|
|
787
|
+
at_ms: number;
|
|
788
|
+
}
|
|
749
789
|
export interface StoppingRule {
|
|
750
790
|
kind: 'fixed' | 'anytime';
|
|
751
791
|
alpha: number;
|
|
@@ -793,6 +833,7 @@ export interface ExperimentReportArm {
|
|
|
793
833
|
agent_turns: number;
|
|
794
834
|
usage: JsonObject;
|
|
795
835
|
awareness: JsonObject;
|
|
836
|
+
health: ExperimentReportArmHealth;
|
|
796
837
|
effort?: ExperimentReportArmEffort;
|
|
797
838
|
contact?: ExperimentReportArmContact;
|
|
798
839
|
}
|
|
@@ -810,6 +851,26 @@ export interface ExperimentReportArmScore {
|
|
|
810
851
|
sd: number | null;
|
|
811
852
|
ci: Interval | null;
|
|
812
853
|
}
|
|
854
|
+
export interface ExperimentReportArmHealth {
|
|
855
|
+
measured_seats: number;
|
|
856
|
+
calls: number;
|
|
857
|
+
error_turns: number;
|
|
858
|
+
provider_retries: ExperimentReportArmHealthProviderRetries | null;
|
|
859
|
+
world_rejections: ExperimentReportArmHealthWorldRejections | null;
|
|
860
|
+
}
|
|
861
|
+
export interface ExperimentReportArmHealthProviderRetries {
|
|
862
|
+
seats: number;
|
|
863
|
+
calls: number;
|
|
864
|
+
retries: number;
|
|
865
|
+
wait_ms: number;
|
|
866
|
+
causes: JsonObject;
|
|
867
|
+
}
|
|
868
|
+
export interface ExperimentReportArmHealthWorldRejections {
|
|
869
|
+
seats: number;
|
|
870
|
+
turn_budget: number;
|
|
871
|
+
pace: number;
|
|
872
|
+
invalid: number;
|
|
873
|
+
}
|
|
813
874
|
export interface ExperimentReportArmEffort {
|
|
814
875
|
measured_seats: number;
|
|
815
876
|
short_seats: number;
|
|
@@ -857,6 +918,8 @@ export interface ExperimentReportComparison {
|
|
|
857
918
|
detail: string;
|
|
858
919
|
exact: ExactCheck | null;
|
|
859
920
|
by_world: WorldReading | null;
|
|
921
|
+
lost: number;
|
|
922
|
+
tipping: ExperimentReportComparisonTipping | null;
|
|
860
923
|
}
|
|
861
924
|
export interface ExactCheck {
|
|
862
925
|
unit: 'pair' | 'world';
|
|
@@ -869,6 +932,19 @@ export interface WorldReading {
|
|
|
869
932
|
repeated: number;
|
|
870
933
|
interval: Interval | null;
|
|
871
934
|
}
|
|
935
|
+
export interface ExperimentReportComparisonTipping {
|
|
936
|
+
lost: number;
|
|
937
|
+
pairs: number;
|
|
938
|
+
against: 'arm_better' | 'control_better' | 'undecided';
|
|
939
|
+
to_undo: number | null;
|
|
940
|
+
to_decide: ExperimentReportComparisonTippingToDecide | null;
|
|
941
|
+
widest_seen: number;
|
|
942
|
+
text: string;
|
|
943
|
+
}
|
|
944
|
+
export interface ExperimentReportComparisonTippingToDecide {
|
|
945
|
+
arm: number | null;
|
|
946
|
+
control: number | null;
|
|
947
|
+
}
|
|
872
948
|
export interface ExperimentReportSecondary {
|
|
873
949
|
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' | 'witness_sensitivity' | 'compliance_rate' | 'compliance_latency' | 'injection_resistance' | 'output_tokens_per_turn' | 'said_evaluated' | 'aggression_between_seats_per_100_rounds' | 'trades_between_seats_per_100_rounds' | 'betrayals_per_100_rounds' | 'ring_share';
|
|
874
950
|
analysis_scale: 'metric' | 'negative_rank' | 'log';
|
|
@@ -915,6 +991,32 @@ export interface ExperimentReportDecision {
|
|
|
915
991
|
reason: string;
|
|
916
992
|
summary: string;
|
|
917
993
|
}
|
|
994
|
+
export interface ExperimentReportCompleteness {
|
|
995
|
+
state: 'complete' | 'incomplete' | 'pending';
|
|
996
|
+
why: 'losses' | 'spend_cap' | 'cancelled' | null;
|
|
997
|
+
trials: number;
|
|
998
|
+
loss_tolerance: number | null;
|
|
999
|
+
lost: number;
|
|
1000
|
+
spend: ExperimentReportCompletenessSpend;
|
|
1001
|
+
text: string;
|
|
1002
|
+
}
|
|
1003
|
+
export interface ExperimentReportCompletenessSpend {
|
|
1004
|
+
cap_usd: number | null;
|
|
1005
|
+
spent_usd: number;
|
|
1006
|
+
reached: boolean;
|
|
1007
|
+
}
|
|
1008
|
+
export interface ExperimentReportInterference {
|
|
1009
|
+
per_arm: ExperimentReportInterferencePerArm[];
|
|
1010
|
+
reading: 'alike' | 'uneven' | 'unread';
|
|
1011
|
+
text: string;
|
|
1012
|
+
}
|
|
1013
|
+
export interface ExperimentReportInterferencePerArm {
|
|
1014
|
+
arm: number;
|
|
1015
|
+
label: string;
|
|
1016
|
+
calls: number;
|
|
1017
|
+
retries: number;
|
|
1018
|
+
per_100_calls: number | null;
|
|
1019
|
+
}
|
|
918
1020
|
export interface ExperimentReportWhatDiffered {
|
|
919
1021
|
arm: number;
|
|
920
1022
|
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
|
+
export declare const VERSION = "0.2.19";
|
|
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.19';
|
|
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