@inferencesh/sdk 0.38.3 → 0.38.5

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,7 +1,7 @@
1
1
  import { HttpClient } from '../http/client.js';
2
2
  import type { Response } from '../http/response.js';
3
3
  import type { TeamUpdateBody } from './write-bodies.js';
4
- import { MeResponse, TeamDTO, TeamMemberDTO, TeamInviteDTO, TeamCreateRequest, TeamMemberAddRequest, TeamInviteCreateRequest, AvailabilityResponse } from '../types.js';
4
+ import { MeResponse, TeamDTO, TeamMemberDTO, TeamMemberAddResultDTO, TeamInviteDTO, TeamCreateRequest, TeamMemberAddRequest, TeamInviteCreateRequest, AvailabilityResponse } from '../types.js';
5
5
  /**
6
6
  * Teams API
7
7
  */
@@ -44,7 +44,12 @@ export declare class TeamsAPI {
44
44
  /**
45
45
  * Add a team member
46
46
  */
47
- addMember(teamId: string, data: TeamMemberAddRequest): Promise<Response<TeamMemberDTO>>;
47
+ /**
48
+ * Add an existing account to a team. An account the team's org owns joins
49
+ * straight away (`outcome: "added"`, `member`); anyone else is sent an
50
+ * invite they accept (`outcome: "invited"`, `invite`).
51
+ */
52
+ addMember(teamId: string, data: TeamMemberAddRequest): Promise<Response<TeamMemberAddResultDTO>>;
48
53
  /**
49
54
  * Remove a team member
50
55
  */
package/dist/api/teams.js CHANGED
@@ -57,6 +57,11 @@ export class TeamsAPI {
57
57
  /**
58
58
  * Add a team member
59
59
  */
60
+ /**
61
+ * Add an existing account to a team. An account the team's org owns joins
62
+ * straight away (`outcome: "added"`, `member`); anyone else is sent an
63
+ * invite they accept (`outcome: "invited"`, `invite`).
64
+ */
60
65
  async addMember(teamId, data) {
61
66
  return this.http.request('post', `/teams/${teamId}/members`, { data });
62
67
  }
package/dist/types.d.ts CHANGED
@@ -18,6 +18,14 @@ export interface InternalToolsConfig {
18
18
  remote?: boolean;
19
19
  knowledge?: boolean;
20
20
  wait?: boolean;
21
+ /**
22
+ * SandboxCredentials are the logins a sandbox sandbox_create makes gets
23
+ * (Remote on), declared as an app's credentials are (provider slug,
24
+ * scopes): the runner's own, as a task of theirs resolves it; a runner
25
+ * with none is asked to connect it and the call waits. None declared,
26
+ * none given. The model's arguments never add any.
27
+ */
28
+ sandbox_credentials?: CredentialRequirement[];
21
29
  }
22
30
  /**
23
31
  * AgentPermissions is what an agent's new chats in its own workspace may do
@@ -642,6 +650,13 @@ export interface DeviceAuthInitRequest {
642
650
  token_kind?: DeviceTokenKind;
643
651
  code_challenge?: string;
644
652
  code_challenge_method?: string;
653
+ /**
654
+ * Scopes the device asks for ("belt login --admin" names the admin
655
+ * scopes). Empty: the default, every scope but user:write and admin.
656
+ * The approval page shows them and the person confirms; the approval
657
+ * grants at most these.
658
+ */
659
+ scopes?: Scope[];
645
660
  }
646
661
  export interface DeviceAuthResponse {
647
662
  user_code: string;
@@ -728,6 +743,12 @@ export interface MeResponse {
728
743
  */
729
744
  team_view?: TeamViewDTO;
730
745
  diagnostics?: DiagnosticsConfig;
746
+ /**
747
+ * Notice is an operator's notice about the caller's access, set only
748
+ * when the request comes from an address restricted to sign-in and the
749
+ * CLI. Empty otherwise.
750
+ */
751
+ notice?: string;
731
752
  /**
732
753
  * PersonalTeamID is the caller's personal workspace, empty for a managed
733
754
  * account, which has none.
@@ -2806,8 +2827,8 @@ export interface CredentialConfigDTO {
2806
2827
  app_noun?: string;
2807
2828
  /**
2808
2829
  * HookURL is where App delivers its events (the GitHub App's webhook
2809
- * URL, to paste in its settings): the platform's app's, or this
2810
- * workspace's own app's. Empty when the provider's apps deliver none.
2830
+ * URL, to paste in its settings). Empty when the provider's apps
2831
+ * deliver none.
2811
2832
  */
2812
2833
  hook_url?: string;
2813
2834
  /**
@@ -3160,6 +3181,14 @@ export interface EntitlementDTO extends BaseModelDTO {
3160
3181
  expires_at?: string;
3161
3182
  team_plan_id?: string;
3162
3183
  }
3184
+ /**
3185
+ * FeatureAccess is whether the caller's team may use feature gate
3186
+ * Resource, as the API decides it (CheckFeatureGate): what a client shows.
3187
+ */
3188
+ export interface FeatureAccess {
3189
+ resource: EntitlementResource;
3190
+ allowed: boolean;
3191
+ }
3163
3192
  /**
3164
3193
  * EntitlementErrorMeta is the structured metadata returned in entitlement error responses.
3165
3194
  */
@@ -3225,7 +3254,7 @@ export interface DecideEntitlementRequestRequest {
3225
3254
  * and APIError.Code on the legacy envelope. Clients branch on these, so a
3226
3255
  * code is a named const here, where it generates into models and the SDKs.
3227
3256
  */
3228
- 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" | "requirements_not_met" | "team_role_required" | "in_other_workspace" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "requires_sign_in" | "insufficient_scope" | "invalid_scope" | "impersonation_reason_required" | "mcp_auth_expired" | "admin_session_required" | "admin_scopes_not_approved" | "cli_session_required" | "admin_required" | "same_admin_required" | "browser_session_required" | "invalid_ttl" | "admin_authenticator_required" | "last_authenticator" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "already_claimed" | "already_entitled" | "request_open" | "invalid_code" | "already_processed" | "expired" | "code_confirmation_required" | "app_retired" | "app_maintenance" | "invalid_transition" | "SESSION_NOT_FOUND" | "SESSION_EXPIRED" | "SESSION_ENDED" | "WORKER_LEASED" | "APP_MISMATCH" | "VERSION_MISMATCH" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
3257
+ 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" | "web_access_restricted" | "requirements_not_met" | "team_role_required" | "in_other_workspace" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "requires_sign_in" | "insufficient_scope" | "invalid_scope" | "impersonation_reason_required" | "mcp_auth_expired" | "admin_session_required" | "admin_scopes_not_approved" | "cli_session_required" | "admin_required" | "same_admin_required" | "browser_session_required" | "invalid_ttl" | "admin_authenticator_required" | "last_authenticator" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "already_claimed" | "already_entitled" | "request_open" | "invalid_code" | "already_processed" | "expired" | "code_confirmation_required" | "app_retired" | "app_maintenance" | "invalid_transition" | "SESSION_NOT_FOUND" | "SESSION_EXPIRED" | "SESSION_ENDED" | "WORKER_LEASED" | "APP_MISMATCH" | "VERSION_MISMATCH" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
3229
3258
  export declare const ErrorCodeInvalidRequest: ErrorCode;
3230
3259
  export declare const ErrorCodeValidationError: ErrorCode;
3231
3260
  export declare const ErrorCodeUnauthorized: ErrorCode;
@@ -3238,6 +3267,12 @@ export declare const ErrorCodeNotConfigured: ErrorCode;
3238
3267
  export declare const ErrorCodeMethodNotAllowed: ErrorCode;
3239
3268
  export declare const ErrorCodeRateLimited: ErrorCode;
3240
3269
  export declare const ErrorCodeInternalError: ErrorCode;
3270
+ /**
3271
+ * ErrorCodeWebAccessRestricted (403): the request comes from an address
3272
+ * restricted to sign-in and the CLI; detail is the operator's notice
3273
+ * and meta is WebAccessRestrictedMeta.
3274
+ */
3275
+ export declare const ErrorCodeWebAccessRestricted: ErrorCode;
3241
3276
  /**
3242
3277
  * ErrorCodeRequirementsNotMet (412): the run needs a secret or a
3243
3278
  * credential the caller has not set up. Meta "errors" lists each
@@ -4841,6 +4876,17 @@ export interface OAuthAuthorizeInfoResponse {
4841
4876
  verified: boolean;
4842
4877
  scopes: Scope[];
4843
4878
  redirect_host: string;
4879
+ /**
4880
+ * StepUpRequired: the caller has not approved this client, to this
4881
+ * redirect, for these scopes and this team (team_id query parameter,
4882
+ * else the session's) since the fix, with a grant still live, so
4883
+ * approving takes a step-up: StepUpAction for StepUpTarget, proved via
4884
+ * POST /auth/otp/verify (an emailed code via POST /auth/otp/resend
4885
+ * {action, target}); the form submits the token as step_up_token.
4886
+ */
4887
+ step_up_required: boolean;
4888
+ step_up_action?: StepUpAction;
4889
+ step_up_target?: string;
4844
4890
  }
4845
4891
  /**
4846
4892
  * OAuthApproveRequest is the request body for POST /oauth/authorize/approve.
@@ -5057,6 +5103,14 @@ export interface CreateSandboxRequest {
5057
5103
  vcpus?: number;
5058
5104
  memory_mib?: number;
5059
5105
  disk_mib?: number;
5106
+ /**
5107
+ * Credentials are the logins the box gets, by provider (slug), as a
5108
+ * run of its owner resolves them (e.g. [{"slug":"github-app"}]). Only
5109
+ * keys a provider binds to hosts: the box holds placeholders, the
5110
+ * engine's gateway places the values toward those hosts and renews
5111
+ * the ones that expire, always from the login chosen here.
5112
+ */
5113
+ credentials?: CredentialRequirement[];
5060
5114
  }
5061
5115
  /**
5062
5116
  * SandboxDTO is the API response for a sandbox.
@@ -5496,6 +5550,16 @@ export interface TeamDTO extends BaseModelDTO {
5496
5550
  */
5497
5551
  org_name?: string;
5498
5552
  }
5553
+ /**
5554
+ * TeamMemberAddResultDTO is what POST /teams/{id}/members did: added the
5555
+ * account (member) or, for an account the team's org does not own, sent it
5556
+ * an invite (invite).
5557
+ */
5558
+ export interface TeamMemberAddResultDTO {
5559
+ outcome: TeamMemberAddOutcome;
5560
+ member?: TeamMemberDTO;
5561
+ invite?: TeamInviteDTO;
5562
+ }
5499
5563
  /**
5500
5564
  * TeamMemberDTO is the API response for a team member.
5501
5565
  */
@@ -7574,6 +7638,89 @@ export declare const SecondFactorRecovery: SecondFactor;
7574
7638
  * sign-in, re-auth before they enroll).
7575
7639
  */
7576
7640
  export declare const SecondFactorEmail: SecondFactor;
7641
+ /**
7642
+ * StepUpAction is an action that takes a step-up: a factor proved for this
7643
+ * one action, spent by the one request that performs it (auth.RequireStepUp).
7644
+ * A sign-in or a re-auth window never stands in for it.
7645
+ */
7646
+ export type StepUpAction = "export" | "delete" | "factor_enroll" | "factor_change" | "device_approve" | "admin_elevation_approve" | "oauth_approve" | "api_key_create" | "secret_reveal" | "admin_session" | "admin_sensitive" | "team_member_change" | "team_sso_change";
7647
+ /**
7648
+ * StepUpExport: request an account data export, or a download link.
7649
+ */
7650
+ export declare const StepUpExport: StepUpAction;
7651
+ /**
7652
+ * StepUpDelete: schedule the account's deletion.
7653
+ */
7654
+ export declare const StepUpDelete: StepUpAction;
7655
+ /**
7656
+ * StepUpFactorEnroll: start enrolling an authenticator or passkey, or
7657
+ * turn two-step verification on (which hands out recovery codes).
7658
+ */
7659
+ export declare const StepUpFactorEnroll: StepUpAction;
7660
+ /**
7661
+ * StepUpFactorChange: turn two-step verification off, remove a method,
7662
+ * or regenerate recovery codes.
7663
+ */
7664
+ export declare const StepUpFactorChange: StepUpAction;
7665
+ /**
7666
+ * StepUpDeviceApprove: approve a device (CLI) sign-in.
7667
+ */
7668
+ export declare const StepUpDeviceApprove: StepUpAction;
7669
+ /**
7670
+ * StepUpAdminElevationApprove: approve an admin elevation of a CLI login.
7671
+ */
7672
+ export declare const StepUpAdminElevationApprove: StepUpAction;
7673
+ /**
7674
+ * StepUpOAuthApprove: approve an OAuth app the account has not approved
7675
+ * before (for this redirect URI, these scopes and this team).
7676
+ */
7677
+ export declare const StepUpOAuthApprove: StepUpAction;
7678
+ /**
7679
+ * StepUpAPIKeyCreate: create an API key from the browser (target: its
7680
+ * scopes and team).
7681
+ */
7682
+ export declare const StepUpAPIKeyCreate: StepUpAction;
7683
+ /**
7684
+ * StepUpSecretReveal: read a stored secret's value or a webhook signing
7685
+ * secret, or generate a new signing secret (target: the request).
7686
+ */
7687
+ export declare const StepUpSecretReveal: StepUpAction;
7688
+ /**
7689
+ * StepUpAdminSession: open the staff browser session's ten-minute admin
7690
+ * action window, inside which admin writes pass.
7691
+ */
7692
+ export declare const StepUpAdminSession: StepUpAction;
7693
+ /**
7694
+ * StepUpAdminSensitive: one sensitive admin action, every time, window
7695
+ * or not (impersonation, revealing a setting's secret, a device
7696
+ * identity, exporting voucher codes). Target: the request.
7697
+ */
7698
+ export declare const StepUpAdminSensitive: StepUpAction;
7699
+ /**
7700
+ * StepUpTeamMemberChange: add someone to a team, invite them, or change
7701
+ * a member's role (target: team|email or user|role).
7702
+ */
7703
+ export declare const StepUpTeamMemberChange: StepUpAction;
7704
+ /**
7705
+ * StepUpTeamSSOChange: change who can enter a team through SSO.
7706
+ */
7707
+ export declare const StepUpTeamSSOChange: StepUpAction;
7708
+ /**
7709
+ * TeamMemberAddOutcome is what adding an existing account to a team by email
7710
+ * did (POST /teams/{id}/members, POST /orgs/{id}/admins).
7711
+ */
7712
+ export type TeamMemberAddOutcome = "added" | "invited";
7713
+ /**
7714
+ * TeamMemberAddAdded: the team's org owns the account (it manages it,
7715
+ * it is already in the org, or it is at a verified domain), so it
7716
+ * joined straight away.
7717
+ */
7718
+ export declare const TeamMemberAddAdded: TeamMemberAddOutcome;
7719
+ /**
7720
+ * TeamMemberAddInvited: the account is not the org's to place, so an
7721
+ * invite was sent; it joins when it accepts.
7722
+ */
7723
+ export declare const TeamMemberAddInvited: TeamMemberAddOutcome;
7577
7724
  /**
7578
7725
  * TeamInviteStatus represents the status of a team invitation
7579
7726
  */
@@ -7691,8 +7838,8 @@ export declare const ResourceFeatureMarketplacePublish: EntitlementResource;
7691
7838
  */
7692
7839
  export declare const ResourceFeatureForms: EntitlementResource;
7693
7840
  /**
7694
- * Managed sandboxes (INF-833): open to every team; a row with enabled
7695
- * false shuts one team out.
7841
+ * Managed sandboxes (INF-833): open to every team unless turned off
7842
+ * for one (FeatureOpen).
7696
7843
  */
7697
7844
  export declare const ResourceFeatureSandboxes: EntitlementResource;
7698
7845
  /**
package/dist/types.js CHANGED
@@ -466,6 +466,12 @@ export const ErrorCodeNotConfigured = "not_configured";
466
466
  export const ErrorCodeMethodNotAllowed = "method_not_allowed";
467
467
  export const ErrorCodeRateLimited = "rate_limited";
468
468
  export const ErrorCodeInternalError = "internal_error";
469
+ /**
470
+ * ErrorCodeWebAccessRestricted (403): the request comes from an address
471
+ * restricted to sign-in and the CLI; detail is the operator's notice
472
+ * and meta is WebAccessRestrictedMeta.
473
+ */
474
+ export const ErrorCodeWebAccessRestricted = "web_access_restricted";
469
475
  /**
470
476
  * ErrorCodeRequirementsNotMet (412): the run needs a secret or a
471
477
  * credential the caller has not set up. Meta "errors" lists each
@@ -1344,6 +1350,78 @@ export const SecondFactorRecovery = "recovery";
1344
1350
  * sign-in, re-auth before they enroll).
1345
1351
  */
1346
1352
  export const SecondFactorEmail = "email";
1353
+ /**
1354
+ * StepUpExport: request an account data export, or a download link.
1355
+ */
1356
+ export const StepUpExport = "export";
1357
+ /**
1358
+ * StepUpDelete: schedule the account's deletion.
1359
+ */
1360
+ export const StepUpDelete = "delete";
1361
+ /**
1362
+ * StepUpFactorEnroll: start enrolling an authenticator or passkey, or
1363
+ * turn two-step verification on (which hands out recovery codes).
1364
+ */
1365
+ export const StepUpFactorEnroll = "factor_enroll";
1366
+ /**
1367
+ * StepUpFactorChange: turn two-step verification off, remove a method,
1368
+ * or regenerate recovery codes.
1369
+ */
1370
+ export const StepUpFactorChange = "factor_change";
1371
+ /**
1372
+ * StepUpDeviceApprove: approve a device (CLI) sign-in.
1373
+ */
1374
+ export const StepUpDeviceApprove = "device_approve";
1375
+ /**
1376
+ * StepUpAdminElevationApprove: approve an admin elevation of a CLI login.
1377
+ */
1378
+ export const StepUpAdminElevationApprove = "admin_elevation_approve";
1379
+ /**
1380
+ * StepUpOAuthApprove: approve an OAuth app the account has not approved
1381
+ * before (for this redirect URI, these scopes and this team).
1382
+ */
1383
+ export const StepUpOAuthApprove = "oauth_approve";
1384
+ /**
1385
+ * StepUpAPIKeyCreate: create an API key from the browser (target: its
1386
+ * scopes and team).
1387
+ */
1388
+ export const StepUpAPIKeyCreate = "api_key_create";
1389
+ /**
1390
+ * StepUpSecretReveal: read a stored secret's value or a webhook signing
1391
+ * secret, or generate a new signing secret (target: the request).
1392
+ */
1393
+ export const StepUpSecretReveal = "secret_reveal";
1394
+ /**
1395
+ * StepUpAdminSession: open the staff browser session's ten-minute admin
1396
+ * action window, inside which admin writes pass.
1397
+ */
1398
+ export const StepUpAdminSession = "admin_session";
1399
+ /**
1400
+ * StepUpAdminSensitive: one sensitive admin action, every time, window
1401
+ * or not (impersonation, revealing a setting's secret, a device
1402
+ * identity, exporting voucher codes). Target: the request.
1403
+ */
1404
+ export const StepUpAdminSensitive = "admin_sensitive";
1405
+ /**
1406
+ * StepUpTeamMemberChange: add someone to a team, invite them, or change
1407
+ * a member's role (target: team|email or user|role).
1408
+ */
1409
+ export const StepUpTeamMemberChange = "team_member_change";
1410
+ /**
1411
+ * StepUpTeamSSOChange: change who can enter a team through SSO.
1412
+ */
1413
+ export const StepUpTeamSSOChange = "team_sso_change";
1414
+ /**
1415
+ * TeamMemberAddAdded: the team's org owns the account (it manages it,
1416
+ * it is already in the org, or it is at a verified domain), so it
1417
+ * joined straight away.
1418
+ */
1419
+ export const TeamMemberAddAdded = "added";
1420
+ /**
1421
+ * TeamMemberAddInvited: the account is not the org's to place, so an
1422
+ * invite was sent; it joins when it accepts.
1423
+ */
1424
+ export const TeamMemberAddInvited = "invited";
1347
1425
  export const TeamInviteStatusPending = "pending";
1348
1426
  export const TeamInviteStatusAccepted = "accepted";
1349
1427
  export const TeamInviteStatusDeclined = "declined";
@@ -1442,8 +1520,8 @@ export const ResourceFeatureMarketplacePublish = "feature:marketplace_publish";
1442
1520
  */
1443
1521
  export const ResourceFeatureForms = "feature:forms";
1444
1522
  /**
1445
- * Managed sandboxes (INF-833): open to every team; a row with enabled
1446
- * false shuts one team out.
1523
+ * Managed sandboxes (INF-833): open to every team unless turned off
1524
+ * for one (FeatureOpen).
1447
1525
  */
1448
1526
  export const ResourceFeatureSandboxes = "feature:sandboxes";
1449
1527
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.38.3",
3
+ "version": "0.38.5",
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",
@@ -80,7 +80,7 @@
80
80
  "eventsource": "^5.1.1"
81
81
  },
82
82
  "devDependencies": {
83
- "@sveltejs/kit": "^2.60.1",
83
+ "@sveltejs/kit": "^3.1.1",
84
84
  "@types/express": "^5.0.0",
85
85
  "@types/jest": "^30.0.0",
86
86
  "@types/node": "^26.1.1",