@inferencesh/sdk 0.26.2 → 0.28.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,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.28.0] - 2026-10-15
11
+
12
+ ### Changed
13
+ - Types regenerated for the credentials vocabulary (INF-1079): `AuthSchemeDTO`, `AuthSchemeCreateRequest`, `AuthSchemeUpdateRequest`, `AuthSchemeHooksDTO`, `AuthSchemeSeedResult` are now `AuthProviderDTO`, `AuthProviderCreateRequest`, `AuthProviderUpdateRequest`, `AuthProviderHooksDTO`, `AuthProviderSeedResult`; `AuthSchemeSpec` and its `AuthScheme*` enums are `AuthMethod` and `AuthMethod*`; `ProviderDTO`, `ProviderSeed`, `ProviderSummary`, `ProviderTreeDTO`, `ProviderUpsertRequest`, `ProviderCategory`, `ProviderStatus` are `Company*`. `CredentialConfigDTO.company` is the company (`provider_info` still carries the same value, deprecated). Wire formats are unchanged.
14
+ - `pollUntilIdle` rejects once and stops polling when the run fails; `sendMessage({ stream: false })` no longer hangs forever (99075b7).
15
+ - Test mocks tidied (70cce44); dependabot overrides and `allowBuilds` in the pnpm workspace (75be627, 54b7ce1).
16
+
17
+ ## [0.27.0] - 2026-10-13
18
+
19
+ ### Changed
20
+
21
+ - `client.agent(...).sendMessage(text, { files })` sends the files as `MessageInput.attachments` (FileRefs with filename and content type) instead of the deprecated `images` / `files` URI lists.
22
+ - A `tool(...).handler()` handler may return `{ result, attachments }` (`ClientToolResult`, now exported from the package root) like a `clientToolHandlers` handler: the result text plus files uploaded with `client.files.upload`.
23
+
24
+ ### Added
25
+
26
+ - Generated types follow the API: `MCPServerDTO.connection` (`ConnectionInfo` with `MCPConnectionFacts`); `connection_status` is deprecated.
27
+
28
+ ## [0.26.2] - 2026-10-13
29
+
10
30
  Added: `mcpTool(name, { server, toolName, credentialId? })` names the MCP server by its slug (the API's model: a server declares the provider it signs in through); `credentialId` pins one connection. The old `mcpTool(name, credentialId, toolName)` still works (deprecated): the API saves such a tool with the server the connection's provider is declared by. `MCPServerUpdateBody` gains `credentials`; its `auth_type`, `oauth_client_id` and `oauth_secret_key` are no longer read by the API (the provider's OAuth app is set through `PUT /credentials/{slug}/app`). Generated types: `MCPToolConfig.server`; `MCPServerDTO.oauth_client_id`, `CredentialProviderMCP` and `CredentialTypeMCP` are gone from the API.
11
31
 
12
32
  ### Changed
@@ -6,6 +6,7 @@
6
6
  import type { Dispatch } from 'react';
7
7
  import type { AgentRunDTO, AgentVersionDTO, AlwaysAllowOptionsDTO, AlwaysAllowResultDTO, ToolExplanationDTO, ChatAgentDTO, ChatDTO, ChatMessageDTO, ChatSettingsDTO, ChatSettingsRequest, AgentTool, AgentConfigInput as GeneratedAgentConfig, CoreAppConfigInput as CoreAppConfig, FileRef, ElicitResult } from '../types.js';
8
8
  import type { HttpClient } from '../http/client.js';
9
+ import type { ClientToolResult } from '../tool-builder.js';
9
10
  import type { StreamableManager } from '../http/streamable.js';
10
11
  import type { PollManager } from '../http/poll.js';
11
12
  export type { FileRef } from '../types.js';
@@ -221,19 +222,8 @@ export interface AgentChatProviderProps {
221
222
  /** Children */
222
223
  children: React.ReactNode;
223
224
  }
224
- /**
225
- * What a client tool handler returns: the result text, or the text plus files.
226
- *
227
- * `attachments` are files already uploaded with POST /files (for example with
228
- * `client.files.upload(dataUrlOrBlob)` or the chat's `uploadFile`), passed as
229
- * `FileRef`s, the same as message attachments. An image attachment reaches the
230
- * model as image input when the model supports images; other files are listed
231
- * on the tool message.
232
- */
233
- export type ClientToolResult = string | {
234
- result: string;
235
- attachments?: FileRef[];
236
- };
225
+ /** What a client tool handler returns (defined with the tool builder). */
226
+ export type { ClientToolResult } from '../tool-builder.js';
237
227
  /**
238
228
  * Client tool handler function - takes args and returns a result (sync or async)
239
229
  */
@@ -63,8 +63,7 @@ export class Agent {
63
63
  const isTemplate = typeof this.config === 'string';
64
64
  const hasCallbacks = !!(options.onMessage || options.onChat || options.onToolCall || options.onDelta);
65
65
  // Process files - either already uploaded (FileDTO with uri) or needs upload (Blob)
66
- let imageUris;
67
- let fileUris;
66
+ let attachments;
68
67
  if (options.files && options.files.length > 0) {
69
68
  const toUpload = [];
70
69
  const alreadyUploaded = [];
@@ -78,14 +77,11 @@ export class Agent {
78
77
  }
79
78
  const uploadedFiles = toUpload.length > 0 ? await Promise.all(toUpload.map((blob) => this.files.upload(blob))) : [];
80
79
  const allFiles = [...alreadyUploaded, ...uploadedFiles];
81
- const images = allFiles.filter((f) => f.content_type?.startsWith('image/'));
82
- const others = allFiles.filter((f) => !f.content_type?.startsWith('image/'));
83
- if (images.length > 0)
84
- imageUris = images.map((f) => f.uri);
85
- if (others.length > 0)
86
- fileUris = others.map((f) => f.uri);
80
+ if (allFiles.length > 0) {
81
+ attachments = allFiles.map(({ id, uri, filename, content_type, size }) => ({ id, uri, filename, content_type, size }));
82
+ }
87
83
  }
88
- const input = { text, images: imageUris, files: fileUris, role: 'user', context: [], system_prompt: '', context_size: 0 };
84
+ const input = attachments ? { text, attachments } : { text };
89
85
  const body = {
90
86
  chat_id: this.chatId ?? undefined,
91
87
  context: this.context,
@@ -334,9 +330,9 @@ export class Agent {
334
330
  // fetched chat never carries chat_messages, so their absence cannot tell
335
331
  // the two apart.
336
332
  const unchanged = {};
337
- return new Promise((resolve) => {
333
+ return new Promise((resolve, reject) => {
338
334
  this.poller?.stop();
339
- this.poller = new PollManager({
335
+ const poller = new PollManager({
340
336
  pollFunction: async () => {
341
337
  // Lightweight status check first
342
338
  const statusResp = await this.http.request('get', `/chats/${this.chatId}/status`);
@@ -395,8 +391,19 @@ export class Agent {
395
391
  onError: (error) => {
396
392
  console.warn('[Agent] Poll error:', error);
397
393
  },
394
+ // PollManager gave up after maxRetries consecutive errors: it has
395
+ // already stopped polling, so fail the turn once. A caller stop
396
+ // (disconnect, abort, a newer turn) passes no error.
397
+ onStop: (error) => {
398
+ if (!error)
399
+ return;
400
+ if (this.poller === poller)
401
+ this.poller = null;
402
+ reject(error);
403
+ },
398
404
  });
399
- this.poller.start();
405
+ this.poller = poller;
406
+ poller.start();
400
407
  });
401
408
  }
402
409
  }
@@ -12,7 +12,7 @@
12
12
  * chats, engines and teams send PATCH; apps.patch and flows.patch are the
13
13
  * partial siblings of the POST updates that also edit a version.
14
14
  */
15
- import type { AgentConfigInput, AgentImages, AppDTO, ChatDTO, CredentialRequirements, EngineDTO, FlowDTO, FlowVersionDTO, KnowledgeDTO, ProjectDTO, TeamDTO, Visibility } from '../types.js';
15
+ import type { AgentConfigInput, ResourceImages, AppDTO, ChatDTO, CredentialRequirements, EngineDTO, FlowDTO, FlowVersionDTO, KnowledgeDTO, ProjectDTO, TeamDTO, Visibility } from '../types.js';
16
16
  /**
17
17
  * POST /agents/{id}. Visibility and images, and a new version when
18
18
  * `version` is set. Name, title, harness, placement: set at creation.
@@ -20,7 +20,7 @@ import type { AgentConfigInput, AgentImages, AppDTO, ChatDTO, CredentialRequirem
20
20
  */
21
21
  export interface AgentUpdateBody {
22
22
  visibility?: Visibility;
23
- images?: AgentImages;
23
+ images?: ResourceImages;
24
24
  version?: AgentConfigInput;
25
25
  }
26
26
  /**
@@ -19,8 +19,12 @@ export interface PollManagerOptions<T> {
19
19
  onError?: (error: Error) => void;
20
20
  /** Called when polling starts */
21
21
  onStart?: () => void;
22
- /** Called when polling stops (intentionally or after max retries) */
23
- onStop?: () => void;
22
+ /**
23
+ * Called once when polling stops. `error` is the last poll error when the
24
+ * manager gave up after `maxRetries` consecutive errors; it is undefined
25
+ * when the caller stopped it.
26
+ */
27
+ onStop?: (error?: Error) => void;
24
28
  }
25
29
  export declare class PollManager<T> {
26
30
  private options;
@@ -34,6 +38,7 @@ export declare class PollManager<T> {
34
38
  start(): void;
35
39
  /** Stop polling and clean up. */
36
40
  stop(): void;
41
+ private halt;
37
42
  private cleanup;
38
43
  private poll;
39
44
  }
package/dist/http/poll.js CHANGED
@@ -30,11 +30,14 @@ export class PollManager {
30
30
  }
31
31
  /** Stop polling and clean up. */
32
32
  stop() {
33
+ this.halt();
34
+ }
35
+ halt(error) {
33
36
  if (this.isStopped)
34
37
  return;
35
38
  this.isStopped = true;
36
39
  this.cleanup();
37
- this.options.onStop?.();
40
+ this.options.onStop?.(error);
38
41
  }
39
42
  cleanup() {
40
43
  if (this.interval) {
@@ -66,7 +69,7 @@ export class PollManager {
66
69
  this.consecutiveErrors++;
67
70
  this.options.onError?.(error);
68
71
  if (this.consecutiveErrors >= this.options.maxRetries) {
69
- this.stop();
72
+ this.halt(error);
70
73
  }
71
74
  }
72
75
  }
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export { STREAM_FORMAT, CLEAR_KEY, ERROR_KEY, REDIAL_CODES } from './live/protoc
32
32
  export { isLiveField, parseMediaType, pcmFormat, splitLiveSchema, binaryLiveField, alternativeLabel, alternativeTag, } from './live/schema.js';
33
33
  export type { JsonSchema, MediaType, PCMFormat, LiveField } from './live/schema.js';
34
34
  export { tool, appTool, agentTool, webhookTool, httpTool, callTool, mcpTool, internalTools, string, number, integer, boolean, enumOf, object, array, optional, } from './tool-builder.js';
35
- export type { ClientTool, ClientToolHandler } from './tool-builder.js';
35
+ export type { ClientTool, ClientToolHandler, ClientToolResult } from './tool-builder.js';
36
36
  export { lifecycleHook, learningHooks } from './hook-builder.js';
37
37
  export type { LifecycleHookBuilder } from './hook-builder.js';
38
38
  export { DeltaAccumulator, createLLMDeltaAccumulator, type DeltaEvent, type FieldTags, type FieldTagsRegistry } from './delta.js';
@@ -1,9 +1,22 @@
1
1
  /**
2
2
  * Tool Builder - Fluent API for defining agent tools
3
3
  */
4
- import { AgentTool, InternalToolsConfig } from './types.js';
4
+ import { AgentTool, FileRef, InternalToolsConfig } from './types.js';
5
+ /**
6
+ * What a client tool handler returns: the result text, or the text plus files.
7
+ *
8
+ * `attachments` are files already uploaded with POST /files (for example with
9
+ * `client.files.upload(dataUrlOrBlob)` or the chat's `uploadFile`), passed as
10
+ * `FileRef`s, the same as message attachments. An image attachment reaches the
11
+ * model as image input when the model supports images; other files are listed
12
+ * on the tool message.
13
+ */
14
+ export type ClientToolResult = string | {
15
+ result: string;
16
+ attachments?: FileRef[];
17
+ };
5
18
  /** Handler function for client tools (executed in browser/Node) */
6
- export type ClientToolHandler = (args: Record<string, unknown>) => Promise<string> | string;
19
+ export type ClientToolHandler = (args: Record<string, unknown>) => Promise<ClientToolResult> | ClientToolResult;
7
20
  /** Client tool with schema and handler bundled together */
8
21
  export interface ClientTool {
9
22
  /** Tool schema (sent to server, describes the tool to the LLM) */
package/dist/types.d.ts CHANGED
@@ -266,14 +266,6 @@ export interface MCPToolConfigDTO {
266
266
  tool_name: string;
267
267
  credential_id?: string;
268
268
  }
269
- /**
270
- * AgentImages contains display images for an agent
271
- */
272
- export interface AgentImages {
273
- card: string;
274
- thumbnail: string;
275
- banner: string;
276
- }
277
269
  /**
278
270
  * CoreAppConfigDTO references an app used as the agent's core
279
271
  */
@@ -295,7 +287,7 @@ export interface AgentDTO extends BaseModelDTO, PermissionModelDTO, ProjectModel
295
287
  * Title is the human-readable name; empty falls back to Name.
296
288
  */
297
289
  title: string;
298
- images: AgentImages;
290
+ images: ResourceImages;
299
291
  version_id: string;
300
292
  version?: AgentVersionDTO;
301
293
  /**
@@ -345,7 +337,7 @@ export interface CreateAgentRequest {
345
337
  id?: string;
346
338
  name: string;
347
339
  title?: string;
348
- images?: AgentImages;
340
+ images?: ResourceImages;
349
341
  visibility?: Visibility;
350
342
  /**
351
343
  * Harness runs the agent: "inference" (ours) or an external harness.
@@ -572,7 +564,7 @@ export interface CreateAppRequest {
572
564
  description?: string;
573
565
  agent_description?: string;
574
566
  category?: AppCategory;
575
- images?: AppImages;
567
+ images?: ResourceImages;
576
568
  /**
577
569
  * Tags replace the app's tags when given; omitted, a deploy takes them
578
570
  * from the version's metadata.tags, and keeps the stored ones if that is
@@ -773,6 +765,12 @@ export interface SecretCreateRequest {
773
765
  */
774
766
  provider_name?: string;
775
767
  provider_website?: string;
768
+ /**
769
+ * Label names this key among the owner's keys for Provider (prod,
770
+ * personal): a new label adds a key beside the others, the same label
771
+ * replaces that key's value. Empty: the owner's default key.
772
+ */
773
+ label?: string;
776
774
  }
777
775
  /**
778
776
  * SecretProviderRequest attaches an existing secret to a provider's
@@ -784,6 +782,11 @@ export interface SecretProviderRequest {
784
782
  connection_scope?: CredentialScope;
785
783
  provider_name?: string;
786
784
  provider_website?: string;
785
+ /**
786
+ * Label names the key among the owner's keys for Provider, as on
787
+ * SecretCreateRequest. Empty: the owner's default key.
788
+ */
789
+ label?: string;
787
790
  }
788
791
  export interface SecretUpdateRequest {
789
792
  value: string;
@@ -1103,7 +1106,7 @@ export declare const ScopeSecretsWrite: Scope;
1103
1106
  export declare const ScopeSecretsReveal: Scope;
1104
1107
  /**
1105
1108
  * Action-level scopes for credentials (connected accounts, vaults,
1106
- * auth schemes, MCP servers).
1109
+ * auth providers, MCP servers).
1107
1110
  */
1108
1111
  export declare const ScopeCredentialsRead: Scope;
1109
1112
  /**
@@ -1426,14 +1429,6 @@ export interface AppFunction {
1426
1429
  */
1427
1430
  annotations?: ToolAnnotations;
1428
1431
  }
1429
- /**
1430
- * AppImages holds developer-provided images for the app.
1431
- */
1432
- export interface AppImages {
1433
- card: string;
1434
- thumbnail: string;
1435
- banner: string;
1436
- }
1437
1432
  /**
1438
1433
  * AppGPUResource describes GPU requirements.
1439
1434
  */
@@ -1465,7 +1460,7 @@ export interface SecretRequirement {
1465
1460
  * the platform-defined grants it needs ("x.tweet.read", "google.sheets":
1466
1461
  * an OAuth grant with the scopes it implies), each a capability of the
1467
1462
  * entry's own provider. Provider seeds the catalog row for the company the
1468
- * first time it is seen and never overwrites it; Auth seeds the auth scheme
1463
+ * first time it is seen and never overwrites it; Auth seeds the auth provider
1469
1464
  * when the slug is free.
1470
1465
  * credentials:
1471
1466
  * slack:
@@ -1489,17 +1484,17 @@ export interface CredentialRequirement {
1489
1484
  * catalog row that does not exist yet. Its slug defaults to the
1490
1485
  * credential slug.
1491
1486
  */
1492
- provider?: ProviderSeed;
1487
+ provider?: CompanySeed;
1493
1488
  /**
1494
- * Auth is the credential's auth scheme, for a slug no row defines yet.
1489
+ * Auth is the credential's auth provider, for a slug no row defines yet.
1495
1490
  */
1496
- auth?: AuthSchemeSpec;
1491
+ auth?: AuthMethod;
1497
1492
  }
1498
1493
  /**
1499
- * ProviderSeed is a provider (the company behind a credential) as an app
1494
+ * CompanySeed is a provider (the company behind a credential) as an app
1500
1495
  * declares it: enough to create its catalog row when none exists.
1501
1496
  */
1502
- export interface ProviderSeed {
1497
+ export interface CompanySeed {
1503
1498
  slug?: string;
1504
1499
  name?: string;
1505
1500
  description?: string;
@@ -1531,7 +1526,7 @@ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1531
1526
  description: string;
1532
1527
  agent_description: string;
1533
1528
  category: AppCategory;
1534
- images: AppImages;
1529
+ images: ResourceImages;
1535
1530
  /**
1536
1531
  * Tags name what the app does and its traits, as lowercase slugs
1537
1532
  * (text-to-image, open-weights). GET /store/tags lists the ones in use
@@ -1702,25 +1697,13 @@ export interface PublicAppStoreDTO {
1702
1697
  */
1703
1698
  title: string;
1704
1699
  description: string;
1705
- images: AppImages;
1700
+ images: ResourceImages;
1706
1701
  is_featured: boolean;
1707
1702
  rank: number;
1708
1703
  has_approved_version: boolean;
1709
1704
  page_id?: string;
1710
1705
  pricing_description?: string;
1711
1706
  }
1712
- /**
1713
- * ResourceImages is the display-image set every listable resource carries:
1714
- * a card image for grids, a thumbnail for dense rows, a banner for headers.
1715
- * AppImages and AgentImages predate this and hold the same three fields;
1716
- * they should collapse onto this type, but aliasing them changes what
1717
- * gotypegen emits for existing consumers, so that migration is separate.
1718
- */
1719
- export interface ResourceImages {
1720
- card: string;
1721
- thumbnail: string;
1722
- banner: string;
1723
- }
1724
1707
  /**
1725
1708
  * ArtifactDTO is the API shape of an artifact entry.
1726
1709
  */
@@ -1751,6 +1734,12 @@ export interface ArtifactDTO extends BaseModelDTO, PermissionModelDTO {
1751
1734
  * SharedVersionID pins the version viewers see. Empty = always latest.
1752
1735
  */
1753
1736
  shared_version_id?: string;
1737
+ /**
1738
+ * CoverVersionID is the version a captured cover shows. Empty means the
1739
+ * cover (if any) was set by a person or agent, and a capture never
1740
+ * replaces it.
1741
+ */
1742
+ cover_version_id?: string;
1754
1743
  /**
1755
1744
  * Capabilities declared by the latest version (runtime features the page
1756
1745
  * may use). Reserved for the artifact runtime; opaque to the API.
@@ -1763,6 +1752,11 @@ export interface ArtifactDTO extends BaseModelDTO, PermissionModelDTO {
1763
1752
  * URL is the canonical viewer URL for this artifact.
1764
1753
  */
1765
1754
  url?: string;
1755
+ /**
1756
+ * Access is the viewer's level on this artifact: read, interact (may
1757
+ * change its data) or write (may edit it). Set on single reads only.
1758
+ */
1759
+ access?: Permission;
1766
1760
  }
1767
1761
  /**
1768
1762
  * ArtifactVersionDTO is one immutable publish of an artifact.
@@ -2064,6 +2058,21 @@ export interface ResourceStatusDTO {
2064
2058
  status: any;
2065
2059
  updated_at: string;
2066
2060
  }
2061
+ /**
2062
+ * ResourceImages is the display-image set every listable resource carries
2063
+ * (apps, agents, artifacts): a card image for grids, a thumbnail for dense
2064
+ * rows, a banner for headers.
2065
+ */
2066
+ export interface ResourceImages {
2067
+ card: string;
2068
+ thumbnail: string;
2069
+ banner: string;
2070
+ /**
2071
+ * Dark holds the same slots for a dark theme. Nil means the slots above
2072
+ * serve both themes.
2073
+ */
2074
+ dark?: ResourceImages;
2075
+ }
2067
2076
  /**
2068
2077
  * AvailabilityResponse answers "can I use this name?" — for page slugs, team
2069
2078
  * usernames and voucher codes alike.
@@ -2527,17 +2536,34 @@ export interface CredentialDTO extends BaseModelDTO, PermissionModelDTO {
2527
2536
  };
2528
2537
  is_primary: boolean;
2529
2538
  error_message?: string;
2539
+ /**
2540
+ * Secrets are the secret rows linked to the credential (a key's values),
2541
+ * by row and key, never by value. Filled on the vault's api_key configs
2542
+ * and the admin provider tree.
2543
+ */
2544
+ secrets?: CredentialSecretRef[];
2530
2545
  }
2531
2546
  /**
2532
- * ProviderSummary is the company a credential slug belongs to: the
2547
+ * CredentialSecretRef names one secret linked to a credential: the row's
2548
+ * id, the key it is stored under and when its value last changed.
2549
+ */
2550
+ export interface CredentialSecretRef {
2551
+ id: string;
2552
+ key: string;
2553
+ updated_at: string;
2554
+ }
2555
+ /**
2556
+ * CompanySummary is the company a credential slug belongs to: the
2533
2557
  * providers row's identity, for grouping and display.
2534
2558
  */
2535
- export interface ProviderSummary {
2559
+ export interface CompanySummary {
2536
2560
  slug: string;
2537
2561
  name: string;
2538
2562
  icon_url?: string;
2539
2563
  website?: string;
2540
2564
  docs_url?: string;
2565
+ terms_url?: string;
2566
+ privacy_url?: string;
2541
2567
  }
2542
2568
  /**
2543
2569
  * CredentialConfigDTO is the merged view: provider catalog + credential state.
@@ -2551,9 +2577,14 @@ export interface CredentialConfigDTO {
2551
2577
  provider: string;
2552
2578
  /**
2553
2579
  * ProviderInfo is the company this slug belongs to, for grouping: the
2554
- * providers row its auth scheme names, else the slug's own identity.
2580
+ * providers row its auth provider names, else the slug's own identity.
2555
2581
  */
2556
- provider_info?: ProviderSummary;
2582
+ provider_info?: CompanySummary;
2583
+ /**
2584
+ * Company is ProviderInfo under its settled name (INF-1079); provider_info
2585
+ * stays one release.
2586
+ */
2587
+ company?: CompanySummary;
2557
2588
  type: string;
2558
2589
  name: string;
2559
2590
  short_name: string;
@@ -2579,8 +2610,8 @@ export interface CredentialConfigDTO {
2579
2610
  */
2580
2611
  app?: CredentialDTO;
2581
2612
  /**
2582
- * AuthSchemeID is set when the provider is one the team defined
2583
- * itself (models.AuthScheme), so the UI can offer edit and remove.
2613
+ * AuthProviderID is set when the provider is one the team defined
2614
+ * itself (models.AuthProvider), so the UI can offer edit and remove.
2584
2615
  */
2585
2616
  auth_scheme_id?: string;
2586
2617
  /**
@@ -2594,6 +2625,12 @@ export interface CredentialConfigDTO {
2594
2625
  * connected.
2595
2626
  */
2596
2627
  accounts?: (CredentialDTO | undefined)[];
2628
+ /**
2629
+ * MultiAccount: several accounts of this provider can be connected side
2630
+ * by side, each addressed by its account_id; the default (is_primary) is
2631
+ * used where none is named.
2632
+ */
2633
+ multi_account: boolean;
2597
2634
  }
2598
2635
  /**
2599
2636
  * SecretFieldConfig defines a secret field for the UI
@@ -4046,12 +4083,44 @@ export interface MCPServerDTO {
4046
4083
  */
4047
4084
  credentials?: CredentialRequirements;
4048
4085
  credential_slug?: string;
4086
+ /**
4087
+ * Deprecated: Connection.Status. Kept for clients reading it.
4088
+ */
4049
4089
  connection_status?: string;
4050
4090
  /**
4051
- * ConnectionScope is who the caller's connection to this server belongs
4091
+ * Deprecated: Connection.Scope. ConnectionScope is who the caller's connection to this server belongs
4052
4092
  * to (user, team, org, platform); empty when not connected.
4053
4093
  */
4054
4094
  connection_scope?: CredentialScope;
4095
+ /**
4096
+ * Connection is the whole of it: the login's status and scope above,
4097
+ * and what the connection made with that login holds.
4098
+ */
4099
+ connection?: ConnectionInfo;
4100
+ }
4101
+ /**
4102
+ * ConnectionInfo is the caller's standing with a server: their login's
4103
+ * status (connected, expired, error; "" when they hold none) and whose it
4104
+ * is, and what the connection made with that login holds.
4105
+ */
4106
+ export interface ConnectionInfo extends MCPConnectionFacts {
4107
+ /**
4108
+ * Status and Scope are the caller's login's for the server: whether
4109
+ * they can call it, and whose the login is.
4110
+ */
4111
+ status?: string;
4112
+ scope?: CredentialScope;
4113
+ }
4114
+ /**
4115
+ * MCPConnectionFacts is what an MCP connection (a server reached through
4116
+ * one login) has recorded: the catalogue it listed, its last call.
4117
+ */
4118
+ export interface MCPConnectionFacts {
4119
+ connection_id?: string;
4120
+ tool_count?: number;
4121
+ tools_listed_at?: string;
4122
+ last_called_at?: string;
4123
+ last_error?: string;
4055
4124
  }
4056
4125
  /**
4057
4126
  * MCPServerSetup is what a server's directory entry knows about setting the
@@ -4609,6 +4678,26 @@ export interface SecretDTO extends BaseModelDTO, PermissionModelDTO {
4609
4678
  * a plain secret.
4610
4679
  */
4611
4680
  credential_id?: string;
4681
+ /**
4682
+ * The four below are read from the credential a listing preloads; a
4683
+ * row read without it leaves them empty.
4684
+ * Provider is the slug of the credential the secret belongs to.
4685
+ */
4686
+ provider?: string;
4687
+ /**
4688
+ * ProviderName is that credential's display name ("Anthropic").
4689
+ */
4690
+ provider_name?: string;
4691
+ /**
4692
+ * Label is the credential's account identifier: a key's label.
4693
+ */
4694
+ label?: string;
4695
+ /**
4696
+ * CredentialDefault is whether the credential is its owner's default.
4697
+ * Always serialised: a linked non-default row and an unlabelled row
4698
+ * must not read the same.
4699
+ */
4700
+ credential_default: boolean;
4612
4701
  }
4613
4702
  /**
4614
4703
  * SensitiveString is a string type that prevents accidental exposure of secrets.
@@ -5504,58 +5593,58 @@ export declare const GPUTypeNvidia: GPUType;
5504
5593
  export declare const GPUTypeAMD: GPUType;
5505
5594
  export declare const GPUTypeApple: GPUType;
5506
5595
  /**
5507
- * AuthSchemeKind is how a provider authenticates: the kinds of an OpenAPI
5596
+ * AuthMethodKind is how a provider authenticates: the kinds of an OpenAPI
5508
5597
  * Security Scheme Object (oauth2, apiKey, http), named the same so a
5509
5598
  * vendor's spec maps onto a scheme without translation.
5510
5599
  */
5511
- export type AuthSchemeKind = "oauth2" | "api_key" | "http" | "oauth2_authorization_code";
5600
+ export type AuthMethodKind = "oauth2" | "api_key" | "http" | "oauth2_authorization_code";
5512
5601
  /**
5513
- * AuthSchemeOAuth2 is OAuth 2.0; Flow says which grant.
5602
+ * AuthMethodOAuth2 is OAuth 2.0; Flow says which grant.
5514
5603
  */
5515
- export declare const AuthSchemeOAuth2: AuthSchemeKind;
5604
+ export declare const AuthMethodOAuth2: AuthMethodKind;
5516
5605
  /**
5517
- * AuthSchemeAPIKey is one or more keys a person pastes, sent as a
5606
+ * AuthMethodAPIKey is one or more keys a person pastes, sent as a
5518
5607
  * header or query parameter.
5519
5608
  */
5520
- export declare const AuthSchemeAPIKey: AuthSchemeKind;
5609
+ export declare const AuthMethodAPIKey: AuthMethodKind;
5521
5610
  /**
5522
- * AuthSchemeHTTP is a pasted secret sent as an HTTP auth scheme
5611
+ * AuthMethodHTTP is a pasted secret sent as an HTTP auth provider
5523
5612
  * (Authorization: Bearer or Basic).
5524
5613
  */
5525
- export declare const AuthSchemeHTTP: AuthSchemeKind;
5614
+ export declare const AuthMethodHTTP: AuthMethodKind;
5526
5615
  /**
5527
- * Deprecated: the kind is AuthSchemeOAuth2 with AuthSchemeFlowAuthorizationCode.
5616
+ * Deprecated: the kind is AuthMethodOAuth2 with AuthMethodFlowAuthorizationCode.
5528
5617
  * Same value, so comparisons keep working; rows still stored as
5529
5618
  * "oauth2_authorization_code" are read as oauth2 (UnmarshalJSON).
5530
5619
  */
5531
- export declare const AuthSchemeOAuth2AuthorizationCode: "oauth2";
5620
+ export declare const AuthMethodOAuth2AuthorizationCode: "oauth2";
5532
5621
  /**
5533
- * AuthSchemeFlow is the OAuth 2.0 grant an oauth2 scheme uses.
5622
+ * AuthMethodFlow is the OAuth 2.0 grant an oauth2 scheme uses.
5534
5623
  */
5535
- export type AuthSchemeFlow = "authorization_code" | "client_credentials";
5624
+ export type AuthMethodFlow = "authorization_code" | "client_credentials";
5536
5625
  /**
5537
- * AuthSchemeFlowAuthorizationCode is the user-consent flow: authorization
5626
+ * AuthMethodFlowAuthorizationCode is the user-consent flow: authorization
5538
5627
  * endpoint → code → token endpoint, optionally with PKCE. The default.
5539
5628
  */
5540
- export declare const AuthSchemeFlowAuthorizationCode: AuthSchemeFlow;
5629
+ export declare const AuthMethodFlowAuthorizationCode: AuthMethodFlow;
5541
5630
  /**
5542
- * AuthSchemeFlowClientCredentials is server-to-server: the app's client
5631
+ * AuthMethodFlowClientCredentials is server-to-server: the app's client
5543
5632
  * id and secret are exchanged at the token endpoint, no redirect, no
5544
5633
  * user. The login is the app's own.
5545
5634
  */
5546
- export declare const AuthSchemeFlowClientCredentials: AuthSchemeFlow;
5635
+ export declare const AuthMethodFlowClientCredentials: AuthMethodFlow;
5547
5636
  /**
5548
- * AuthSchemeAPIKeyIn is where an api_key scheme's key travels.
5637
+ * AuthMethodAPIKeyIn is where an api_key scheme's key travels.
5549
5638
  */
5550
- export type AuthSchemeAPIKeyIn = "header" | "query";
5551
- export declare const AuthSchemeAPIKeyInHeader: AuthSchemeAPIKeyIn;
5552
- export declare const AuthSchemeAPIKeyInQuery: AuthSchemeAPIKeyIn;
5639
+ export type AuthMethodAPIKeyIn = "header" | "query";
5640
+ export declare const AuthMethodAPIKeyInHeader: AuthMethodAPIKeyIn;
5641
+ export declare const AuthMethodAPIKeyInQuery: AuthMethodAPIKeyIn;
5553
5642
  /**
5554
- * AuthSchemeHTTPScheme is the Authorization scheme of an http scheme.
5643
+ * AuthMethodHTTPScheme is the Authorization scheme of an http scheme.
5555
5644
  */
5556
- export type AuthSchemeHTTPScheme = "bearer" | "basic";
5557
- export declare const AuthSchemeHTTPBearer: AuthSchemeHTTPScheme;
5558
- export declare const AuthSchemeHTTPBasic: AuthSchemeHTTPScheme;
5645
+ export type AuthMethodHTTPScheme = "bearer" | "basic";
5646
+ export declare const AuthMethodHTTPBearer: AuthMethodHTTPScheme;
5647
+ export declare const AuthMethodHTTPBasic: AuthMethodHTTPScheme;
5559
5648
  /**
5560
5649
  * SecretField is one value a person pastes to connect an api_key or http
5561
5650
  * scheme: its vault key and how the form asks for it. Several fields make
@@ -5569,62 +5658,62 @@ export interface SecretField {
5569
5658
  optional?: boolean;
5570
5659
  }
5571
5660
  /**
5572
- * AuthSchemeClientAuth is how client_id/client_secret reach the token
5661
+ * AuthMethodClientAuth is how client_id/client_secret reach the token
5573
5662
  * endpoint. Most providers accept either; a few insist on one.
5574
5663
  */
5575
- export type AuthSchemeClientAuth = "basic" | "body" | "none";
5664
+ export type AuthMethodClientAuth = "basic" | "body" | "none";
5576
5665
  /**
5577
- * AuthSchemeClientAuthBasic sends them as an HTTP Basic Authorization
5666
+ * AuthMethodClientAuthBasic sends them as an HTTP Basic Authorization
5578
5667
  * header (RFC 6749 §2.3.1, the default).
5579
5668
  */
5580
- export declare const AuthSchemeClientAuthBasic: AuthSchemeClientAuth;
5669
+ export declare const AuthMethodClientAuthBasic: AuthMethodClientAuth;
5581
5670
  /**
5582
- * AuthSchemeClientAuthBody sends them as form fields in the request body.
5671
+ * AuthMethodClientAuthBody sends them as form fields in the request body.
5583
5672
  */
5584
- export declare const AuthSchemeClientAuthBody: AuthSchemeClientAuth;
5673
+ export declare const AuthMethodClientAuthBody: AuthMethodClientAuth;
5585
5674
  /**
5586
- * AuthSchemeClientAuthNone is a public client (RFC 8414
5675
+ * AuthMethodClientAuthNone is a public client (RFC 8414
5587
5676
  * token_endpoint_auth_method "none"): the client id goes in the body,
5588
5677
  * there is no secret, and PKCE is what proves the client. Its OAuth app
5589
5678
  * is complete with a client id alone (a dynamically registered client,
5590
5679
  * or a Client ID Metadata Document URL).
5591
5680
  */
5592
- export declare const AuthSchemeClientAuthNone: AuthSchemeClientAuth;
5681
+ export declare const AuthMethodClientAuthNone: AuthMethodClientAuth;
5593
5682
  /**
5594
- * AuthSchemeTokenRequest is the token request's body encoding.
5683
+ * AuthMethodTokenRequest is the token request's body encoding.
5595
5684
  */
5596
- export type AuthSchemeTokenRequest = "form" | "json";
5597
- export declare const AuthSchemeTokenRequestForm: AuthSchemeTokenRequest;
5598
- export declare const AuthSchemeTokenRequestJSON: AuthSchemeTokenRequest;
5685
+ export type AuthMethodTokenRequest = "form" | "json";
5686
+ export declare const AuthMethodTokenRequestForm: AuthMethodTokenRequest;
5687
+ export declare const AuthMethodTokenRequestJSON: AuthMethodTokenRequest;
5599
5688
  /**
5600
- * AuthSchemeRefresh is when an access token is refreshed.
5689
+ * AuthMethodRefresh is when an access token is refreshed.
5601
5690
  */
5602
- export type AuthSchemeRefresh = "" | "always";
5691
+ export type AuthMethodRefresh = "" | "always";
5603
5692
  /**
5604
- * AuthSchemeRefreshWhenExpiring refreshes within five minutes of the
5693
+ * AuthMethodRefreshWhenExpiring refreshes within five minutes of the
5605
5694
  * reported expiry; a token with no expiry is treated as long-lived
5606
5695
  * (Slack without token rotation, Notion).
5607
5696
  */
5608
- export declare const AuthSchemeRefreshWhenExpiring: AuthSchemeRefresh;
5697
+ export declare const AuthMethodRefreshWhenExpiring: AuthMethodRefresh;
5609
5698
  /**
5610
- * AuthSchemeRefreshAlways refreshes on every read: the provider reports
5699
+ * AuthMethodRefreshAlways refreshes on every read: the provider reports
5611
5700
  * no expiry but the token does expire (Salesforce's session timeout is
5612
5701
  * per org and not reported).
5613
5702
  */
5614
- export declare const AuthSchemeRefreshAlways: AuthSchemeRefresh;
5703
+ export declare const AuthMethodRefreshAlways: AuthMethodRefresh;
5615
5704
  /**
5616
- * AuthSchemeRevokeStyle is how the token reaches the revoke endpoint.
5705
+ * AuthMethodRevokeStyle is how the token reaches the revoke endpoint.
5617
5706
  */
5618
- export type AuthSchemeRevokeStyle = "bearer" | "query" | "form";
5619
- export declare const AuthSchemeRevokeBearer: AuthSchemeRevokeStyle;
5620
- export declare const AuthSchemeRevokeQuery: AuthSchemeRevokeStyle;
5621
- export declare const AuthSchemeRevokeForm: AuthSchemeRevokeStyle;
5707
+ export type AuthMethodRevokeStyle = "bearer" | "query" | "form";
5708
+ export declare const AuthMethodRevokeBearer: AuthMethodRevokeStyle;
5709
+ export declare const AuthMethodRevokeQuery: AuthMethodRevokeStyle;
5710
+ export declare const AuthMethodRevokeForm: AuthMethodRevokeStyle;
5622
5711
  /**
5623
- * AuthSchemeRevoke is the optional token revocation on disconnect.
5712
+ * AuthMethodRevoke is the optional token revocation on disconnect.
5624
5713
  */
5625
- export interface AuthSchemeRevoke {
5714
+ export interface AuthMethodRevoke {
5626
5715
  url: string;
5627
- style: AuthSchemeRevokeStyle;
5716
+ style: AuthMethodRevokeStyle;
5628
5717
  /**
5629
5718
  * ClientAuth also sends client_id and client_secret in the form
5630
5719
  * (Discord).
@@ -5632,13 +5721,13 @@ export interface AuthSchemeRevoke {
5632
5721
  client_auth?: boolean;
5633
5722
  }
5634
5723
  /**
5635
- * AuthSchemeAppKey is one key of the OAuth app a login goes through. The
5724
+ * AuthMethodAppKey is one key of the OAuth app a login goes through. The
5636
5725
  * client id and secret are implied (PREFIX_CLIENT_ID, PREFIX_CLIENT_SECRET);
5637
5726
  * listing them only overrides their label and placeholder. Other keys
5638
5727
  * (bot_token, signing_secret, tenant_id) are optional extras the app holds,
5639
5728
  * read back by name in templates as {app.<name>} and by hooks.
5640
5729
  */
5641
- export interface AuthSchemeAppKey {
5730
+ export interface AuthMethodAppKey {
5642
5731
  /**
5643
5732
  * Name is the key's role: client_id, client_secret, bot_token, …
5644
5733
  */
@@ -5656,13 +5745,13 @@ export interface AuthSchemeAppKey {
5656
5745
  optional?: boolean;
5657
5746
  }
5658
5747
  /**
5659
- * AuthSchemeLookup is a call made after the token exchange, with the new
5748
+ * AuthMethodLookup is a call made after the token exchange, with the new
5660
5749
  * access token as bearer; its decoded response becomes a document root of
5661
5750
  * its name for the identity, metadata and later lookups ({user.email},
5662
5751
  * {resources.0.id}). userinfo_url is shorthand for the lookup named user.
5663
5752
  * URL, body and headers are templates.
5664
5753
  */
5665
- export interface AuthSchemeLookup {
5754
+ export interface AuthMethodLookup {
5666
5755
  name: string;
5667
5756
  url: string;
5668
5757
  method?: string;
@@ -5677,11 +5766,11 @@ export interface AuthSchemeLookup {
5677
5766
  };
5678
5767
  }
5679
5768
  /**
5680
- * AuthSchemeCapability is something an app can ask for from this provider,
5769
+ * AuthMethodCapability is something an app can ask for from this provider,
5681
5770
  * satisfied by a connection holding its scopes. Scopes are in the scheme's
5682
5771
  * own (friendly) names, the ones a credential stores.
5683
5772
  */
5684
- export interface AuthSchemeCapability {
5773
+ export interface AuthMethodCapability {
5685
5774
  key: string;
5686
5775
  scopes?: string[];
5687
5776
  satisfies?: string[];
@@ -5689,10 +5778,10 @@ export interface AuthSchemeCapability {
5689
5778
  description?: string;
5690
5779
  }
5691
5780
  /**
5692
- * AuthSchemeSpec is one way to authenticate against a provider, as data.
5781
+ * AuthMethod is one way to authenticate against a provider, as data.
5693
5782
  * Everything a standard OAuth2 provider needs is a field; where a provider
5694
5783
  * deviates in a way data cannot express, the spec names a hook and Go
5695
- * supplies it (authprovider.RegisterTokenResponseHook and friends).
5784
+ * supplies it (authmethod.RegisterTokenResponseHook and friends).
5696
5785
  * Templates: URLs, headers, lookup bodies, identifier, name, metadata and
5697
5786
  * env values are strings with {{path}} placeholders. A path is read from
5698
5787
  * the flow's document, which grows as the flow goes:
@@ -5710,12 +5799,12 @@ export interface AuthSchemeCapability {
5710
5799
  * path present. A template none of whose placeholders resolve renders "":
5711
5800
  * omitted from env and metadata, blank as identifier or name.
5712
5801
  */
5713
- export interface AuthSchemeSpec {
5714
- kind: AuthSchemeKind;
5802
+ export interface AuthMethod {
5803
+ kind: AuthMethodKind;
5715
5804
  /**
5716
5805
  * Flow is the oauth2 grant; empty means authorization_code.
5717
5806
  */
5718
- flow?: AuthSchemeFlow;
5807
+ flow?: AuthMethodFlow;
5719
5808
  /**
5720
5809
  * Fields are what a person pastes (api_key and http kinds).
5721
5810
  */
@@ -5725,13 +5814,13 @@ export interface AuthSchemeSpec {
5725
5814
  * header or query parameter of that name. ValuePrefix is prepended to
5726
5815
  * the value ("Bearer "). Not needed to connect; read by injection.
5727
5816
  */
5728
- in?: AuthSchemeAPIKeyIn;
5817
+ in?: AuthMethodAPIKeyIn;
5729
5818
  param_name?: string;
5730
5819
  value_prefix?: string;
5731
5820
  /**
5732
5821
  * Scheme and BearerFormat describe an http kind's Authorization header.
5733
5822
  */
5734
- scheme?: AuthSchemeHTTPScheme;
5823
+ scheme?: AuthMethodHTTPScheme;
5735
5824
  bearer_format?: string;
5736
5825
  authorization_endpoint?: string;
5737
5826
  scopes?: string[];
@@ -5823,7 +5912,7 @@ export interface AuthSchemeSpec {
5823
5912
  callback?: string;
5824
5913
  /**
5825
5914
  * Profile names the authorization server's deviations from the specs
5826
- * (authprovider.AuthServerProfile: endpoints placed by app fields,
5915
+ * (authmethod.AuthServerProfile: endpoints placed by app fields,
5827
5916
  * scopes on refresh, actionable errors, admin consent). Empty = none.
5828
5917
  */
5829
5918
  profile?: string;
@@ -5834,8 +5923,8 @@ export interface AuthSchemeSpec {
5834
5923
  * with a form POST.
5835
5924
  */
5836
5925
  revocation_endpoint?: string;
5837
- client_auth?: AuthSchemeClientAuth;
5838
- token_request?: AuthSchemeTokenRequest;
5926
+ client_auth?: AuthMethodClientAuth;
5927
+ token_request?: AuthMethodTokenRequest;
5839
5928
  /**
5840
5929
  * Headers go on every request to the provider (User-Agent for Reddit,
5841
5930
  * Notion-Version); values are templates ({{client_id}} for Twitch's
@@ -5849,8 +5938,8 @@ export interface AuthSchemeSpec {
5849
5938
  * not the RFC 6749 shape (Slack's nested authed_user). Empty = standard.
5850
5939
  */
5851
5940
  token_response_hook?: string;
5852
- refresh?: AuthSchemeRefresh;
5853
- revoke?: AuthSchemeRevoke;
5941
+ refresh?: AuthMethodRefresh;
5942
+ revoke?: AuthMethodRevoke;
5854
5943
  /**
5855
5944
  * UserInfoURL is fetched with the new access token; the response is the
5856
5945
  * identity document (user.*). UserInfoURLPath instead reads that URL
@@ -5860,7 +5949,7 @@ export interface AuthSchemeSpec {
5860
5949
  */
5861
5950
  userinfo_url?: string;
5862
5951
  userinfo_url_path?: string;
5863
- lookups?: AuthSchemeLookup[];
5952
+ lookups?: AuthMethodLookup[];
5864
5953
  /**
5865
5954
  * Identifier is the connected account's stable, human-readable id
5866
5955
  * ("{{user.email}}", "@{{user.data.username}}"); Name its display name.
@@ -5897,14 +5986,14 @@ export interface AuthSchemeSpec {
5897
5986
  * AppKeys are the OAuth app's keys beyond the implied client id and
5898
5987
  * secret, and label overrides for those.
5899
5988
  */
5900
- app_keys?: AuthSchemeAppKey[];
5989
+ app_keys?: AuthMethodAppKey[];
5901
5990
  /**
5902
5991
  * VarsHook names Go code that turns the app's extra keys into the
5903
5992
  * {var} values substituted into the URLs (Microsoft's tenant,
5904
5993
  * Salesforce's sandbox host).
5905
5994
  */
5906
5995
  vars_hook?: string;
5907
- capabilities?: AuthSchemeCapability[];
5996
+ capabilities?: AuthMethodCapability[];
5908
5997
  }
5909
5998
  /**
5910
5999
  * Visibility represents the visibility level of a resource
@@ -5922,9 +6011,15 @@ export declare const VisibilityUnlisted: Visibility;
5922
6011
  /**
5923
6012
  * Permission represents a permission level for access checks.
5924
6013
  */
5925
- export type Permission = "read" | "write" | "use";
6014
+ export type Permission = "read" | "write" | "interact" | "use";
5926
6015
  export declare const PermRead: Permission;
5927
6016
  export declare const PermWrite: Permission;
6017
+ /**
6018
+ * PermInteract changes what a page's people keep in it (an artifact's
6019
+ * shared data) without editing the page. Write covers interact, and
6020
+ * interact covers read; public and unlisted visibility grant read only.
6021
+ */
6022
+ export declare const PermInteract: Permission;
5928
6023
  /**
5929
6024
  * PermUse is execute intent: run an app, load a skill/knowledge into an
5930
6025
  * agent context, invoke an MCP tool. Distinct from read — a public
@@ -6595,8 +6690,11 @@ export interface ResponseFormat {
6595
6690
  * assignment.
6596
6691
  * Which model runs is not a setting: the app is the model. An app that
6597
6692
  * fronts several models (a router) declares its own `model` input.
6693
+ * Field order is schema order: the generated pydantic model, and the input
6694
+ * form built from its JSON schema, list fields as they are declared here.
6598
6695
  */
6599
6696
  export interface LLMSettings {
6697
+ system_prompt: string;
6600
6698
  context_size: number;
6601
6699
  temperature?: number;
6602
6700
  top_p?: number;
@@ -6610,23 +6708,24 @@ export interface LLMSettings {
6610
6708
  max_tokens?: number;
6611
6709
  reasoning_effort?: string;
6612
6710
  reasoning_max_tokens?: number;
6613
- system_prompt: string;
6614
6711
  tools?: Tool[];
6615
6712
  tool_choice?: ToolChoice;
6616
6713
  response_format?: ResponseFormat;
6617
6714
  }
6618
6715
  /**
6619
- * LLMInput is the input envelope for an LLM provider task: the settings plus
6620
- * the conversation, with the current turn split out of the context.
6716
+ * LLMInput is the input envelope for an LLM provider task: the conversation,
6717
+ * with the current turn split out of the context, plus the settings.
6718
+ * Field order is schema order (see LLMSettings): the turn comes first, the
6719
+ * settings last, so an input form shows what to say before how to say it.
6621
6720
  */
6622
6721
  export interface LLMInput extends LLMSettings {
6623
- context: LLMContextMessage[];
6624
- role?: ChatMessageRole;
6625
6722
  text?: string;
6626
- reasoning?: string;
6627
- attachments?: FileRef[];
6628
6723
  images?: string[];
6629
6724
  files?: string[];
6725
+ attachments?: FileRef[];
6726
+ context: LLMContextMessage[];
6727
+ role?: ChatMessageRole;
6728
+ reasoning?: string;
6630
6729
  tool_call_id?: string;
6631
6730
  }
6632
6731
  /**
package/dist/types.js CHANGED
@@ -211,7 +211,7 @@ export const ScopeSecretsWrite = "secrets:write";
211
211
  export const ScopeSecretsReveal = "secrets:reveal";
212
212
  /**
213
213
  * Action-level scopes for credentials (connected accounts, vaults,
214
- * auth schemes, MCP servers).
214
+ * auth providers, MCP servers).
215
215
  */
216
216
  export const ScopeCredentialsRead = "credentials:read";
217
217
  /**
@@ -743,74 +743,74 @@ export const GPUTypeNvidia = "nvidia";
743
743
  export const GPUTypeAMD = "amd";
744
744
  export const GPUTypeApple = "apple";
745
745
  /**
746
- * AuthSchemeOAuth2 is OAuth 2.0; Flow says which grant.
746
+ * AuthMethodOAuth2 is OAuth 2.0; Flow says which grant.
747
747
  */
748
- export const AuthSchemeOAuth2 = "oauth2";
748
+ export const AuthMethodOAuth2 = "oauth2";
749
749
  /**
750
- * AuthSchemeAPIKey is one or more keys a person pastes, sent as a
750
+ * AuthMethodAPIKey is one or more keys a person pastes, sent as a
751
751
  * header or query parameter.
752
752
  */
753
- export const AuthSchemeAPIKey = "api_key";
753
+ export const AuthMethodAPIKey = "api_key";
754
754
  /**
755
- * AuthSchemeHTTP is a pasted secret sent as an HTTP auth scheme
755
+ * AuthMethodHTTP is a pasted secret sent as an HTTP auth provider
756
756
  * (Authorization: Bearer or Basic).
757
757
  */
758
- export const AuthSchemeHTTP = "http";
758
+ export const AuthMethodHTTP = "http";
759
759
  /**
760
- * Deprecated: the kind is AuthSchemeOAuth2 with AuthSchemeFlowAuthorizationCode.
760
+ * Deprecated: the kind is AuthMethodOAuth2 with AuthMethodFlowAuthorizationCode.
761
761
  * Same value, so comparisons keep working; rows still stored as
762
762
  * "oauth2_authorization_code" are read as oauth2 (UnmarshalJSON).
763
763
  */
764
- export const AuthSchemeOAuth2AuthorizationCode = AuthSchemeOAuth2;
764
+ export const AuthMethodOAuth2AuthorizationCode = AuthMethodOAuth2;
765
765
  /**
766
- * AuthSchemeFlowAuthorizationCode is the user-consent flow: authorization
766
+ * AuthMethodFlowAuthorizationCode is the user-consent flow: authorization
767
767
  * endpoint → code → token endpoint, optionally with PKCE. The default.
768
768
  */
769
- export const AuthSchemeFlowAuthorizationCode = "authorization_code";
769
+ export const AuthMethodFlowAuthorizationCode = "authorization_code";
770
770
  /**
771
- * AuthSchemeFlowClientCredentials is server-to-server: the app's client
771
+ * AuthMethodFlowClientCredentials is server-to-server: the app's client
772
772
  * id and secret are exchanged at the token endpoint, no redirect, no
773
773
  * user. The login is the app's own.
774
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";
775
+ export const AuthMethodFlowClientCredentials = "client_credentials";
776
+ export const AuthMethodAPIKeyInHeader = "header";
777
+ export const AuthMethodAPIKeyInQuery = "query";
778
+ export const AuthMethodHTTPBearer = "bearer";
779
+ export const AuthMethodHTTPBasic = "basic";
780
780
  /**
781
- * AuthSchemeClientAuthBasic sends them as an HTTP Basic Authorization
781
+ * AuthMethodClientAuthBasic sends them as an HTTP Basic Authorization
782
782
  * header (RFC 6749 §2.3.1, the default).
783
783
  */
784
- export const AuthSchemeClientAuthBasic = "basic";
784
+ export const AuthMethodClientAuthBasic = "basic";
785
785
  /**
786
- * AuthSchemeClientAuthBody sends them as form fields in the request body.
786
+ * AuthMethodClientAuthBody sends them as form fields in the request body.
787
787
  */
788
- export const AuthSchemeClientAuthBody = "body";
788
+ export const AuthMethodClientAuthBody = "body";
789
789
  /**
790
- * AuthSchemeClientAuthNone is a public client (RFC 8414
790
+ * AuthMethodClientAuthNone is a public client (RFC 8414
791
791
  * token_endpoint_auth_method "none"): the client id goes in the body,
792
792
  * there is no secret, and PKCE is what proves the client. Its OAuth app
793
793
  * is complete with a client id alone (a dynamically registered client,
794
794
  * or a Client ID Metadata Document URL).
795
795
  */
796
- export const AuthSchemeClientAuthNone = "none";
797
- export const AuthSchemeTokenRequestForm = "form";
798
- export const AuthSchemeTokenRequestJSON = "json";
796
+ export const AuthMethodClientAuthNone = "none";
797
+ export const AuthMethodTokenRequestForm = "form";
798
+ export const AuthMethodTokenRequestJSON = "json";
799
799
  /**
800
- * AuthSchemeRefreshWhenExpiring refreshes within five minutes of the
800
+ * AuthMethodRefreshWhenExpiring refreshes within five minutes of the
801
801
  * reported expiry; a token with no expiry is treated as long-lived
802
802
  * (Slack without token rotation, Notion).
803
803
  */
804
- export const AuthSchemeRefreshWhenExpiring = "";
804
+ export const AuthMethodRefreshWhenExpiring = "";
805
805
  /**
806
- * AuthSchemeRefreshAlways refreshes on every read: the provider reports
806
+ * AuthMethodRefreshAlways refreshes on every read: the provider reports
807
807
  * no expiry but the token does expire (Salesforce's session timeout is
808
808
  * per org and not reported).
809
809
  */
810
- export const AuthSchemeRefreshAlways = "always";
811
- export const AuthSchemeRevokeBearer = "bearer";
812
- export const AuthSchemeRevokeQuery = "query";
813
- export const AuthSchemeRevokeForm = "form";
810
+ export const AuthMethodRefreshAlways = "always";
811
+ export const AuthMethodRevokeBearer = "bearer";
812
+ export const AuthMethodRevokeQuery = "query";
813
+ export const AuthMethodRevokeForm = "form";
814
814
  export const VisibilityPrivate = "private";
815
815
  export const VisibilityTeam = "team";
816
816
  /**
@@ -822,6 +822,12 @@ export const VisibilityPublic = "public";
822
822
  export const VisibilityUnlisted = "unlisted";
823
823
  export const PermRead = "read";
824
824
  export const PermWrite = "write";
825
+ /**
826
+ * PermInteract changes what a page's people keep in it (an artifact's
827
+ * shared data) without editing the page. Write covers interact, and
828
+ * interact covers read; public and unlisted visibility grant read only.
829
+ */
830
+ export const PermInteract = "interact";
825
831
  /**
826
832
  * PermUse is execute intent: run an app, load a skill/knowledge into an
827
833
  * agent context, invoke an MCP tool. Distinct from read — a public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.26.2",
3
+ "version": "0.28.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",