@inferencesh/sdk 0.19.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.
@@ -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
@@ -1225,6 +1225,23 @@ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1225
1225
  status: AppStatus;
1226
1226
  status_message?: string;
1227
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;
1228
1245
  }
1229
1246
  /**
1230
1247
  * AppVersionDTO is the API response for an app version.
@@ -1233,6 +1250,10 @@ export interface AppVersionDTO extends BaseModelDTO {
1233
1250
  metadata: {
1234
1251
  [key: string]: any;
1235
1252
  };
1253
+ /**
1254
+ * UI mirrors metadata.ui so clients need not dig through the map.
1255
+ */
1256
+ ui?: AppUIRef;
1236
1257
  repository: string;
1237
1258
  flow_version_id?: string;
1238
1259
  flow_version?: FlowVersionDTO;
@@ -1706,11 +1727,16 @@ export interface BountyProgramDTO extends BaseModelDTO, PermissionModelDTO {
1706
1727
  max_per_user: number;
1707
1728
  max_per_day: number;
1708
1729
  proof_type: string;
1709
- 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;
1710
1735
  /**
1711
1736
  * RequiresPaymentMethod withholds the reward until the claimant's team has
1712
- * a saved payment method. The claim itself is refused with 402
1713
- * 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.
1714
1740
  */
1715
1741
  requires_payment_method: boolean;
1716
1742
  status: string;
@@ -1732,7 +1758,10 @@ export interface BountySubmissionDTO extends BaseModelDTO, PermissionModelDTO {
1732
1758
  source?: string;
1733
1759
  }
1734
1760
  /**
1735
- * 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.
1736
1765
  */
1737
1766
  export interface SubmitBountyRequest {
1738
1767
  bounty_id: string;
@@ -1876,6 +1905,13 @@ export interface ChatMessageDTO extends BaseModelDTO, PermissionModelDTO {
1876
1905
  export interface PolicyRuleDTO {
1877
1906
  id: string;
1878
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;
1879
1915
  /**
1880
1916
  * Kind: what the rule governs (RemoteExec, Workspace, Harness, Tool,
1881
1917
  * and the usage kinds App, Agent, Knowledge, Mcp, Flow).
@@ -1890,12 +1926,15 @@ export interface PolicyRuleDTO {
1890
1926
  * Specifier is the kind's pattern: a command (`npm test`, `git push:*`),
1891
1927
  * a folder (`~/proj/**`), a harness tool with its pattern
1892
1928
  * (`Bash(git status:*)`, `Edit`), or a loop tool's name. Empty is the
1893
- * whole kind.
1929
+ * whole kind. A usage kind's names a resource by id, or everything a
1930
+ * publisher owns as publisher:<team id>.
1894
1931
  */
1895
1932
  specifier: string;
1896
1933
  /**
1897
1934
  * Label is the rule in words, e.g. "git commit commands on Laptop", the
1898
- * 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/*").
1899
1938
  */
1900
1939
  label: string;
1901
1940
  /**
@@ -2332,17 +2371,63 @@ export interface EntitlementErrorMeta {
2332
2371
  limit?: number;
2333
2372
  current?: number;
2334
2373
  upgrade_available: boolean;
2374
+ requestable: boolean;
2375
+ request_state?: string;
2335
2376
  addon_plan_id?: string;
2336
2377
  addon_plan_name?: string;
2337
2378
  addon_plan_price?: number;
2338
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
+ }
2339
2424
  /**
2340
2425
  * ErrorCode is the machine-readable error code of an API error: the last
2341
2426
  * segment of the problem+json type URI (https://api.inference.sh/errors/<code>)
2342
2427
  * and APIError.Code on the legacy envelope. Clients branch on these, so a
2343
2428
  * code is a named const here, where it generates into models and the SDKs.
2344
2429
  */
2345
- 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";
2346
2431
  export declare const ErrorCodeInvalidRequest: ErrorCode;
2347
2432
  export declare const ErrorCodeValidationError: ErrorCode;
2348
2433
  export declare const ErrorCodeUnauthorized: ErrorCode;
@@ -2402,6 +2487,23 @@ export declare const ErrorCodePaymentRequired: ErrorCode;
2402
2487
  * PaymentMethodRequiredMeta; clients send the user to BillingPage.
2403
2488
  */
2404
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;
2405
2507
  /**
2406
2508
  * Remote harness refusals.
2407
2509
  */
@@ -2457,6 +2559,38 @@ export interface FileDTO extends BaseModelDTO, PermissionModelDTO {
2457
2559
  rating: ContentRating;
2458
2560
  metadata?: FileMetadata;
2459
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
+ }
2460
2594
  /**
2461
2595
  * FlowNodeData describes a node's data within a flow
2462
2596
  */
@@ -2739,6 +2873,100 @@ export interface RenameOutputFieldPayload {
2739
2873
  old_field: string;
2740
2874
  new_field: string;
2741
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
+ }
2742
2970
  /**
2743
2971
  * GraphNodeDTO is the API representation of a graph node
2744
2972
  */
@@ -3151,6 +3379,9 @@ export interface ResourceContent {
3151
3379
  mimeType?: string;
3152
3380
  text?: string;
3153
3381
  blob?: string;
3382
+ _meta?: {
3383
+ [key: string]: any;
3384
+ };
3154
3385
  }
3155
3386
  /**
3156
3387
  * ToolCallRequest represents a request to call a tool.
@@ -3861,37 +4092,6 @@ export interface SubscriptionDTO extends BaseModelDTO {
3861
4092
  cancel_at_period_end: boolean;
3862
4093
  credits_per_period: number;
3863
4094
  }
3864
- /**
3865
- * SurveyResponseDTO is the API representation of a survey response.
3866
- */
3867
- export interface SurveyResponseDTO extends BaseModelDTO, PermissionModelDTO {
3868
- question_id: string;
3869
- response: string;
3870
- agent?: string;
3871
- source?: string;
3872
- context?: string;
3873
- }
3874
- /**
3875
- * SubmitSurveyResponse is returned when submitting a survey answer.
3876
- * GrantedAmount is the credit reward in microcents (0 if no reward was earned).
3877
- * RewardBlockedReason is set when the answer was recorded but the reward was
3878
- * withheld by policy (see RewardBlockedPaymentMethodRequired).
3879
- */
3880
- export interface SubmitSurveyResponse {
3881
- response: SurveyResponseDTO;
3882
- granted_amount?: number;
3883
- reward_blocked_reason?: string;
3884
- }
3885
- /**
3886
- * SubmitSurveyRequest is used to submit a single survey answer.
3887
- */
3888
- export interface SubmitSurveyRequest {
3889
- question_id: string;
3890
- response: string;
3891
- agent?: string;
3892
- source?: string;
3893
- context?: string;
3894
- }
3895
4095
  /**
3896
4096
  * Hardware/System related types
3897
4097
  */
@@ -4360,6 +4560,10 @@ export interface UserRelationDTO {
4360
4560
  created_at: string;
4361
4561
  updated_at: string;
4362
4562
  role: Role;
4563
+ /**
4564
+ * Name is omitted when empty so older generated copies of this DTO stay assignable.
4565
+ */
4566
+ name?: string;
4363
4567
  avatar_url: string;
4364
4568
  }
4365
4569
  /**
@@ -4380,7 +4584,7 @@ export interface UserMetadataDTO {
4380
4584
  * Alias of shared.A2UISurface so the type generation pipeline picks it up.
4381
4585
  */
4382
4586
  export type Widget = A2UISurface;
4383
- 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";
4384
4588
  export declare const A2UIRow: A2UIComponentType;
4385
4589
  export declare const A2UIColumn: A2UIComponentType;
4386
4590
  export declare const A2UIList: A2UIComponentType;
@@ -4409,6 +4613,12 @@ export declare const A2UIForm: A2UIComponentType;
4409
4613
  * the viewer. Rendered from the artifact's /render endpoint.
4410
4614
  */
4411
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;
4412
4622
  /**
4413
4623
  * A2UIComponent is the universal component representation.
4414
4624
  * Children are string IDs (flat adjacency list), not nested objects.
@@ -4519,6 +4729,59 @@ export interface A2UIComponent {
4519
4729
  artifactTitle?: string;
4520
4730
  artifactUrl?: string;
4521
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
+ };
4522
4785
  }
4523
4786
  export type A2UIBound = string | number | boolean | A2UIBoundValue;
4524
4787
  /**
@@ -4651,6 +4914,16 @@ export declare const EntitlementScopeMember: EntitlementScope;
4651
4914
  export type EnforcementMode = "block" | "warn";
4652
4915
  export declare const EnforcementBlock: EnforcementMode;
4653
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;
4654
4927
  export type ChatStatus = "busy" | "idle" | "awaiting_input" | "completed";
4655
4928
  export declare const ChatStatusBusy: ChatStatus;
4656
4929
  export declare const ChatStatusIdle: ChatStatus;
@@ -4772,6 +5045,23 @@ export interface ChannelContext {
4772
5045
  channel_type?: ChannelType;
4773
5046
  channel_metadata?: any;
4774
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;
4775
5065
  /**
4776
5066
  * EngineStatus represents the status of an engine.
4777
5067
  */
@@ -4872,6 +5162,31 @@ export interface OutputFieldMapping {
4872
5162
  export type OutputMappings = {
4873
5163
  [key: string]: OutputFieldMapping;
4874
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;
4875
5190
  /**
4876
5191
  * GateCondition defines a simple boolean condition for gate nodes.
4877
5192
  */
@@ -5310,7 +5625,7 @@ export declare const DeviceTokenKindSession: DeviceTokenKind;
5310
5625
  * TODO: retire once CLIs older than the session-token release are gone.
5311
5626
  */
5312
5627
  export declare const DeviceTokenKindAPIKey: DeviceTokenKind;
5313
- 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: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";
5314
5629
  /**
5315
5630
  * Capacity limits — scale with tier
5316
5631
  */
@@ -5337,6 +5652,10 @@ export declare const ResourceFeatureSeedance: EntitlementResource;
5337
5652
  * Granted per team: the marketplace takes submissions by invitation.
5338
5653
  */
5339
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;
5340
5659
  /**
5341
5660
  * Legacy feature gates — kept for DB compatibility, no longer gated
5342
5661
  */
@@ -5474,7 +5793,7 @@ export declare const NotificationPriorityCritical: NotificationPriority;
5474
5793
  /**
5475
5794
  * NotificationType represents the type/category of notification
5476
5795
  */
5477
- 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";
5478
5797
  /**
5479
5798
  * Billing notifications
5480
5799
  */
@@ -5522,6 +5841,10 @@ export declare const NotificationTypeServiceNotice: NotificationType;
5522
5841
  * Team notifications
5523
5842
  */
5524
5843
  export declare const NotificationTypeTeamInvite: NotificationType;
5844
+ /**
5845
+ * An admin decided the team's entitlement request
5846
+ */
5847
+ export declare const NotificationTypeEntitlementRequest: NotificationType;
5525
5848
  /**
5526
5849
  * NotificationStatus represents the status of a notification
5527
5850
  */
@@ -5540,6 +5863,32 @@ export type PolicyEffect = "allow" | "ask" | "deny";
5540
5863
  export declare const PolicyEffectAllow: PolicyEffect;
5541
5864
  export declare const PolicyEffectAsk: PolicyEffect;
5542
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;
5543
5892
  /**
5544
5893
  * PolicyKind names what a rule governs; each kind has one matcher.
5545
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";
@@ -911,6 +970,10 @@ export const ResourceFeatureSeedance = "feature:seedance";
911
970
  * Granted per team: the marketplace takes submissions by invitation.
912
971
  */
913
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";
914
977
  /**
915
978
  * Legacy feature gates — kept for DB compatibility, no longer gated
916
979
  */
@@ -1060,6 +1123,10 @@ export const NotificationTypeServiceNotice = "service_notice";
1060
1123
  * Team notifications
1061
1124
  */
1062
1125
  export const NotificationTypeTeamInvite = "team_invite";
1126
+ /**
1127
+ * An admin decided the team's entitlement request
1128
+ */
1129
+ export const NotificationTypeEntitlementRequest = "entitlement_request";
1063
1130
  export const NotificationStatusPending = "pending";
1064
1131
  export const NotificationStatusProcessing = "processing";
1065
1132
  export const NotificationStatusSent = "sent";
@@ -1070,6 +1137,28 @@ export const NotificationStatusCancelled = "cancelled";
1070
1137
  export const PolicyEffectAllow = "allow";
1071
1138
  export const PolicyEffectAsk = "ask";
1072
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";
1073
1162
  /**
1074
1163
  * PolicyKindRemoteExec: shell commands run on a remote.
1075
1164
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.19.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",