@inferencesh/sdk 0.38.8 → 0.38.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -746,11 +746,15 @@ export interface MeResponse {
746
746
  team_view?: TeamViewDTO;
747
747
  diagnostics?: DiagnosticsConfig;
748
748
  /**
749
- * Notice is an operator's notice about the caller's access, set only
750
- * when the request comes from an address restricted to sign-in and the
751
- * CLI. Empty otherwise.
749
+ * Notice is a notice about the caller's access, set only when the
750
+ * redlist restricts this request (a restricted address, or a
751
+ * restricted account): the text an access_restricted refusal carries
752
+ * as its detail. Empty otherwise. NoticeReference and NoticeContact
753
+ * are that refusal's meta.reference and meta.contact.
752
754
  */
753
755
  notice?: string;
756
+ notice_reference?: string;
757
+ notice_contact?: string;
754
758
  /**
755
759
  * PersonalTeamID is the caller's personal workspace, empty for a managed
756
760
  * account, which has none.
@@ -2938,6 +2942,100 @@ export interface CursorListResponse<T extends any> {
2938
2942
  export interface CountResponse {
2939
2943
  count: number;
2940
2944
  }
2945
+ /**
2946
+ * EgressGrantScope is what a grant lets use a login: a task or a sandbox.
2947
+ */
2948
+ export type EgressGrantScope = "task" | "sandbox";
2949
+ export declare const EgressGrantScopeTask: EgressGrantScope;
2950
+ export declare const EgressGrantScopeSandbox: EgressGrantScope;
2951
+ /**
2952
+ * EgressGrantState is where a grant stands.
2953
+ */
2954
+ export type EgressGrantState = "open" | "asked" | "allowed" | "declined" | "ended";
2955
+ /**
2956
+ * EgressGrantOpen: the scope may be asked for the login; nobody has
2957
+ * been yet.
2958
+ */
2959
+ export declare const EgressGrantOpen: EgressGrantState;
2960
+ /**
2961
+ * EgressGrantAsked: a card is open (EgressGrantDTO.InterruptID).
2962
+ */
2963
+ export declare const EgressGrantAsked: EgressGrantState;
2964
+ /**
2965
+ * EgressGrantAllowed: the scope gets the login.
2966
+ */
2967
+ export declare const EgressGrantAllowed: EgressGrantState;
2968
+ /**
2969
+ * EgressGrantDeclined: a person said no, for the scope's life.
2970
+ */
2971
+ export declare const EgressGrantDeclined: EgressGrantState;
2972
+ /**
2973
+ * EgressGrantEnded: the grant no longer holds (Reason says why); the
2974
+ * scope keeps running, and its next use decides again.
2975
+ */
2976
+ export declare const EgressGrantEnded: EgressGrantState;
2977
+ /**
2978
+ * EgressGrantSource is where a grant came from.
2979
+ */
2980
+ export type EgressGrantSource = "app_declared" | "agent_config" | "sandbox_create" | "owner_approval" | "connected_offer" | "reconnect";
2981
+ export declare const EgressGrantSourceAppDeclared: EgressGrantSource;
2982
+ export declare const EgressGrantSourceAgentConfig: EgressGrantSource;
2983
+ export declare const EgressGrantSourceSandboxCreate: EgressGrantSource;
2984
+ export declare const EgressGrantSourceOwnerApproval: EgressGrantSource;
2985
+ export declare const EgressGrantSourceConnectedOffer: EgressGrantSource;
2986
+ export declare const EgressGrantSourceReconnect: EgressGrantSource;
2987
+ /**
2988
+ * EgressGrantReason is why a grant was declined or ended.
2989
+ */
2990
+ export type EgressGrantReason = "declined" | "login_deleted" | "login_disconnected" | "not_owner" | "expired_lifetime" | "scopes_missing" | "scope_ended" | "revoked_by_owner";
2991
+ export declare const EgressGrantReasonDeclined: EgressGrantReason;
2992
+ export declare const EgressGrantReasonLoginDeleted: EgressGrantReason;
2993
+ export declare const EgressGrantReasonLoginDisconnected: EgressGrantReason;
2994
+ export declare const EgressGrantReasonNotOwner: EgressGrantReason;
2995
+ export declare const EgressGrantReasonExpiredLifetime: EgressGrantReason;
2996
+ export declare const EgressGrantReasonScopesMissing: EgressGrantReason;
2997
+ export declare const EgressGrantReasonScopeEnded: EgressGrantReason;
2998
+ export declare const EgressGrantReasonRevokedByOwner: EgressGrantReason;
2999
+ /**
3000
+ * EgressGrantDTO is one decision that a task or a sandbox may use a
3001
+ * provider's login through the engine's egress gateway: what was allowed,
3002
+ * who allowed it and why, and which login answers (INF-1173). It never
3003
+ * holds a value. GET /sandboxes/{id}/grants, GET /tasks/{id}/grants.
3004
+ */
3005
+ export interface EgressGrantDTO {
3006
+ id: string;
3007
+ scope: EgressGrantScope;
3008
+ scope_id: string;
3009
+ /**
3010
+ * Provider is the provider's slug.
3011
+ */
3012
+ provider: string;
3013
+ mode: SandboxCredentialMode;
3014
+ state: EgressGrantState;
3015
+ source: EgressGrantSource;
3016
+ /**
3017
+ * GrantedBy is the user who allowed it: the task's user for an app's
3018
+ * declaration, the agent config's owner for its own, the answering
3019
+ * owner for an approval.
3020
+ */
3021
+ granted_by?: string;
3022
+ /**
3023
+ * CredentialID is the login that answers; empty until first use picks
3024
+ * one.
3025
+ */
3026
+ credential_id?: string;
3027
+ /**
3028
+ * Host is the first host it was wanted for.
3029
+ */
3030
+ host?: string;
3031
+ /**
3032
+ * Reason is why it was declined or ended.
3033
+ */
3034
+ reason?: EgressGrantReason;
3035
+ created_at: string;
3036
+ updated_at: string;
3037
+ ended_at?: string;
3038
+ }
2941
3039
  /**
2942
3040
  * EngineConfig holds engine configuration (no gorm tags).
2943
3041
  */
@@ -3110,7 +3208,7 @@ export interface WorkerRAM {
3110
3208
  * a task lists the ones it needs (Task.Requires); the scheduler only sends
3111
3209
  * a task to an engine that has every one it needs.
3112
3210
  */
3113
- export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending";
3211
+ export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending" | "egress_grants";
3114
3212
  /**
3115
3213
  * EngineCapabilityEgressGateway: the engine runs its sandboxes behind
3116
3214
  * the egress gateway, so it can take bound secrets (the v2 secrets
@@ -3135,6 +3233,15 @@ export declare const EngineCapabilityCapacity: EngineCapability;
3135
3233
  * reach (POST /engines/{id}/egress/hosts) (INF-1173).
3136
3234
  */
3137
3235
  export declare const EngineCapabilityEgressPending: EngineCapability;
3236
+ /**
3237
+ * EngineCapabilityEgressGrants: the engine's gateway holds a fetched
3238
+ * value only BoundSecret.KeepFor (at most until it expires), answers a
3239
+ * refused binding with EgressResolveResponse.Reason, wipes a binding's
3240
+ * held value when it is declined, and takes egress_revoke
3241
+ * (WsEgressRevokePayload). Tasks are sent pending bindings only on such
3242
+ * an engine (INF-1173).
3243
+ */
3244
+ export declare const EngineCapabilityEgressGrants: EngineCapability;
3138
3245
  /**
3139
3246
  * EngineCapabilities is a set of capabilities, kept as a list. Nil and
3140
3247
  * empty are the same: nothing beyond the base contract.
@@ -3272,7 +3379,7 @@ export interface DecideEntitlementRequestRequest {
3272
3379
  * and APIError.Code on the legacy envelope. Clients branch on these, so a
3273
3380
  * code is a named const here, where it generates into models and the SDKs.
3274
3381
  */
3275
- 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";
3382
+ 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" | "access_restricted" | "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";
3276
3383
  export declare const ErrorCodeInvalidRequest: ErrorCode;
3277
3384
  export declare const ErrorCodeValidationError: ErrorCode;
3278
3385
  export declare const ErrorCodeUnauthorized: ErrorCode;
@@ -3286,9 +3393,16 @@ export declare const ErrorCodeMethodNotAllowed: ErrorCode;
3286
3393
  export declare const ErrorCodeRateLimited: ErrorCode;
3287
3394
  export declare const ErrorCodeInternalError: ErrorCode;
3288
3395
  /**
3289
- * ErrorCodeWebAccessRestricted (403): the request comes from an address
3290
- * restricted to sign-in and the CLI; detail is the operator's notice
3291
- * and meta is WebAccessRestrictedMeta.
3396
+ * ErrorCodeAccessRestricted (403): the redlist refuses the request (a
3397
+ * restricted address, or a restricted account outside sign-in, /me,
3398
+ * telemetry and balance). detail is the notice to show the person, as
3399
+ * is; meta is AccessRestrictedMeta: a reference to quote and who to
3400
+ * contact.
3401
+ */
3402
+ export declare const ErrorCodeAccessRestricted: ErrorCode;
3403
+ /**
3404
+ * ErrorCodeWebAccessRestricted is no longer sent: refusals are
3405
+ * access_restricted. Kept so clients that name it still build.
3292
3406
  */
3293
3407
  export declare const ErrorCodeWebAccessRestricted: ErrorCode;
3294
3408
  /**
package/dist/types.js CHANGED
@@ -438,6 +438,44 @@ export const ToolRiskMedium = "medium";
438
438
  * ToolRiskHigh: dangerous or irreversible changes.
439
439
  */
440
440
  export const ToolRiskHigh = "high";
441
+ export const EgressGrantScopeTask = "task";
442
+ export const EgressGrantScopeSandbox = "sandbox";
443
+ /**
444
+ * EgressGrantOpen: the scope may be asked for the login; nobody has
445
+ * been yet.
446
+ */
447
+ export const EgressGrantOpen = "open";
448
+ /**
449
+ * EgressGrantAsked: a card is open (EgressGrantDTO.InterruptID).
450
+ */
451
+ export const EgressGrantAsked = "asked";
452
+ /**
453
+ * EgressGrantAllowed: the scope gets the login.
454
+ */
455
+ export const EgressGrantAllowed = "allowed";
456
+ /**
457
+ * EgressGrantDeclined: a person said no, for the scope's life.
458
+ */
459
+ export const EgressGrantDeclined = "declined";
460
+ /**
461
+ * EgressGrantEnded: the grant no longer holds (Reason says why); the
462
+ * scope keeps running, and its next use decides again.
463
+ */
464
+ export const EgressGrantEnded = "ended";
465
+ export const EgressGrantSourceAppDeclared = "app_declared";
466
+ export const EgressGrantSourceAgentConfig = "agent_config";
467
+ export const EgressGrantSourceSandboxCreate = "sandbox_create";
468
+ export const EgressGrantSourceOwnerApproval = "owner_approval";
469
+ export const EgressGrantSourceConnectedOffer = "connected_offer";
470
+ export const EgressGrantSourceReconnect = "reconnect";
471
+ export const EgressGrantReasonDeclined = "declined";
472
+ export const EgressGrantReasonLoginDeleted = "login_deleted";
473
+ export const EgressGrantReasonLoginDisconnected = "login_disconnected";
474
+ export const EgressGrantReasonNotOwner = "not_owner";
475
+ export const EgressGrantReasonExpiredLifetime = "expired_lifetime";
476
+ export const EgressGrantReasonScopesMissing = "scopes_missing";
477
+ export const EgressGrantReasonScopeEnded = "scope_ended";
478
+ export const EgressGrantReasonRevokedByOwner = "revoked_by_owner";
441
479
  /**
442
480
  * EngineCapabilityEgressGateway: the engine runs its sandboxes behind
443
481
  * the egress gateway, so it can take bound secrets (the v2 secrets
@@ -462,6 +500,15 @@ export const EngineCapabilityCapacity = "capacity";
462
500
  * reach (POST /engines/{id}/egress/hosts) (INF-1173).
463
501
  */
464
502
  export const EngineCapabilityEgressPending = "egress_pending";
503
+ /**
504
+ * EngineCapabilityEgressGrants: the engine's gateway holds a fetched
505
+ * value only BoundSecret.KeepFor (at most until it expires), answers a
506
+ * refused binding with EgressResolveResponse.Reason, wipes a binding's
507
+ * held value when it is declined, and takes egress_revoke
508
+ * (WsEgressRevokePayload). Tasks are sent pending bindings only on such
509
+ * an engine (INF-1173).
510
+ */
511
+ export const EngineCapabilityEgressGrants = "egress_grants";
465
512
  export const ErrorCodeInvalidRequest = "invalid_request";
466
513
  export const ErrorCodeValidationError = "validation_error";
467
514
  export const ErrorCodeUnauthorized = "unauthorized";
@@ -475,9 +522,16 @@ export const ErrorCodeMethodNotAllowed = "method_not_allowed";
475
522
  export const ErrorCodeRateLimited = "rate_limited";
476
523
  export const ErrorCodeInternalError = "internal_error";
477
524
  /**
478
- * ErrorCodeWebAccessRestricted (403): the request comes from an address
479
- * restricted to sign-in and the CLI; detail is the operator's notice
480
- * and meta is WebAccessRestrictedMeta.
525
+ * ErrorCodeAccessRestricted (403): the redlist refuses the request (a
526
+ * restricted address, or a restricted account outside sign-in, /me,
527
+ * telemetry and balance). detail is the notice to show the person, as
528
+ * is; meta is AccessRestrictedMeta: a reference to quote and who to
529
+ * contact.
530
+ */
531
+ export const ErrorCodeAccessRestricted = "access_restricted";
532
+ /**
533
+ * ErrorCodeWebAccessRestricted is no longer sent: refusals are
534
+ * access_restricted. Kept so clients that name it still build.
481
535
  */
482
536
  export const ErrorCodeWebAccessRestricted = "web_access_restricted";
483
537
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.38.8",
3
+ "version": "0.38.9",
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",