daishi-sdk 0.1.0 → 0.2.0
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 +31 -1
- package/dist/generated.js +20 -0
- 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' | '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' | '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' | '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>;
|
|
@@ -343,6 +343,20 @@ export interface CancelResponse {
|
|
|
343
343
|
ok: boolean;
|
|
344
344
|
run: Run;
|
|
345
345
|
}
|
|
346
|
+
export interface PublishRunBody {
|
|
347
|
+
/** The write-up shown beside the run. Omitted: the run keeps the note it has. "" or null: no note. */
|
|
348
|
+
note?: string | null;
|
|
349
|
+
}
|
|
350
|
+
export interface PublishRunResponse {
|
|
351
|
+
ok: boolean;
|
|
352
|
+
run: Run;
|
|
353
|
+
profile_url: string | null;
|
|
354
|
+
}
|
|
355
|
+
export interface UnpublishRunResponse {
|
|
356
|
+
ok: boolean;
|
|
357
|
+
run: Run;
|
|
358
|
+
profile_url: string | null;
|
|
359
|
+
}
|
|
346
360
|
export interface ExtendInvitesBody {
|
|
347
361
|
/** The new deadline, minutes from now, for every open seat. */
|
|
348
362
|
minutes: number;
|
|
@@ -819,6 +833,22 @@ export declare abstract class Operations {
|
|
|
819
833
|
* @see https://daishi.ai/docs/developer/rest#ep-cancel
|
|
820
834
|
*/
|
|
821
835
|
cancel(id: string): Promise<CancelResponse>;
|
|
836
|
+
/**
|
|
837
|
+
* Publish a run.
|
|
838
|
+
*
|
|
839
|
+
* List one of your runs on your public profile, with an optional write-up.
|
|
840
|
+
*
|
|
841
|
+
* @see https://daishi.ai/docs/developer/rest#ep-publish-run
|
|
842
|
+
*/
|
|
843
|
+
publishRun(id: string, body: PublishRunBody): Promise<PublishRunResponse>;
|
|
844
|
+
/**
|
|
845
|
+
* Unpublish a run.
|
|
846
|
+
*
|
|
847
|
+
* Take one of your runs off your public profile.
|
|
848
|
+
*
|
|
849
|
+
* @see https://daishi.ai/docs/developer/rest#ep-unpublish-run
|
|
850
|
+
*/
|
|
851
|
+
unpublishRun(id: string): Promise<UnpublishRunResponse>;
|
|
822
852
|
/**
|
|
823
853
|
* List a run’s logs.
|
|
824
854
|
*
|
package/dist/generated.js
CHANGED
|
@@ -304,6 +304,26 @@ export class Operations {
|
|
|
304
304
|
cancel(id) {
|
|
305
305
|
return this.request('POST', `/runs/${encodeURIComponent(id)}/cancel`);
|
|
306
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Publish a run.
|
|
309
|
+
*
|
|
310
|
+
* List one of your runs on your public profile, with an optional write-up.
|
|
311
|
+
*
|
|
312
|
+
* @see https://daishi.ai/docs/developer/rest#ep-publish-run
|
|
313
|
+
*/
|
|
314
|
+
publishRun(id, body) {
|
|
315
|
+
return this.request('POST', `/runs/${encodeURIComponent(id)}/publish`, { body });
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Unpublish a run.
|
|
319
|
+
*
|
|
320
|
+
* Take one of your runs off your public profile.
|
|
321
|
+
*
|
|
322
|
+
* @see https://daishi.ai/docs/developer/rest#ep-unpublish-run
|
|
323
|
+
*/
|
|
324
|
+
unpublishRun(id) {
|
|
325
|
+
return this.request('POST', `/runs/${encodeURIComponent(id)}/unpublish`);
|
|
326
|
+
}
|
|
307
327
|
/**
|
|
308
328
|
* List a run’s logs.
|
|
309
329
|
*
|
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.
|
|
3
|
+
export declare const VERSION = "0.2.0";
|
|
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.
|
|
3
|
+
export const VERSION = '0.2.0';
|
|
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