@inferencesh/sdk 0.25.0 → 0.26.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/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.26.0] - 2026-10-12
11
+
12
+ Breaking (types only, following the API's credential model): `CredentialRequirement.provider` is now a `ProviderSeed` object (`{ name?, website? }`) instead of a string, and the requirement's `name`, `website` and `key` fields moved into it. Requirements are keyed by slug.
13
+
14
+ ### Added
15
+
16
+ - Generated types for the credential model: `ProviderSeed`, `ProviderSummary`, `ConnectTokens`, `SecretField`, `CredentialRequirements`, and the auth scheme vocabulary (`AuthSchemeKind`, `AuthSchemeFlow`, `AuthSchemeAPIKeyIn`, `AuthSchemeHTTPScheme`, `AuthSchemeClientAuth`), plus `provider_info` and MCP credentials on the DTOs.
17
+
10
18
  ## [0.25.0] - 2026-10-12
11
19
 
12
20
  ### Added
package/dist/types.d.ts CHANGED
@@ -548,7 +548,7 @@ export interface AppVersionInput {
548
548
  };
549
549
  kernel?: string;
550
550
  required_secrets?: SecretRequirement[];
551
- required_credentials?: CredentialRequirement[];
551
+ required_credentials?: CredentialRequirements;
552
552
  resources?: AppResources;
553
553
  }
554
554
  /**
@@ -1408,7 +1408,7 @@ export interface AppFunction {
1408
1408
  * in app code. Each must be covered by the app-wide list in inf.yml.
1409
1409
  * Empty means the function gets the app-wide list.
1410
1410
  */
1411
- credentials?: CredentialRequirement[];
1411
+ credentials?: CredentialRequirements;
1412
1412
  /**
1413
1413
  * Annotations are MCP tool hints (read-only, destructive, idempotent,
1414
1414
  * open-world) declared on the function. Hints only: nothing trusts
@@ -1448,33 +1448,63 @@ export interface SecretRequirement {
1448
1448
  optional?: boolean;
1449
1449
  }
1450
1450
  /**
1451
- * CredentialRequirement is an entry under credentials: in inf.yml: keys an
1452
- * app needs that belong to a provider. Provider names whose credential
1453
- * supplies them; Secrets lists the keys to inject from it (an API key
1454
- * credential), Scopes what to ask for (an OAuth one).
1451
+ * CredentialRequirement is an entry under credentials: in inf.yml: a
1452
+ * credential the app uses, keyed by the credential's slug (what
1453
+ * Credential.Provider stores). Secrets lists the keys to inject from it (an
1454
+ * API key credential), Scopes what to ask for (an OAuth one), Capabilities
1455
+ * the platform-defined grants it needs ("x.tweet.read", "google.sheets":
1456
+ * an OAuth grant with the scopes it implies), each a capability of the
1457
+ * entry's own provider. Provider seeds the catalog row for the company the
1458
+ * first time it is seen and never overwrites it; Auth seeds the auth scheme
1459
+ * when the slug is free.
1455
1460
  * credentials:
1456
- * - provider: acme
1457
- * name: Acme CRM
1458
- * website: acme.com
1461
+ * slack:
1462
+ * capabilities: [slack.channels.write]
1463
+ * acme:
1459
1464
  * secrets: [ACME_API_KEY]
1460
- * Key is a capability of a provider the platform defines ("x.tweet.read",
1461
- * "google.sheets"): an OAuth grant with the scopes it implies. An entry sets
1462
- * Provider, Key, or both; with both, Key decides how it is resolved.
1465
+ * provider: {name: Acme CRM, website: acme.com}
1466
+ * The list form that preceded it is still read: `- provider: acme` names
1467
+ * the slug, `- key: x.tweet.read` a capability (its slug is the part
1468
+ * before the first dot), `name:` and `website:` seed the provider.
1463
1469
  */
1464
1470
  export interface CredentialRequirement {
1465
- provider?: string;
1466
- /**
1467
- * Name and Website describe a provider the platform does not list: the
1468
- * name its credential is shown under and the site its logo comes from.
1469
- */
1470
- name?: string;
1471
- website?: string;
1472
- key?: string;
1471
+ slug?: string;
1472
+ capabilities?: string[];
1473
1473
  description?: string;
1474
1474
  optional?: boolean;
1475
1475
  secrets?: string[];
1476
1476
  scopes?: string[];
1477
+ /**
1478
+ * Provider describes the company the credential belongs to, for a
1479
+ * catalog row that does not exist yet. Its slug defaults to the
1480
+ * credential slug.
1481
+ */
1482
+ provider?: ProviderSeed;
1483
+ /**
1484
+ * Auth is the credential's auth scheme, for a slug no row defines yet.
1485
+ */
1486
+ auth?: AuthSchemeSpec;
1477
1487
  }
1488
+ /**
1489
+ * ProviderSeed is a provider (the company behind a credential) as an app
1490
+ * declares it: enough to create its catalog row when none exists.
1491
+ */
1492
+ export interface ProviderSeed {
1493
+ slug?: string;
1494
+ name?: string;
1495
+ description?: string;
1496
+ website?: string;
1497
+ logo_uri?: string;
1498
+ docs_uri?: string;
1499
+ tos_uri?: string;
1500
+ policy_uri?: string;
1501
+ }
1502
+ /**
1503
+ * CredentialRequirements is the credentials: list of a manifest. It reads
1504
+ * both forms: a map keyed by credential slug (the current one) and a list
1505
+ * of entries; it is always written as a list.
1506
+ */
1507
+ export type CredentialRequirements = CredentialRequirement[];
1478
1508
  /**
1479
1509
  * AppDTO is the API response for a full app.
1480
1510
  */
@@ -1571,7 +1601,7 @@ export interface AppVersionDTO extends BaseModelDTO {
1571
1601
  };
1572
1602
  kernel: string;
1573
1603
  required_secrets?: SecretRequirement[];
1574
- required_credentials?: CredentialRequirement[];
1604
+ required_credentials?: CredentialRequirements;
1575
1605
  resources: AppResources;
1576
1606
  /**
1577
1607
  * Sandbox is the version's declared sandbox exceptions. Absent on a
@@ -2449,6 +2479,16 @@ export interface ToolExplanationDTO {
2449
2479
  */
2450
2480
  risk: string;
2451
2481
  }
2482
+ /**
2483
+ * ConnectTokens are tokens a provider minted while connecting, for grants
2484
+ * that need no redirect (OAuth client credentials): the credential service
2485
+ * saves them on the login it writes. They travel inside the process only.
2486
+ */
2487
+ export interface ConnectTokens {
2488
+ AccessToken: SensitiveString;
2489
+ RefreshToken: SensitiveString;
2490
+ ExpiresAt?: string;
2491
+ }
2452
2492
  /**
2453
2493
  * CredentialDTO is the API response for a credential (never exposes secrets).
2454
2494
  */
@@ -2478,12 +2518,32 @@ export interface CredentialDTO extends BaseModelDTO, PermissionModelDTO {
2478
2518
  is_primary: boolean;
2479
2519
  error_message?: string;
2480
2520
  }
2521
+ /**
2522
+ * ProviderSummary is the company a credential slug belongs to: the
2523
+ * providers row's identity, for grouping and display.
2524
+ */
2525
+ export interface ProviderSummary {
2526
+ slug: string;
2527
+ name: string;
2528
+ icon_url?: string;
2529
+ website?: string;
2530
+ docs_url?: string;
2531
+ }
2481
2532
  /**
2482
2533
  * CredentialConfigDTO is the merged view: provider catalog + credential state.
2483
2534
  */
2484
2535
  export interface CredentialConfigDTO {
2485
2536
  slug: string;
2537
+ /**
2538
+ * Provider is the credential slug (what Credential.Provider stores):
2539
+ * one way to authenticate. The company it belongs to is ProviderInfo.
2540
+ */
2486
2541
  provider: string;
2542
+ /**
2543
+ * ProviderInfo is the company this slug belongs to, for grouping: the
2544
+ * providers row its auth scheme names, else the slug's own identity.
2545
+ */
2546
+ provider_info?: ProviderSummary;
2487
2547
  type: string;
2488
2548
  name: string;
2489
2549
  short_name: string;
@@ -3970,6 +4030,13 @@ export interface MCPServerDTO {
3970
4030
  */
3971
4031
  setup?: MCPServerSetup;
3972
4032
  documentation_url: string;
4033
+ /**
4034
+ * Credentials is what the server needs to be called (the same shape as
4035
+ * an app's inf.yml credentials). CredentialSlug is the first entry's
4036
+ * slug: the vault entry a call sends, so a page can link to it.
4037
+ */
4038
+ credentials?: CredentialRequirements;
4039
+ credential_slug?: string;
3973
4040
  connection_status?: string;
3974
4041
  /**
3975
4042
  * ConnectionScope is who the caller's connection to this server belongs
@@ -4481,7 +4548,7 @@ export interface SetupAction {
4481
4548
  */
4482
4549
  export interface CheckRequirementsRequest {
4483
4550
  secrets?: SecretRequirement[];
4484
- credentials?: CredentialRequirement[];
4551
+ credentials?: CredentialRequirements;
4485
4552
  }
4486
4553
  /**
4487
4554
  * CheckRequirementsResponse is the API response for checking requirements
@@ -4534,6 +4601,23 @@ export interface SecretDTO extends BaseModelDTO, PermissionModelDTO {
4534
4601
  */
4535
4602
  credential_id?: string;
4536
4603
  }
4604
+ /**
4605
+ * SensitiveString is a string type that prevents accidental exposure of secrets.
4606
+ * It redacts in JSON/fmt output unless explicitly accessed via .Expose().
4607
+ * Encryption at rest is handled by the GORM "sensitive" serializer
4608
+ * (api/internal/lib/secrets). Fields must be tagged: `gorm:"serializer:sensitive"`
4609
+ * Note: map-based GORM Updates (map[string]any{"value": ...}) bypass serializers.
4610
+ * Always use struct-based operations for SensitiveString fields.
4611
+ * Redaction:
4612
+ * - JSON serialization: always returns "" (empty string)
4613
+ * - fmt.Sprintf with %s, %v, %#v: always returns "[REDACTED]"
4614
+ * - Only .Expose() returns the actual value
4615
+ * Encryption is enabled when SECRETS_ENCRYPTION_KEY env var is set.
4616
+ * Values are stored as "enc:v2:<encrypted_dek>:<encrypted_data>" in the database.
4617
+ * Key rotation only re-encrypts the DEK, not the data.
4618
+ */
4619
+ export interface SensitiveString {
4620
+ }
4537
4621
  /**
4538
4622
  * SocketAccess is where one end of a socket dials and the credential it
4539
4623
  * presents. The task's caller gets one in the run response; the worker gets
@@ -5410,6 +5494,372 @@ export declare const GPUTypeIntel: GPUType;
5410
5494
  export declare const GPUTypeNvidia: GPUType;
5411
5495
  export declare const GPUTypeAMD: GPUType;
5412
5496
  export declare const GPUTypeApple: GPUType;
5497
+ /**
5498
+ * AuthSchemeKind is how a provider authenticates: the kinds of an OpenAPI
5499
+ * Security Scheme Object (oauth2, apiKey, http), named the same so a
5500
+ * vendor's spec maps onto a scheme without translation.
5501
+ */
5502
+ export type AuthSchemeKind = "oauth2" | "api_key" | "http" | "oauth2_authorization_code";
5503
+ /**
5504
+ * AuthSchemeOAuth2 is OAuth 2.0; Flow says which grant.
5505
+ */
5506
+ export declare const AuthSchemeOAuth2: AuthSchemeKind;
5507
+ /**
5508
+ * AuthSchemeAPIKey is one or more keys a person pastes, sent as a
5509
+ * header or query parameter.
5510
+ */
5511
+ export declare const AuthSchemeAPIKey: AuthSchemeKind;
5512
+ /**
5513
+ * AuthSchemeHTTP is a pasted secret sent as an HTTP auth scheme
5514
+ * (Authorization: Bearer or Basic).
5515
+ */
5516
+ export declare const AuthSchemeHTTP: AuthSchemeKind;
5517
+ /**
5518
+ * Deprecated: the kind is AuthSchemeOAuth2 with AuthSchemeFlowAuthorizationCode.
5519
+ * Same value, so comparisons keep working; rows still stored as
5520
+ * "oauth2_authorization_code" are read as oauth2 (UnmarshalJSON).
5521
+ */
5522
+ export declare const AuthSchemeOAuth2AuthorizationCode: "oauth2";
5523
+ /**
5524
+ * AuthSchemeFlow is the OAuth 2.0 grant an oauth2 scheme uses.
5525
+ */
5526
+ export type AuthSchemeFlow = "authorization_code" | "client_credentials";
5527
+ /**
5528
+ * AuthSchemeFlowAuthorizationCode is the user-consent flow: authorization
5529
+ * endpoint → code → token endpoint, optionally with PKCE. The default.
5530
+ */
5531
+ export declare const AuthSchemeFlowAuthorizationCode: AuthSchemeFlow;
5532
+ /**
5533
+ * AuthSchemeFlowClientCredentials is server-to-server: the app's client
5534
+ * id and secret are exchanged at the token endpoint, no redirect, no
5535
+ * user. The login is the app's own.
5536
+ */
5537
+ export declare const AuthSchemeFlowClientCredentials: AuthSchemeFlow;
5538
+ /**
5539
+ * AuthSchemeAPIKeyIn is where an api_key scheme's key travels.
5540
+ */
5541
+ export type AuthSchemeAPIKeyIn = "header" | "query";
5542
+ export declare const AuthSchemeAPIKeyInHeader: AuthSchemeAPIKeyIn;
5543
+ export declare const AuthSchemeAPIKeyInQuery: AuthSchemeAPIKeyIn;
5544
+ /**
5545
+ * AuthSchemeHTTPScheme is the Authorization scheme of an http scheme.
5546
+ */
5547
+ export type AuthSchemeHTTPScheme = "bearer" | "basic";
5548
+ export declare const AuthSchemeHTTPBearer: AuthSchemeHTTPScheme;
5549
+ export declare const AuthSchemeHTTPBasic: AuthSchemeHTTPScheme;
5550
+ /**
5551
+ * SecretField is one value a person pastes to connect an api_key or http
5552
+ * scheme: its vault key and how the form asks for it. Several fields make
5553
+ * a multi-secret provider (Kling's access and secret key).
5554
+ */
5555
+ export interface SecretField {
5556
+ key: string;
5557
+ label?: string;
5558
+ placeholder?: string;
5559
+ sensitive?: boolean;
5560
+ optional?: boolean;
5561
+ }
5562
+ /**
5563
+ * AuthSchemeClientAuth is how client_id/client_secret reach the token
5564
+ * endpoint. Most providers accept either; a few insist on one.
5565
+ */
5566
+ export type AuthSchemeClientAuth = "basic" | "body";
5567
+ /**
5568
+ * AuthSchemeClientAuthBasic sends them as an HTTP Basic Authorization
5569
+ * header (RFC 6749 §2.3.1, the default).
5570
+ */
5571
+ export declare const AuthSchemeClientAuthBasic: AuthSchemeClientAuth;
5572
+ /**
5573
+ * AuthSchemeClientAuthBody sends them as form fields in the request body.
5574
+ */
5575
+ export declare const AuthSchemeClientAuthBody: AuthSchemeClientAuth;
5576
+ /**
5577
+ * AuthSchemeTokenRequest is the token request's body encoding.
5578
+ */
5579
+ export type AuthSchemeTokenRequest = "form" | "json";
5580
+ export declare const AuthSchemeTokenRequestForm: AuthSchemeTokenRequest;
5581
+ export declare const AuthSchemeTokenRequestJSON: AuthSchemeTokenRequest;
5582
+ /**
5583
+ * AuthSchemeRefresh is when an access token is refreshed.
5584
+ */
5585
+ export type AuthSchemeRefresh = "" | "always";
5586
+ /**
5587
+ * AuthSchemeRefreshWhenExpiring refreshes within five minutes of the
5588
+ * reported expiry; a token with no expiry is treated as long-lived
5589
+ * (Slack without token rotation, Notion).
5590
+ */
5591
+ export declare const AuthSchemeRefreshWhenExpiring: AuthSchemeRefresh;
5592
+ /**
5593
+ * AuthSchemeRefreshAlways refreshes on every read: the provider reports
5594
+ * no expiry but the token does expire (Salesforce's session timeout is
5595
+ * per org and not reported).
5596
+ */
5597
+ export declare const AuthSchemeRefreshAlways: AuthSchemeRefresh;
5598
+ /**
5599
+ * AuthSchemeRevokeStyle is how the token reaches the revoke endpoint.
5600
+ */
5601
+ export type AuthSchemeRevokeStyle = "bearer" | "query" | "form";
5602
+ export declare const AuthSchemeRevokeBearer: AuthSchemeRevokeStyle;
5603
+ export declare const AuthSchemeRevokeQuery: AuthSchemeRevokeStyle;
5604
+ export declare const AuthSchemeRevokeForm: AuthSchemeRevokeStyle;
5605
+ /**
5606
+ * AuthSchemeRevoke is the optional token revocation on disconnect.
5607
+ */
5608
+ export interface AuthSchemeRevoke {
5609
+ url: string;
5610
+ style: AuthSchemeRevokeStyle;
5611
+ /**
5612
+ * ClientAuth also sends client_id and client_secret in the form
5613
+ * (Discord).
5614
+ */
5615
+ client_auth?: boolean;
5616
+ }
5617
+ /**
5618
+ * AuthSchemeAppKey is one key of the OAuth app a login goes through. The
5619
+ * client id and secret are implied (PREFIX_CLIENT_ID, PREFIX_CLIENT_SECRET);
5620
+ * listing them only overrides their label and placeholder. Other keys
5621
+ * (bot_token, signing_secret, tenant_id) are optional extras the app holds,
5622
+ * read back by name in templates as {app.<name>} and by hooks.
5623
+ */
5624
+ export interface AuthSchemeAppKey {
5625
+ /**
5626
+ * Name is the key's role: client_id, client_secret, bot_token, …
5627
+ */
5628
+ name: string;
5629
+ /**
5630
+ * Key is the vault key; default PREFIX_<NAME>.
5631
+ */
5632
+ key?: string;
5633
+ label?: string;
5634
+ placeholder?: string;
5635
+ sensitive?: boolean;
5636
+ /**
5637
+ * Optional is implied for every name but client_id and client_secret.
5638
+ */
5639
+ optional?: boolean;
5640
+ }
5641
+ /**
5642
+ * AuthSchemeLookup is a call made after the token exchange, with the new
5643
+ * access token as bearer; its decoded response becomes a document root of
5644
+ * its name for the identity, metadata and later lookups ({user.email},
5645
+ * {resources.0.id}). userinfo_url is shorthand for the lookup named user.
5646
+ * URL, body and headers are templates.
5647
+ */
5648
+ export interface AuthSchemeLookup {
5649
+ name: string;
5650
+ url: string;
5651
+ method?: string;
5652
+ /**
5653
+ * Body is sent as is; a JSON body is the default content type
5654
+ * (Dropbox's "null", Linear's GraphQL query).
5655
+ */
5656
+ body?: string;
5657
+ content_type?: string;
5658
+ headers?: {
5659
+ [key: string]: string;
5660
+ };
5661
+ }
5662
+ /**
5663
+ * AuthSchemeCapability is something an app can ask for from this provider,
5664
+ * satisfied by a connection holding its scopes. Scopes are in the scheme's
5665
+ * own (friendly) names, the ones a credential stores.
5666
+ */
5667
+ export interface AuthSchemeCapability {
5668
+ key: string;
5669
+ scopes?: string[];
5670
+ satisfies?: string[];
5671
+ display_name: string;
5672
+ description?: string;
5673
+ }
5674
+ /**
5675
+ * AuthSchemeSpec is one way to authenticate against a provider, as data.
5676
+ * Everything a standard OAuth2 provider needs is a field; where a provider
5677
+ * deviates in a way data cannot express, the spec names a hook and Go
5678
+ * supplies it (authprovider.RegisterTokenResponseHook and friends).
5679
+ * Templates: URLs, headers, lookup bodies, identifier, name, metadata and
5680
+ * env values are strings with {{path}} placeholders. A path is read from
5681
+ * the flow's document, which grows as the flow goes:
5682
+ * client_id from the authorize step on
5683
+ * vars.* (and each var bare) what the vars hook produced, e.g. {{tenant}}
5684
+ * access_token, token.* after the token exchange (token.* is the
5685
+ * decoded response)
5686
+ * callback.* the other query params the callback carried
5687
+ * (QuickBooks' realmId, Shopify's shop)
5688
+ * <lookup>.* each lookup's response, by its name; user.*
5689
+ * is the userinfo lookup
5690
+ * expires_at, metadata.*, app.* env only: the token's expiry (RFC 3339),
5691
+ * the stored metadata, the app's extra keys
5692
+ * Array elements are indexed: {{resources.0.id}}. {{a|b}} takes the first
5693
+ * path present. A template none of whose placeholders resolve renders "":
5694
+ * omitted from env and metadata, blank as identifier or name.
5695
+ */
5696
+ export interface AuthSchemeSpec {
5697
+ kind: AuthSchemeKind;
5698
+ /**
5699
+ * Flow is the oauth2 grant; empty means authorization_code.
5700
+ */
5701
+ flow?: AuthSchemeFlow;
5702
+ /**
5703
+ * Fields are what a person pastes (api_key and http kinds).
5704
+ */
5705
+ fields?: SecretField[];
5706
+ /**
5707
+ * In and ParamName say where an api_key key goes on a request: the
5708
+ * header or query parameter of that name. ValuePrefix is prepended to
5709
+ * the value ("Bearer "). Not needed to connect; read by injection.
5710
+ */
5711
+ in?: AuthSchemeAPIKeyIn;
5712
+ param_name?: string;
5713
+ value_prefix?: string;
5714
+ /**
5715
+ * Scheme and BearerFormat describe an http kind's Authorization header.
5716
+ */
5717
+ scheme?: AuthSchemeHTTPScheme;
5718
+ bearer_format?: string;
5719
+ authorization_endpoint?: string;
5720
+ scopes?: string[];
5721
+ /**
5722
+ * ScopeAliases map the scheme's own scope names to what the provider
5723
+ * wants on the wire ("gmail.send" → "https://www.googleapis.com/auth/
5724
+ * gmail.send"). Credentials store the alias; the wire form is used only
5725
+ * in requests. A scope with no alias is sent as is.
5726
+ */
5727
+ scope_aliases?: {
5728
+ [key: string]: string;
5729
+ };
5730
+ scope_param?: string;
5731
+ scope_separator?: string;
5732
+ omit_scope_param?: boolean;
5733
+ pkce?: boolean;
5734
+ /**
5735
+ * ClientIDParam is the name the client id travels under in the
5736
+ * authorize URL and the token body; default "client_id" (TikTok:
5737
+ * "client_key").
5738
+ */
5739
+ client_id_param?: string;
5740
+ /**
5741
+ * ExtraAuthorizeParams are appended to the authorize URL verbatim
5742
+ * (Google's access_type=offline). AddScopesParams override them when
5743
+ * re-authorizing for more scopes (Google's include_granted_scopes).
5744
+ */
5745
+ extra_authorize_params?: {
5746
+ [key: string]: string;
5747
+ };
5748
+ add_scopes_params?: {
5749
+ [key: string]: string;
5750
+ };
5751
+ /**
5752
+ * AccountHintParam is the authorize param that names the account to sign
5753
+ * in with (Google's and Microsoft's "login_hint"). When re-authorizing
5754
+ * for more scopes it carries the login's account identifier, so the
5755
+ * provider goes to that account instead of offering a chooser. Empty =
5756
+ * no hint sent.
5757
+ */
5758
+ account_hint_param?: string;
5759
+ /**
5760
+ * AnotherAccountParams are authorize params for connecting an account
5761
+ * next to one already connected: the provider shows its account chooser
5762
+ * instead of signing the user back in to the account it remembers
5763
+ * (Google prompt=select_account). They override ExtraAuthorizeParams.
5764
+ */
5765
+ another_account_params?: {
5766
+ [key: string]: string;
5767
+ };
5768
+ /**
5769
+ * RequiredScopes are always requested, on a connect and when
5770
+ * re-authorizing for more scopes, whatever the caller asked for: the
5771
+ * scopes the identity lookup and token refresh need (Google's openid,
5772
+ * email and profile; X's users.read and offline.access). In the
5773
+ * scheme's own names, like Scopes. Empty = only what was asked for.
5774
+ */
5775
+ required_scopes?: string[];
5776
+ /**
5777
+ * IncrementalAddScopes: re-authorizing for more scopes asks only for
5778
+ * the new ones (plus RequiredScopes), and the provider returns a token
5779
+ * that also covers what the login already holds (Google, with
5780
+ * include_granted_scopes in AddScopesParams). Without it the full list
5781
+ * is asked for again.
5782
+ */
5783
+ incremental_add_scopes?: boolean;
5784
+ token_endpoint?: string;
5785
+ /**
5786
+ * RevocationEndpoint is the RFC 7009 endpoint, when the provider has
5787
+ * one and Revoke names no style of its own: tokens are revoked there
5788
+ * with a form POST.
5789
+ */
5790
+ revocation_endpoint?: string;
5791
+ client_auth?: AuthSchemeClientAuth;
5792
+ token_request?: AuthSchemeTokenRequest;
5793
+ /**
5794
+ * Headers go on every request to the provider (User-Agent for Reddit,
5795
+ * Notion-Version); values are templates ({{client_id}} for Twitch's
5796
+ * Client-Id).
5797
+ */
5798
+ headers?: {
5799
+ [key: string]: string;
5800
+ };
5801
+ /**
5802
+ * TokenResponseHook names the Go reader for a token response that is
5803
+ * not the RFC 6749 shape (Slack's nested authed_user). Empty = standard.
5804
+ */
5805
+ token_response_hook?: string;
5806
+ refresh?: AuthSchemeRefresh;
5807
+ revoke?: AuthSchemeRevoke;
5808
+ /**
5809
+ * UserInfoURL is fetched with the new access token; the response is the
5810
+ * identity document (user.*). UserInfoURLPath instead reads that URL
5811
+ * from a path within the token response (Salesforce's "id"). Lookups
5812
+ * are further calls, each becoming a root of its name, in order, after
5813
+ * user. With none of these, the token response is all there is.
5814
+ */
5815
+ userinfo_url?: string;
5816
+ userinfo_url_path?: string;
5817
+ lookups?: AuthSchemeLookup[];
5818
+ /**
5819
+ * Identifier is the connected account's stable, human-readable id
5820
+ * ("{{user.email}}", "@{{user.data.username}}"); Name its display name.
5821
+ */
5822
+ identifier?: string;
5823
+ name?: string;
5824
+ /**
5825
+ * AccountID is the account's id as the provider keeps it and never
5826
+ * changes it ("{{user.sub}}" for Google, "{{user.data.id}}" for X), as
5827
+ * opposed to Identifier, which the user may rename. Logins are matched
5828
+ * and chosen by it. Empty = Identifier, for providers whose identifier
5829
+ * already is such an id (Slack, Notion).
5830
+ */
5831
+ account_id?: string;
5832
+ /**
5833
+ * IdentityHook names Go code that derives identifier and name when a
5834
+ * template cannot (Discord's discriminator rule). It wins over both.
5835
+ */
5836
+ identity_hook?: string;
5837
+ /**
5838
+ * Metadata is what the credential stores about the account, by key.
5839
+ */
5840
+ metadata?: {
5841
+ [key: string]: string;
5842
+ };
5843
+ /**
5844
+ * Env is what a run reads, by variable. Empty = PREFIX_ACCESS_TOKEN and
5845
+ * PREFIX_ACCESS_TOKEN_EXPIRES_AT.
5846
+ */
5847
+ env?: {
5848
+ [key: string]: string;
5849
+ };
5850
+ /**
5851
+ * AppKeys are the OAuth app's keys beyond the implied client id and
5852
+ * secret, and label overrides for those.
5853
+ */
5854
+ app_keys?: AuthSchemeAppKey[];
5855
+ /**
5856
+ * VarsHook names Go code that turns the app's extra keys into the
5857
+ * {var} values substituted into the URLs (Microsoft's tenant,
5858
+ * Salesforce's sandbox host).
5859
+ */
5860
+ vars_hook?: string;
5861
+ capabilities?: AuthSchemeCapability[];
5862
+ }
5413
5863
  /**
5414
5864
  * Visibility represents the visibility level of a resource
5415
5865
  */
package/dist/types.js CHANGED
@@ -742,6 +742,67 @@ export const GPUTypeIntel = "intel";
742
742
  export const GPUTypeNvidia = "nvidia";
743
743
  export const GPUTypeAMD = "amd";
744
744
  export const GPUTypeApple = "apple";
745
+ /**
746
+ * AuthSchemeOAuth2 is OAuth 2.0; Flow says which grant.
747
+ */
748
+ export const AuthSchemeOAuth2 = "oauth2";
749
+ /**
750
+ * AuthSchemeAPIKey is one or more keys a person pastes, sent as a
751
+ * header or query parameter.
752
+ */
753
+ export const AuthSchemeAPIKey = "api_key";
754
+ /**
755
+ * AuthSchemeHTTP is a pasted secret sent as an HTTP auth scheme
756
+ * (Authorization: Bearer or Basic).
757
+ */
758
+ export const AuthSchemeHTTP = "http";
759
+ /**
760
+ * Deprecated: the kind is AuthSchemeOAuth2 with AuthSchemeFlowAuthorizationCode.
761
+ * Same value, so comparisons keep working; rows still stored as
762
+ * "oauth2_authorization_code" are read as oauth2 (UnmarshalJSON).
763
+ */
764
+ export const AuthSchemeOAuth2AuthorizationCode = AuthSchemeOAuth2;
765
+ /**
766
+ * AuthSchemeFlowAuthorizationCode is the user-consent flow: authorization
767
+ * endpoint → code → token endpoint, optionally with PKCE. The default.
768
+ */
769
+ export const AuthSchemeFlowAuthorizationCode = "authorization_code";
770
+ /**
771
+ * AuthSchemeFlowClientCredentials is server-to-server: the app's client
772
+ * id and secret are exchanged at the token endpoint, no redirect, no
773
+ * user. The login is the app's own.
774
+ */
775
+ export const AuthSchemeFlowClientCredentials = "client_credentials";
776
+ export const AuthSchemeAPIKeyInHeader = "header";
777
+ export const AuthSchemeAPIKeyInQuery = "query";
778
+ export const AuthSchemeHTTPBearer = "bearer";
779
+ export const AuthSchemeHTTPBasic = "basic";
780
+ /**
781
+ * AuthSchemeClientAuthBasic sends them as an HTTP Basic Authorization
782
+ * header (RFC 6749 §2.3.1, the default).
783
+ */
784
+ export const AuthSchemeClientAuthBasic = "basic";
785
+ /**
786
+ * AuthSchemeClientAuthBody sends them as form fields in the request body.
787
+ */
788
+ export const AuthSchemeClientAuthBody = "body";
789
+ export const AuthSchemeTokenRequestForm = "form";
790
+ export const AuthSchemeTokenRequestJSON = "json";
791
+ /**
792
+ * AuthSchemeRefreshWhenExpiring refreshes within five minutes of the
793
+ * reported expiry; a token with no expiry is treated as long-lived
794
+ * (Slack without token rotation, Notion).
795
+ */
796
+ export const AuthSchemeRefreshWhenExpiring = "";
797
+ /**
798
+ * AuthSchemeRefreshAlways refreshes on every read: the provider reports
799
+ * no expiry but the token does expire (Salesforce's session timeout is
800
+ * per org and not reported).
801
+ */
802
+ export const AuthSchemeRefreshAlways = "always";
803
+ export const AuthSchemeRevokeBearer = "bearer";
804
+ export const AuthSchemeRevokeQuery = "query";
805
+ export const AuthSchemeRevokeForm = "form";
745
806
  export const VisibilityPrivate = "private";
746
807
  export const VisibilityTeam = "team";
747
808
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.25.0",
3
+ "version": "0.26.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",