@inferencesh/sdk 0.18.0 → 0.20.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/README.md CHANGED
@@ -557,7 +557,6 @@ Runs a task on inference.sh.
557
557
  | `params.input` | `object` | Yes | Input parameters for the app |
558
558
  | `params.setup` | `object` | No | Setup parameters (affects worker warmth/scheduling) |
559
559
  | `params.infra` | `string` | No | Infrastructure: `'cloud'` or `'private'` |
560
- | `params.variant` | `string` | No | App variant to use |
561
560
  | `params.session` | `string` | No | Session ID or `'new'` to start a new session |
562
561
  | `params.session_timeout` | `number` | No | Session timeout in seconds (1-3600, only with `session: 'new'`) |
563
562
 
@@ -1,6 +1,6 @@
1
1
  import { HttpClient } from '../http/client';
2
2
  import type { Response } from '../http/response';
3
- import { TaskDTO as Task, TaskLogsDTO, TaskTimingsDTO, ApiAppRunRequest, TaskResultDTO, CursorListRequest, CursorListResponse } from '../types';
3
+ import { TaskDTO as Task, TaskLogsDTO, TaskTimingsDTO, ApiAppRunRequest, TaskResultDTO, CursorListRequest, CursorListResponse, TaskFileDTO, DeleteTaskFilesResponse } from '../types';
4
4
  /** How to follow a task while it runs; see TasksAPI.watch. */
5
5
  export interface WatchOptions {
6
6
  /** Callback for real-time status updates */
@@ -50,9 +50,21 @@ export declare class TasksAPI {
50
50
  */
51
51
  create(data: ApiAppRunRequest): Promise<Response<TaskResultDTO>>;
52
52
  /**
53
- * Delete a task
53
+ * Delete a task. With `files: true` its input and output files are
54
+ * deleted too, even when something else still uses them.
54
55
  */
55
- delete(taskId: string): Promise<Response<void>>;
56
+ delete(taskId: string, options?: {
57
+ files?: boolean;
58
+ }): Promise<Response<void>>;
59
+ /**
60
+ * List the files a task consumed and produced. `role` narrows it to one side.
61
+ */
62
+ files(taskId: string, role?: 'input' | 'output'): Promise<Response<TaskFileDTO[]>>;
63
+ /**
64
+ * Delete a task's files and keep the task. The task must be finished.
65
+ * A file is deleted even when something else still uses it.
66
+ */
67
+ deleteFiles(taskId: string, role?: 'input' | 'output'): Promise<Response<DeleteTaskFilesResponse>>;
56
68
  /**
57
69
  * Cancel a running task
58
70
  */
package/dist/api/tasks.js CHANGED
@@ -50,10 +50,26 @@ export class TasksAPI {
50
50
  return this.http.request('post', '/apps/run', { data });
51
51
  }
52
52
  /**
53
- * Delete a task
53
+ * Delete a task. With `files: true` its input and output files are
54
+ * deleted too, even when something else still uses them.
54
55
  */
55
- async delete(taskId) {
56
- return this.http.request('delete', `/tasks/${taskId}`);
56
+ async delete(taskId, options) {
57
+ return this.http.request('delete', `/tasks/${taskId}`, {
58
+ params: options?.files ? { files: true } : undefined,
59
+ });
60
+ }
61
+ /**
62
+ * List the files a task consumed and produced. `role` narrows it to one side.
63
+ */
64
+ async files(taskId, role) {
65
+ return this.http.request('get', `/tasks/${taskId}/files`, { params: { role } });
66
+ }
67
+ /**
68
+ * Delete a task's files and keep the task. The task must be finished.
69
+ * A file is deleted even when something else still uses it.
70
+ */
71
+ async deleteFiles(taskId, role) {
72
+ return this.http.request('delete', `/tasks/${taskId}/files`, { params: { role } });
57
73
  }
58
74
  /**
59
75
  * Cancel a running task
package/dist/types.d.ts CHANGED
@@ -461,9 +461,6 @@ export interface AppVersionInput {
461
461
  [key: string]: AppFunction;
462
462
  };
463
463
  default_function?: string;
464
- variants?: {
465
- [key: string]: AppVariant;
466
- };
467
464
  env?: {
468
465
  [key: string]: string;
469
466
  };
@@ -1170,18 +1167,6 @@ export interface AppResources {
1170
1167
  gpu: AppGPUResource;
1171
1168
  ram: number;
1172
1169
  }
1173
- /**
1174
- * AppVariant is a named resource/env configuration variant.
1175
- */
1176
- export interface AppVariant {
1177
- name: string;
1178
- order: number;
1179
- resources: AppResources;
1180
- env: {
1181
- [key: string]: string;
1182
- };
1183
- python: string;
1184
- }
1185
1170
  /**
1186
1171
  * SecretRequirement defines a secret that an app requires to run.
1187
1172
  */
@@ -1240,6 +1225,23 @@ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1240
1225
  status: AppStatus;
1241
1226
  status_message?: string;
1242
1227
  status_changed_at?: string;
1228
+ /**
1229
+ * ResolvedFunction is the function the requested ref named, when it named
1230
+ * one: "ns/app:fn" in the ref itself, or a route on the name that pins a
1231
+ * function (a retired dialogue app routed to "ns/new-app:dialogue"). Only
1232
+ * set on a lookup by ref; empty means the caller picks, starting from the
1233
+ * version's default.
1234
+ */
1235
+ resolved_function?: string;
1236
+ }
1237
+ /**
1238
+ * AppUIRef names the artifact an app version renders as its UI: a page a
1239
+ * host shows beside the task in place of the generic output view. Artifact
1240
+ * is a ref ("ns/name", or "ns/name@version" to pin one) or an artifact id;
1241
+ * an unpinned ref follows the artifact's current version.
1242
+ */
1243
+ export interface AppUIRef {
1244
+ artifact: string;
1243
1245
  }
1244
1246
  /**
1245
1247
  * AppVersionDTO is the API response for an app version.
@@ -1248,6 +1250,10 @@ export interface AppVersionDTO extends BaseModelDTO {
1248
1250
  metadata: {
1249
1251
  [key: string]: any;
1250
1252
  };
1253
+ /**
1254
+ * UI mirrors metadata.ui so clients need not dig through the map.
1255
+ */
1256
+ ui?: AppUIRef;
1251
1257
  repository: string;
1252
1258
  flow_version_id?: string;
1253
1259
  flow_version?: FlowVersionDTO;
@@ -1258,9 +1264,6 @@ export interface AppVersionDTO extends BaseModelDTO {
1258
1264
  [key: string]: AppFunction;
1259
1265
  };
1260
1266
  default_function?: string;
1261
- variants: {
1262
- [key: string]: AppVariant;
1263
- };
1264
1267
  env: {
1265
1268
  [key: string]: string;
1266
1269
  };
@@ -1724,11 +1727,16 @@ export interface BountyProgramDTO extends BaseModelDTO, PermissionModelDTO {
1724
1727
  max_per_user: number;
1725
1728
  max_per_day: number;
1726
1729
  proof_type: string;
1727
- proof_min_length: number;
1730
+ /**
1731
+ * ProofForm is the form (namespace/name) a "form" program takes a
1732
+ * submission to as proof; empty for every other proof type.
1733
+ */
1734
+ proof_form: string;
1728
1735
  /**
1729
1736
  * RequiresPaymentMethod withholds the reward until the claimant's team has
1730
- * a saved payment method. The claim itself is refused with 402
1731
- * payment_method_required (survey answers are still recorded).
1737
+ * a saved payment method. The claim is refused with 402
1738
+ * payment_method_required and no claim is recorded, so it can be retried
1739
+ * once a card is on file.
1732
1740
  */
1733
1741
  requires_payment_method: boolean;
1734
1742
  status: string;
@@ -1750,7 +1758,10 @@ export interface BountySubmissionDTO extends BaseModelDTO, PermissionModelDTO {
1750
1758
  source?: string;
1751
1759
  }
1752
1760
  /**
1753
- * SubmitBountyRequest is used to claim a bounty reward.
1761
+ * SubmitBountyRequest is used to claim a bounty reward. proof_id names the
1762
+ * proof the program's proof_type asks for: an app (id or namespace/name) for
1763
+ * "app", one of the caller's form submission ids for "form", free text
1764
+ * otherwise.
1754
1765
  */
1755
1766
  export interface SubmitBountyRequest {
1756
1767
  bounty_id: string;
@@ -1894,6 +1905,13 @@ export interface ChatMessageDTO extends BaseModelDTO, PermissionModelDTO {
1894
1905
  export interface PolicyRuleDTO {
1895
1906
  id: string;
1896
1907
  effect: PolicyEffect;
1908
+ /**
1909
+ * Enforcement: default (decides unless a more specific admin layer has
1910
+ * a rule matching the call), enforced (an admin rule that is final),
1911
+ * evaluate (never decides; the decision feed shows what it would have
1912
+ * done) or disabled (kept, ignored).
1913
+ */
1914
+ enforcement: PolicyEnforcement;
1897
1915
  /**
1898
1916
  * Kind: what the rule governs (RemoteExec, Workspace, Harness, Tool,
1899
1917
  * and the usage kinds App, Agent, Knowledge, Mcp, Flow).
@@ -1908,12 +1926,15 @@ export interface PolicyRuleDTO {
1908
1926
  * Specifier is the kind's pattern: a command (`npm test`, `git push:*`),
1909
1927
  * a folder (`~/proj/**`), a harness tool with its pattern
1910
1928
  * (`Bash(git status:*)`, `Edit`), or a loop tool's name. Empty is the
1911
- * whole kind.
1929
+ * whole kind. A usage kind's names a resource by id, or everything a
1930
+ * publisher owns as publisher:<team id>.
1912
1931
  */
1913
1932
  specifier: string;
1914
1933
  /**
1915
1934
  * Label is the rule in words, e.g. "git commit commands on Laptop", the
1916
- * same words an approval prompt's "always allow" options use.
1935
+ * same words an approval prompt's "always allow" options use. A usage
1936
+ * rule's is the name it was written with ("bytedance/seedance",
1937
+ * "bytedance/*").
1917
1938
  */
1918
1939
  label: string;
1919
1940
  /**
@@ -2350,17 +2371,63 @@ export interface EntitlementErrorMeta {
2350
2371
  limit?: number;
2351
2372
  current?: number;
2352
2373
  upgrade_available: boolean;
2374
+ requestable: boolean;
2375
+ request_state?: string;
2353
2376
  addon_plan_id?: string;
2354
2377
  addon_plan_name?: string;
2355
2378
  addon_plan_price?: number;
2356
2379
  }
2380
+ /**
2381
+ * EntitlementRequestDTO is a team's request for an entitlement, with the
2382
+ * form submission that came with it when there was one, so the admin queue
2383
+ * shows the answers next to the decision.
2384
+ */
2385
+ export interface EntitlementRequestDTO extends BaseModelDTO, PermissionModelDTO {
2386
+ resource: EntitlementResource;
2387
+ resource_label?: string;
2388
+ requested: any;
2389
+ submission_id?: string;
2390
+ submission?: FormSubmissionDTO;
2391
+ state: EntitlementRequestState;
2392
+ decided_by?: string;
2393
+ decided_at?: string;
2394
+ note?: string;
2395
+ }
2396
+ /**
2397
+ * EntitlementRequested is the shape of a request's "requested" field and of
2398
+ * the grant an acceptance makes: a boolean gate switched on, or a limit.
2399
+ */
2400
+ export interface EntitlementRequested {
2401
+ type: EntitlementType;
2402
+ enabled?: boolean;
2403
+ limit?: number;
2404
+ }
2405
+ /**
2406
+ * CreateEntitlementRequestRequest asks for a resource on behalf of the
2407
+ * caller's team. requested defaults to a switched-on boolean gate. form
2408
+ * (namespace/name or id) with data submits that form first and attaches
2409
+ * the submission; the form's own policy and validation errors apply.
2410
+ */
2411
+ export interface CreateEntitlementRequestRequest {
2412
+ resource: EntitlementResource;
2413
+ requested?: any;
2414
+ form?: string;
2415
+ data?: any;
2416
+ }
2417
+ /**
2418
+ * DecideEntitlementRequestRequest is an admin's accept or decline; the note
2419
+ * reaches the requester by email.
2420
+ */
2421
+ export interface DecideEntitlementRequestRequest {
2422
+ note?: string;
2423
+ }
2357
2424
  /**
2358
2425
  * ErrorCode is the machine-readable error code of an API error: the last
2359
2426
  * segment of the problem+json type URI (https://api.inference.sh/errors/<code>)
2360
2427
  * and APIError.Code on the legacy envelope. Clients branch on these, so a
2361
2428
  * code is a named const here, where it generates into models and the SDKs.
2362
2429
  */
2363
- export type ErrorCode = "invalid_request" | "validation_error" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "name_conflict" | "already_exists" | "not_configured" | "method_not_allowed" | "rate_limited" | "internal_error" | "team_role_required" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "mcp_auth_expired" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
2430
+ export type ErrorCode = "invalid_request" | "validation_error" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "name_conflict" | "already_exists" | "not_configured" | "method_not_allowed" | "rate_limited" | "internal_error" | "team_role_required" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "mcp_auth_expired" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "already_claimed" | "already_entitled" | "request_open" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
2364
2431
  export declare const ErrorCodeInvalidRequest: ErrorCode;
2365
2432
  export declare const ErrorCodeValidationError: ErrorCode;
2366
2433
  export declare const ErrorCodeUnauthorized: ErrorCode;
@@ -2420,6 +2487,23 @@ export declare const ErrorCodePaymentRequired: ErrorCode;
2420
2487
  * PaymentMethodRequiredMeta; clients send the user to BillingPage.
2421
2488
  */
2422
2489
  export declare const ErrorCodePaymentMethodRequired: ErrorCode;
2490
+ /**
2491
+ * Form submissions (409): the form is not open, or its submit policy
2492
+ * already holds the caller's submission.
2493
+ */
2494
+ export declare const ErrorCodeFormClosed: ErrorCode;
2495
+ export declare const ErrorCodeAlreadySubmitted: ErrorCode;
2496
+ /**
2497
+ * Bounty claims (409): the caller already claimed this proof, or as many
2498
+ * times as the program allows.
2499
+ */
2500
+ export declare const ErrorCodeAlreadyClaimed: ErrorCode;
2501
+ /**
2502
+ * Entitlement requests (409): the team already holds the entitlement, or
2503
+ * already has an open request for it.
2504
+ */
2505
+ export declare const ErrorCodeAlreadyEntitled: ErrorCode;
2506
+ export declare const ErrorCodeRequestOpen: ErrorCode;
2423
2507
  /**
2424
2508
  * Remote harness refusals.
2425
2509
  */
@@ -2475,6 +2559,38 @@ export interface FileDTO extends BaseModelDTO, PermissionModelDTO {
2475
2559
  rating: ContentRating;
2476
2560
  metadata?: FileMetadata;
2477
2561
  }
2562
+ /**
2563
+ * TaskFileRole says how a task relates to a file.
2564
+ */
2565
+ export type TaskFileRole = "input" | "output";
2566
+ export declare const TaskFileRoleInput: TaskFileRole;
2567
+ export declare const TaskFileRoleOutput: TaskFileRole;
2568
+ /**
2569
+ * TaskFileDTO is one file attached to a task, as GET /tasks/{id}/files lists it.
2570
+ */
2571
+ export interface TaskFileDTO {
2572
+ id: string;
2573
+ created_at: string;
2574
+ role: TaskFileRole;
2575
+ uri: string;
2576
+ filename: string;
2577
+ content_type: string;
2578
+ size: number;
2579
+ }
2580
+ /**
2581
+ * TaskFileSkipped is a file DELETE /tasks/{id}/files left in place.
2582
+ */
2583
+ export interface TaskFileSkipped {
2584
+ id: string;
2585
+ reason: string;
2586
+ }
2587
+ /**
2588
+ * DeleteTaskFilesResponse reports what DELETE /tasks/{id}/files did.
2589
+ */
2590
+ export interface DeleteTaskFilesResponse {
2591
+ deleted: string[];
2592
+ skipped: TaskFileSkipped[];
2593
+ }
2478
2594
  /**
2479
2595
  * FlowNodeData describes a node's data within a flow
2480
2596
  */
@@ -2757,6 +2873,100 @@ export interface RenameOutputFieldPayload {
2757
2873
  old_field: string;
2758
2874
  new_field: string;
2759
2875
  }
2876
+ /**
2877
+ * FormDTO is the API representation of a form: a JSON Schema plus the
2878
+ * settings that say who may submit, and how often.
2879
+ */
2880
+ export interface FormDTO extends BaseModelDTO, PermissionModelDTO {
2881
+ namespace: string;
2882
+ name: string;
2883
+ title: string;
2884
+ description: string;
2885
+ schema: any;
2886
+ status: FormStatus;
2887
+ submit_policy: FormSubmitPolicy;
2888
+ }
2889
+ /**
2890
+ * FormSubmissionDTO is one set of answers to a form.
2891
+ */
2892
+ export interface FormSubmissionDTO extends BaseModelDTO, PermissionModelDTO {
2893
+ form_id: string;
2894
+ form_team_id: string;
2895
+ submitter_team_id?: string;
2896
+ data: any;
2897
+ source?: string;
2898
+ agent?: string;
2899
+ context?: string;
2900
+ }
2901
+ /**
2902
+ * CreateFormRequest creates a form in the caller's team namespace. The name
2903
+ * is the immutable slug behind GET /forms/{namespace}/{name}.
2904
+ */
2905
+ export interface CreateFormRequest {
2906
+ name: string;
2907
+ title: string;
2908
+ description?: string;
2909
+ schema?: any;
2910
+ submit_policy?: FormSubmitPolicy;
2911
+ visibility?: Visibility;
2912
+ }
2913
+ /**
2914
+ * UpdateFormRequest patches a form; nil fields are left as they are.
2915
+ */
2916
+ export interface UpdateFormRequest {
2917
+ title?: string;
2918
+ description?: string;
2919
+ schema?: any;
2920
+ status?: FormStatus;
2921
+ submit_policy?: FormSubmitPolicy;
2922
+ }
2923
+ /**
2924
+ * SubmitFormRequest is one person's answers to a form. data is validated
2925
+ * against the form's schema.
2926
+ */
2927
+ export interface SubmitFormRequest {
2928
+ data: any;
2929
+ source?: string;
2930
+ agent?: string;
2931
+ context?: string;
2932
+ }
2933
+ /**
2934
+ * SubmitFormResponse is returned when a submission was recorded.
2935
+ */
2936
+ export interface SubmitFormResponse {
2937
+ submission: FormSubmissionDTO;
2938
+ }
2939
+ /**
2940
+ * SurveyResponseDTO is the API representation of a survey response.
2941
+ */
2942
+ export interface SurveyResponseDTO extends BaseModelDTO, PermissionModelDTO {
2943
+ question_id: string;
2944
+ response: string;
2945
+ agent?: string;
2946
+ source?: string;
2947
+ context?: string;
2948
+ }
2949
+ /**
2950
+ * SubmitSurveyResponse is returned when submitting a survey answer.
2951
+ * GrantedAmount and RewardBlockedReason are kept for the CLIs that read
2952
+ * them; the alias records answers only, so they are always 0 and empty.
2953
+ * Bounties are claimed through POST /me/bounty.
2954
+ */
2955
+ export interface SubmitSurveyResponse {
2956
+ response: SurveyResponseDTO;
2957
+ granted_amount?: number;
2958
+ reward_blocked_reason?: string;
2959
+ }
2960
+ /**
2961
+ * SubmitSurveyRequest is used to submit a single survey answer.
2962
+ */
2963
+ export interface SubmitSurveyRequest {
2964
+ question_id: string;
2965
+ response: string;
2966
+ agent?: string;
2967
+ source?: string;
2968
+ context?: string;
2969
+ }
2760
2970
  /**
2761
2971
  * GraphNodeDTO is the API representation of a graph node
2762
2972
  */
@@ -3169,6 +3379,9 @@ export interface ResourceContent {
3169
3379
  mimeType?: string;
3170
3380
  text?: string;
3171
3381
  blob?: string;
3382
+ _meta?: {
3383
+ [key: string]: any;
3384
+ };
3172
3385
  }
3173
3386
  /**
3174
3387
  * ToolCallRequest represents a request to call a tool.
@@ -3879,37 +4092,6 @@ export interface SubscriptionDTO extends BaseModelDTO {
3879
4092
  cancel_at_period_end: boolean;
3880
4093
  credits_per_period: number;
3881
4094
  }
3882
- /**
3883
- * SurveyResponseDTO is the API representation of a survey response.
3884
- */
3885
- export interface SurveyResponseDTO extends BaseModelDTO, PermissionModelDTO {
3886
- question_id: string;
3887
- response: string;
3888
- agent?: string;
3889
- source?: string;
3890
- context?: string;
3891
- }
3892
- /**
3893
- * SubmitSurveyResponse is returned when submitting a survey answer.
3894
- * GrantedAmount is the credit reward in microcents (0 if no reward was earned).
3895
- * RewardBlockedReason is set when the answer was recorded but the reward was
3896
- * withheld by policy (see RewardBlockedPaymentMethodRequired).
3897
- */
3898
- export interface SubmitSurveyResponse {
3899
- response: SurveyResponseDTO;
3900
- granted_amount?: number;
3901
- reward_blocked_reason?: string;
3902
- }
3903
- /**
3904
- * SubmitSurveyRequest is used to submit a single survey answer.
3905
- */
3906
- export interface SubmitSurveyRequest {
3907
- question_id: string;
3908
- response: string;
3909
- agent?: string;
3910
- source?: string;
3911
- context?: string;
3912
- }
3913
4095
  /**
3914
4096
  * Hardware/System related types
3915
4097
  */
@@ -4053,7 +4235,6 @@ export interface TaskDTO extends BaseModelDTO, PermissionModelDTO {
4053
4235
  app?: AppDTO;
4054
4236
  app_version_id: string;
4055
4237
  app_version?: AppVersionDTO;
4056
- app_variant: string;
4057
4238
  function: string;
4058
4239
  infra: Infra;
4059
4240
  workers: string[];
@@ -4379,6 +4560,10 @@ export interface UserRelationDTO {
4379
4560
  created_at: string;
4380
4561
  updated_at: string;
4381
4562
  role: Role;
4563
+ /**
4564
+ * Name is omitted when empty so older generated copies of this DTO stay assignable.
4565
+ */
4566
+ name?: string;
4382
4567
  avatar_url: string;
4383
4568
  }
4384
4569
  /**
@@ -4399,7 +4584,7 @@ export interface UserMetadataDTO {
4399
4584
  * Alias of shared.A2UISurface so the type generation pipeline picks it up.
4400
4585
  */
4401
4586
  export type Widget = A2UISurface;
4402
- export type A2UIComponentType = "Row" | "Column" | "List" | "Text" | "Image" | "Icon" | "Divider" | "Button" | "TextField" | "CheckBox" | "Slider" | "DateTimeInput" | "ChoicePicker" | "Card" | "Modal" | "Tabs" | "Badge" | "Spacer" | "Chart" | "Form" | "Artifact";
4587
+ export type A2UIComponentType = "Row" | "Column" | "List" | "Text" | "Image" | "Icon" | "Divider" | "Button" | "TextField" | "CheckBox" | "Slider" | "DateTimeInput" | "ChoicePicker" | "Card" | "Modal" | "Tabs" | "Badge" | "Spacer" | "Chart" | "Form" | "Artifact" | "McpApp";
4403
4588
  export declare const A2UIRow: A2UIComponentType;
4404
4589
  export declare const A2UIColumn: A2UIComponentType;
4405
4590
  export declare const A2UIList: A2UIComponentType;
@@ -4428,6 +4613,12 @@ export declare const A2UIForm: A2UIComponentType;
4428
4613
  * the viewer. Rendered from the artifact's /render endpoint.
4429
4614
  */
4430
4615
  export declare const A2UIArtifact: A2UIComponentType;
4616
+ /**
4617
+ * McpApp embeds a remote MCP server's tool page (MCP Apps, SEP-1865): a
4618
+ * sandboxed HTML document the host feeds the tool's input and result over
4619
+ * postMessage, and whose tools/call requests it proxies to the server.
4620
+ */
4621
+ export declare const A2UIMcpApp: A2UIComponentType;
4431
4622
  /**
4432
4623
  * A2UIComponent is the universal component representation.
4433
4624
  * Children are string IDs (flat adjacency list), not nested objects.
@@ -4538,6 +4729,59 @@ export interface A2UIComponent {
4538
4729
  artifactTitle?: string;
4539
4730
  artifactUrl?: string;
4540
4731
  artifactFavicon?: string;
4732
+ /**
4733
+ * Extension: McpApp. A remote server's page is named by McpPageHash and
4734
+ * read from GET /mcp-ui-pages/{hash}, so a chat that runs a tool many
4735
+ * times holds one copy of its page, not one per message. McpHtml carries
4736
+ * the page inline instead: an artifact's page, a component written
4737
+ * before pages were stored by hash, or a page that could not be stored.
4738
+ * The server, credential and tool name let the host route the page's
4739
+ * tools/call requests.
4740
+ */
4741
+ mcpHtml?: string;
4742
+ mcpPageHash?: string;
4743
+ mcpCsp?: MCPUICSP;
4744
+ mcpResourceUri?: string;
4745
+ mcpServerSlug?: string;
4746
+ mcpCredentialId?: string;
4747
+ mcpToolName?: string;
4748
+ mcpToolInput?: {
4749
+ [key: string]: any;
4750
+ };
4751
+ mcpToolResult?: A2UIMcpToolResult;
4752
+ mcpPrefersBorder?: boolean;
4753
+ /**
4754
+ * McpArtifactId is set when the page is one of our artifacts (an app's
4755
+ * own UI) rather than a remote server's: the host then serves the page's
4756
+ * runtime calls through the artifact's data endpoints, not /mcps.
4757
+ */
4758
+ mcpArtifactId?: string;
4759
+ }
4760
+ /**
4761
+ * MCPUICSP is an MCP Apps resource's _meta.ui.csp: the origins the host must
4762
+ * let the page reach, by directive. Lives here rather than in apitypes
4763
+ * because A2UI components carry it and apitypes imports this package.
4764
+ */
4765
+ export interface MCPUICSP {
4766
+ connectDomains?: string[];
4767
+ resourceDomains?: string[];
4768
+ frameDomains?: string[];
4769
+ baseUriDomains?: string[];
4770
+ }
4771
+ /**
4772
+ * A2UIMcpToolResult is the tool result in the shape the page expects
4773
+ * (ui/notifications/tool-result carries a CallToolResult): the content blocks
4774
+ * as the server sent them, not the platform's mapped output.
4775
+ */
4776
+ export interface A2UIMcpToolResult {
4777
+ content: {
4778
+ [key: string]: any;
4779
+ }[];
4780
+ structuredContent?: any;
4781
+ isError?: boolean;
4782
+ _meta?: {
4783
+ [key: string]: any;
4784
+ };
4541
4785
  }
4542
4786
  export type A2UIBound = string | number | boolean | A2UIBoundValue;
4543
4787
  /**
@@ -4670,6 +4914,16 @@ export declare const EntitlementScopeMember: EntitlementScope;
4670
4914
  export type EnforcementMode = "block" | "warn";
4671
4915
  export declare const EnforcementBlock: EnforcementMode;
4672
4916
  export declare const EnforcementWarn: EnforcementMode;
4917
+ /**
4918
+ * EntitlementRequestState is where a team's request for an entitlement
4919
+ * stands. A team holds at most one open request per resource; an admin
4920
+ * accepts (which grants) or declines it, or the team withdraws it.
4921
+ */
4922
+ export type EntitlementRequestState = "open" | "accepted" | "declined" | "withdrawn";
4923
+ export declare const EntitlementRequestOpen: EntitlementRequestState;
4924
+ export declare const EntitlementRequestAccepted: EntitlementRequestState;
4925
+ export declare const EntitlementRequestDeclined: EntitlementRequestState;
4926
+ export declare const EntitlementRequestWithdrawn: EntitlementRequestState;
4673
4927
  export type ChatStatus = "busy" | "idle" | "awaiting_input" | "completed";
4674
4928
  export declare const ChatStatusBusy: ChatStatus;
4675
4929
  export declare const ChatStatusIdle: ChatStatus;
@@ -4791,6 +5045,23 @@ export interface ChannelContext {
4791
5045
  channel_type?: ChannelType;
4792
5046
  channel_metadata?: any;
4793
5047
  }
5048
+ /**
5049
+ * DescriptionLimit is the most characters a resource's description may have.
5050
+ */
5051
+ export type DescriptionLimit = number;
5052
+ /**
5053
+ * DescriptionLimitListing bounds the description of an app, agent, flow,
5054
+ * MCP server or knowledge entry. A description is shown in listings and
5055
+ * handed to agents as a suggestion, so it is a sentence or two; anything
5056
+ * longer belongs in the resource itself.
5057
+ */
5058
+ export declare const DescriptionLimitListing: DescriptionLimit;
5059
+ /**
5060
+ * DescriptionLimitSkill bounds a skill's description. It is the skill's
5061
+ * SKILL.md frontmatter, so it follows the Agent Skills specification
5062
+ * (https://agentskills.io/specification) rather than the listing limit.
5063
+ */
5064
+ export declare const DescriptionLimitSkill: DescriptionLimit;
4794
5065
  /**
4795
5066
  * EngineStatus represents the status of an engine.
4796
5067
  */
@@ -4891,6 +5162,31 @@ export interface OutputFieldMapping {
4891
5162
  export type OutputMappings = {
4892
5163
  [key: string]: OutputFieldMapping;
4893
5164
  };
5165
+ /**
5166
+ * FormStatus is a form's lifecycle. Only an open form takes submissions.
5167
+ */
5168
+ export type FormStatus = "draft" | "open" | "closed";
5169
+ export declare const FormStatusDraft: FormStatus;
5170
+ export declare const FormStatusOpen: FormStatus;
5171
+ export declare const FormStatusClosed: FormStatus;
5172
+ /**
5173
+ * FormSubmitPolicy says how many submissions a form takes from one source.
5174
+ */
5175
+ export type FormSubmitPolicy = "once_per_user" | "once_per_team" | "many";
5176
+ /**
5177
+ * FormSubmitOncePerUser: one submission per person, whichever team they
5178
+ * selected when they answered.
5179
+ */
5180
+ export declare const FormSubmitOncePerUser: FormSubmitPolicy;
5181
+ /**
5182
+ * FormSubmitOncePerTeam: one submission per team; the submitter's
5183
+ * selected team counts.
5184
+ */
5185
+ export declare const FormSubmitOncePerTeam: FormSubmitPolicy;
5186
+ /**
5187
+ * FormSubmitMany: no limit.
5188
+ */
5189
+ export declare const FormSubmitMany: FormSubmitPolicy;
4894
5190
  /**
4895
5191
  * GateCondition defines a simple boolean condition for gate nodes.
4896
5192
  */
@@ -5329,7 +5625,7 @@ export declare const DeviceTokenKindSession: DeviceTokenKind;
5329
5625
  * TODO: retire once CLIs older than the session-token release are gone.
5330
5626
  */
5331
5627
  export declare const DeviceTokenKindAPIKey: DeviceTokenKind;
5332
- export type EntitlementResource = "api_keys" | "connectors" | "knowledge_bases" | "storage_mb" | "concurrency" | "rate_per_min" | "seats" | "triggers" | "retention_days" | "private_apps" | "task_executions" | "feature:byok" | "feature:seedance" | "feature:scopes" | "feature:webhooks" | "feature:team_billing" | "feature:auto_recharge" | "feature:invoices" | "feature:publish_apps";
5628
+ export type EntitlementResource = "api_keys" | "connectors" | "knowledge_bases" | "storage_mb" | "concurrency" | "rate_per_min" | "seats" | "triggers" | "retention_days" | "private_apps" | "task_executions" | "feature:byok" | "feature:seedance" | "feature:marketplace_publish" | "feature:forms" | "feature:scopes" | "feature:webhooks" | "feature:team_billing" | "feature:auto_recharge" | "feature:invoices" | "feature:publish_apps";
5333
5629
  /**
5334
5630
  * Capacity limits — scale with tier
5335
5631
  */
@@ -5352,6 +5648,14 @@ export declare const ResourceTaskExecutions: EntitlementResource;
5352
5648
  */
5353
5649
  export declare const ResourceFeatureBYOK: EntitlementResource;
5354
5650
  export declare const ResourceFeatureSeedance: EntitlementResource;
5651
+ /**
5652
+ * Granted per team: the marketplace takes submissions by invitation.
5653
+ */
5654
+ export declare const ResourceFeatureMarketplacePublish: EntitlementResource;
5655
+ /**
5656
+ * Granted per team: creating forms is by invitation for now.
5657
+ */
5658
+ export declare const ResourceFeatureForms: EntitlementResource;
5355
5659
  /**
5356
5660
  * Legacy feature gates — kept for DB compatibility, no longer gated
5357
5661
  */
@@ -5489,7 +5793,7 @@ export declare const NotificationPriorityCritical: NotificationPriority;
5489
5793
  /**
5490
5794
  * NotificationType represents the type/category of notification
5491
5795
  */
5492
- export type NotificationType = "low_balance" | "auto_recharge" | "payment_success" | "payment_failed" | "usage_summary" | "spending_limit" | "invoice" | "credit_note" | "subscription_created" | "subscription_credit" | "subscription_canceled" | "subscription_payment_failed" | "subscription_trial_ending" | "welcome" | "welcome_agents" | "welcome_apps" | "welcome_flows" | "welcome_sdk" | "password_reset" | "email_verify" | "security_alert" | "task_complete" | "task_failed" | "data_export" | "system_alert" | "maintenance" | "tos_update" | "service_notice" | "team_invite";
5796
+ export type NotificationType = "low_balance" | "auto_recharge" | "payment_success" | "payment_failed" | "usage_summary" | "spending_limit" | "invoice" | "credit_note" | "subscription_created" | "subscription_credit" | "subscription_canceled" | "subscription_payment_failed" | "subscription_trial_ending" | "welcome" | "welcome_agents" | "welcome_apps" | "welcome_flows" | "welcome_sdk" | "password_reset" | "email_verify" | "security_alert" | "task_complete" | "task_failed" | "data_export" | "system_alert" | "maintenance" | "tos_update" | "service_notice" | "team_invite" | "entitlement_request";
5493
5797
  /**
5494
5798
  * Billing notifications
5495
5799
  */
@@ -5537,6 +5841,10 @@ export declare const NotificationTypeServiceNotice: NotificationType;
5537
5841
  * Team notifications
5538
5842
  */
5539
5843
  export declare const NotificationTypeTeamInvite: NotificationType;
5844
+ /**
5845
+ * An admin decided the team's entitlement request
5846
+ */
5847
+ export declare const NotificationTypeEntitlementRequest: NotificationType;
5540
5848
  /**
5541
5849
  * NotificationStatus represents the status of a notification
5542
5850
  */
@@ -5555,6 +5863,32 @@ export type PolicyEffect = "allow" | "ask" | "deny";
5555
5863
  export declare const PolicyEffectAllow: PolicyEffect;
5556
5864
  export declare const PolicyEffectAsk: PolicyEffect;
5557
5865
  export declare const PolicyEffectDeny: PolicyEffect;
5866
+ /**
5867
+ * PolicyEnforcement is how a rule takes part in decisions.
5868
+ */
5869
+ export type PolicyEnforcement = "default" | "enforced" | "evaluate" | "disabled";
5870
+ /**
5871
+ * PolicyEnforcementDefault: the rule decides in its layer, and a more
5872
+ * specific admin layer with a rule matching the same call overrides it.
5873
+ */
5874
+ export declare const PolicyEnforcementDefault: PolicyEnforcement;
5875
+ /**
5876
+ * PolicyEnforcementEnforced: an admin (governance) rule that is final.
5877
+ * It is checked before every other layer, and no lower admin layer can
5878
+ * override it; narrow-only layers can still only narrow. Only admin
5879
+ * layers may hold one.
5880
+ */
5881
+ export declare const PolicyEnforcementEnforced: PolicyEnforcement;
5882
+ /**
5883
+ * PolicyEnforcementEvaluate: the rule never decides. When it would have
5884
+ * changed a decision, the decision feed records what it would have done,
5885
+ * so a rule can be tried before it is switched on.
5886
+ */
5887
+ export declare const PolicyEnforcementEvaluate: PolicyEnforcement;
5888
+ /**
5889
+ * PolicyEnforcementDisabled: the rule is kept and ignored.
5890
+ */
5891
+ export declare const PolicyEnforcementDisabled: PolicyEnforcement;
5558
5892
  /**
5559
5893
  * PolicyKind names what a rule governs; each kind has one matcher.
5560
5894
  */
package/dist/types.js CHANGED
@@ -395,6 +395,23 @@ export const ErrorCodePaymentRequired = "payment_required";
395
395
  * PaymentMethodRequiredMeta; clients send the user to BillingPage.
396
396
  */
397
397
  export const ErrorCodePaymentMethodRequired = "payment_method_required";
398
+ /**
399
+ * Form submissions (409): the form is not open, or its submit policy
400
+ * already holds the caller's submission.
401
+ */
402
+ export const ErrorCodeFormClosed = "form_closed";
403
+ export const ErrorCodeAlreadySubmitted = "already_submitted";
404
+ /**
405
+ * Bounty claims (409): the caller already claimed this proof, or as many
406
+ * times as the program allows.
407
+ */
408
+ export const ErrorCodeAlreadyClaimed = "already_claimed";
409
+ /**
410
+ * Entitlement requests (409): the team already holds the entitlement, or
411
+ * already has an open request for it.
412
+ */
413
+ export const ErrorCodeAlreadyEntitled = "already_entitled";
414
+ export const ErrorCodeRequestOpen = "request_open";
398
415
  /**
399
416
  * Remote harness refusals.
400
417
  */
@@ -403,6 +420,8 @@ export const ErrorCodeRemoteOffline = "remote_offline";
403
420
  export const ErrorCodeRemoteTimeout = "remote_timeout";
404
421
  export const ErrorCodeHarnessNotDrivable = "harness_not_drivable";
405
422
  export const ErrorCodeHarnessTooOld = "harness_too_old";
423
+ export const TaskFileRoleInput = "input";
424
+ export const TaskFileRoleOutput = "output";
406
425
  /**
407
426
  * Flow graph action type constants.
408
427
  */
@@ -553,6 +572,12 @@ export const A2UIForm = "Form";
553
572
  * the viewer. Rendered from the artifact's /render endpoint.
554
573
  */
555
574
  export const A2UIArtifact = "Artifact";
575
+ /**
576
+ * McpApp embeds a remote MCP server's tool page (MCP Apps, SEP-1865): a
577
+ * sandboxed HTML document the host feeds the tool's input and result over
578
+ * postMessage, and whose tools/call requests it proxies to the server.
579
+ */
580
+ export const A2UIMcpApp = "McpApp";
556
581
  /**
557
582
  * ApiKeyScopeUser is a personal key: it acts as the person who created it,
558
583
  * in the workspace it was created in, and ends when they can no longer
@@ -622,6 +647,10 @@ export const EntitlementScopeTeam = "team";
622
647
  export const EntitlementScopeMember = "member";
623
648
  export const EnforcementBlock = "block";
624
649
  export const EnforcementWarn = "warn";
650
+ export const EntitlementRequestOpen = "open";
651
+ export const EntitlementRequestAccepted = "accepted";
652
+ export const EntitlementRequestDeclined = "declined";
653
+ export const EntitlementRequestWithdrawn = "withdrawn";
625
654
  export const ChatStatusBusy = "busy";
626
655
  export const ChatStatusIdle = "idle";
627
656
  export const ChatStatusAwaitingInput = "awaiting_input";
@@ -662,6 +691,19 @@ export const ChannelTypeDiscord = "discord";
662
691
  export const ChannelTypeTeams = "teams";
663
692
  export const ChannelTypeTelegram = "telegram";
664
693
  export const ChatEventTypeHook = "hook";
694
+ /**
695
+ * DescriptionLimitListing bounds the description of an app, agent, flow,
696
+ * MCP server or knowledge entry. A description is shown in listings and
697
+ * handed to agents as a suggestion, so it is a sentence or two; anything
698
+ * longer belongs in the resource itself.
699
+ */
700
+ export const DescriptionLimitListing = 200;
701
+ /**
702
+ * DescriptionLimitSkill bounds a skill's description. It is the skill's
703
+ * SKILL.md frontmatter, so it follows the Agent Skills specification
704
+ * (https://agentskills.io/specification) rather than the listing limit.
705
+ */
706
+ export const DescriptionLimitSkill = 1024;
665
707
  export const EngineStatusRunning = "running";
666
708
  export const EngineStatusPending = "pending";
667
709
  export const EngineStatusDraining = "draining";
@@ -679,6 +721,23 @@ export const FlowRunStatusRunning = 2;
679
721
  export const FlowRunStatusCompleted = 3;
680
722
  export const FlowRunStatusFailed = 4;
681
723
  export const FlowRunStatusCancelled = 5;
724
+ export const FormStatusDraft = "draft";
725
+ export const FormStatusOpen = "open";
726
+ export const FormStatusClosed = "closed";
727
+ /**
728
+ * FormSubmitOncePerUser: one submission per person, whichever team they
729
+ * selected when they answered.
730
+ */
731
+ export const FormSubmitOncePerUser = "once_per_user";
732
+ /**
733
+ * FormSubmitOncePerTeam: one submission per team; the submitter's
734
+ * selected team counts.
735
+ */
736
+ export const FormSubmitOncePerTeam = "once_per_team";
737
+ /**
738
+ * FormSubmitMany: no limit.
739
+ */
740
+ export const FormSubmitMany = "many";
682
741
  export const GraphNodeTypeUnknown = "unknown";
683
742
  export const GraphNodeTypeJoin = "join";
684
743
  export const GraphNodeTypeSplit = "split";
@@ -907,6 +966,14 @@ export const ResourceTaskExecutions = "task_executions";
907
966
  */
908
967
  export const ResourceFeatureBYOK = "feature:byok";
909
968
  export const ResourceFeatureSeedance = "feature:seedance";
969
+ /**
970
+ * Granted per team: the marketplace takes submissions by invitation.
971
+ */
972
+ export const ResourceFeatureMarketplacePublish = "feature:marketplace_publish";
973
+ /**
974
+ * Granted per team: creating forms is by invitation for now.
975
+ */
976
+ export const ResourceFeatureForms = "feature:forms";
910
977
  /**
911
978
  * Legacy feature gates — kept for DB compatibility, no longer gated
912
979
  */
@@ -1056,6 +1123,10 @@ export const NotificationTypeServiceNotice = "service_notice";
1056
1123
  * Team notifications
1057
1124
  */
1058
1125
  export const NotificationTypeTeamInvite = "team_invite";
1126
+ /**
1127
+ * An admin decided the team's entitlement request
1128
+ */
1129
+ export const NotificationTypeEntitlementRequest = "entitlement_request";
1059
1130
  export const NotificationStatusPending = "pending";
1060
1131
  export const NotificationStatusProcessing = "processing";
1061
1132
  export const NotificationStatusSent = "sent";
@@ -1066,6 +1137,28 @@ export const NotificationStatusCancelled = "cancelled";
1066
1137
  export const PolicyEffectAllow = "allow";
1067
1138
  export const PolicyEffectAsk = "ask";
1068
1139
  export const PolicyEffectDeny = "deny";
1140
+ /**
1141
+ * PolicyEnforcementDefault: the rule decides in its layer, and a more
1142
+ * specific admin layer with a rule matching the same call overrides it.
1143
+ */
1144
+ export const PolicyEnforcementDefault = "default";
1145
+ /**
1146
+ * PolicyEnforcementEnforced: an admin (governance) rule that is final.
1147
+ * It is checked before every other layer, and no lower admin layer can
1148
+ * override it; narrow-only layers can still only narrow. Only admin
1149
+ * layers may hold one.
1150
+ */
1151
+ export const PolicyEnforcementEnforced = "enforced";
1152
+ /**
1153
+ * PolicyEnforcementEvaluate: the rule never decides. When it would have
1154
+ * changed a decision, the decision feed records what it would have done,
1155
+ * so a rule can be tried before it is switched on.
1156
+ */
1157
+ export const PolicyEnforcementEvaluate = "evaluate";
1158
+ /**
1159
+ * PolicyEnforcementDisabled: the rule is kept and ignored.
1160
+ */
1161
+ export const PolicyEnforcementDisabled = "disabled";
1069
1162
  /**
1070
1163
  * PolicyKindRemoteExec: shell commands run on a remote.
1071
1164
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "Official JavaScript/TypeScript SDK for inference.sh - Run AI models with a simple API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -92,7 +92,7 @@
92
92
  "globals": "^17.12.0",
93
93
  "hono": "^4.13.1",
94
94
  "jest": "^30.4.2",
95
- "next": "^16.2.6",
95
+ "next": "^16.3.6",
96
96
  "prettier": "^3.6.2",
97
97
  "react": "^19.2.3",
98
98
  "rimraf": "^6.0.1",