@engini/sdk 0.24.0 → 0.27.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/README.md CHANGED
@@ -96,6 +96,29 @@ which replaces its whole field map. Settings you omit take the server's defaults
96
96
  minimums come from the connector's own declared metadata rather than the client. Agents are
97
97
  not connections: `client.connections` never returns them.
98
98
 
99
+ `client.authProviders` manages your own OAuth/credential providers: a name plus the values of
100
+ the connector's "Set on provider" fields, addressed by slot. A secret slot is write-only
101
+ (`hasValue: true`, `value: null` on read). `authProviderId` on `connections.getSignInUrl()` /
102
+ `connections.create()` is tri-state — omit it for the account default, `0` for the connector's
103
+ own OAuth client, an id for that provider (test `!== undefined`, never truthiness).
104
+
105
+ ```ts
106
+ const [source] = await client.authProviders.sources(); // eligible apps, methods, slots
107
+ const { redirectUri } = await client.authProviders.redirectUri(source.applicationId);
108
+ const p = await client.authProviders.create({
109
+ providerName: "Acme prod",
110
+ applicationId: source.applicationId,
111
+ sourceAuthenticationId: source.methods[0].authenticationId,
112
+ isDefault: false,
113
+ isSandbox: false,
114
+ fieldValues: { Key1: "client-id", Key2: process.env.CLIENT_SECRET! },
115
+ });
116
+ await client.authProviders.update(p.id, { fieldValues: { Key3: "" } }); // "" clears a slot
117
+ const { signInUrl } = await client.connections.getSignInUrl("salesforce", 9, { authProviderId: p.id });
118
+ ```
119
+
120
+ `list()`/`get()` need permission to manage providers; `usable()` (ids and names) needs only view.
121
+
99
122
  `client.triggers` is the event side of the platform: a trigger instance (`ti_…`) watches a
100
123
  connected system and captures events, which Engini POSTs to a destination you register.
101
124
 
package/dist/client.d.ts CHANGED
@@ -5,6 +5,7 @@ import { ToolsResource } from "./resources/tools.js";
5
5
  import { ConnectionsResource } from "./resources/connections.js";
6
6
  import { ToolsetsResource } from "./resources/toolsets.js";
7
7
  import { McpResource } from "./resources/mcp.js";
8
+ import { AuthProvidersResource } from "./resources/authProviders.js";
8
9
  import { OpaResource } from "./resources/opa.js";
9
10
  import { TriggersResource } from "./resources/triggers.js";
10
11
  import { ApplicationsResource } from "./resources/applications.js";
@@ -52,6 +53,7 @@ export declare class Engini {
52
53
  readonly toolsets: ToolsetsResource;
53
54
  readonly mcp: McpResource;
54
55
  readonly opa: OpaResource;
56
+ readonly authProviders: AuthProvidersResource;
55
57
  readonly triggers: TriggersResource;
56
58
  readonly applications: ApplicationsResource;
57
59
  readonly auth: AuthResource;
package/dist/client.js CHANGED
@@ -6,6 +6,7 @@ import { ToolsResource } from "./resources/tools.js";
6
6
  import { ConnectionsResource } from "./resources/connections.js";
7
7
  import { ToolsetsResource } from "./resources/toolsets.js";
8
8
  import { McpResource } from "./resources/mcp.js";
9
+ import { AuthProvidersResource } from "./resources/authProviders.js";
9
10
  import { OpaResource } from "./resources/opa.js";
10
11
  import { TriggersResource } from "./resources/triggers.js";
11
12
  import { ApplicationsResource } from "./resources/applications.js";
@@ -19,6 +20,7 @@ export class Engini {
19
20
  toolsets;
20
21
  mcp;
21
22
  opa;
23
+ authProviders;
22
24
  triggers;
23
25
  applications;
24
26
  auth;
@@ -74,6 +76,7 @@ export class Engini {
74
76
  this.toolsets = new ToolsetsResource(this);
75
77
  this.mcp = new McpResource(this);
76
78
  this.opa = new OpaResource(this);
79
+ this.authProviders = new AuthProvidersResource(this);
77
80
  this.triggers = new TriggersResource(this);
78
81
  this.applications = new ApplicationsResource(this);
79
82
  this.auth = new AuthResource(this);
package/dist/index.d.ts CHANGED
@@ -7,15 +7,16 @@ export type { Verify } from "./http.js";
7
7
  export { VERSION } from "./version.js";
8
8
  export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiToolsetNotFoundError, EnginiMcpServerNotFoundError, EnginiTimeoutError, EnginiToolExecutionError, EnginiOpaAgentNotFoundError, EnginiOpaAgentOfflineError, EnginiOpaApplicationAmbiguousError, EnginiOpaAgentTimeoutError, EnginiOpaAgentDispatchError, EnginiTriggerGapError, EnginiTriggerSubscribeFailedError, EnginiTriggerStreamLimitError, EnginiWebhookSignatureError, } from "./errors.js";
9
9
  export type { EnginiAPIErrorOptions } from "./errors.js";
10
- export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
10
+ export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, AuthProvidersResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
11
11
  export type { ToolsGetOptions, ToolsExecuteOptions, ApplicationsListOptions, TriggersClient, TriggerWebhookEvent, } from "./resources/index.js";
12
12
  export { Toolset } from "./toolset.js";
13
13
  export type { ConnectionBinding, ToolsetExecuteOptions } from "./toolset.js";
14
14
  export { File } from "./files.js";
15
15
  export type { FileWire } from "./files.js";
16
- export type { ToolSchema, Filter, Sort, ToolExecuteResult, Application, ApplicationDetail, Connection, ConnectionDetail, ConnectionObject, WhoAmI, AccessTokenResponse, } from "./types.js";
16
+ export type { ToolSchema, Filter, Sort, ToolExecuteResult, Application, ApplicationDetail, Connection, ConnectionDetail, ConnectionObject, WhoAmI, SignInStatusResponse, } from "./types.js";
17
17
  export type { ToolsetConnectionDto, ToolsetConnectionRequest, ToolsetDto } from "@engini/client";
18
- export type { OpaAgentListItem, OpaAgentDetail, OpaAgentSettings, OpaAgentTokenResponse, OpaAgentCreateResponse, OpaReleaseManifest, CreateOpaAgentRequest, UpdateOpaAgentRequest, } from "@engini/client";
18
+ export type { AuthProviderResponse, AuthProviderFieldValue, AuthProviderFieldDefinition, AuthProviderSourceApplication, AuthProviderSourceMethod, AuthProviderRedirectUriResponse, CreateAuthProviderRequest, UpdateAuthProviderRequest, UsableAuthProvider, } from "@engini/client";
19
+ export type { OnPremAgentListItem as OpaAgentListItem, OnPremAgentDetail as OpaAgentDetail, OnPremAgentSettings as OpaAgentSettings, OnPremAgentTokenResponse as OpaAgentTokenResponse, OnPremAgentCreateResponse as OpaAgentCreateResponse, OnPremAgentReleaseManifest as OpaReleaseManifest, CreateOnPremAgentRequest as CreateOpaAgentRequest, UpdateOnPremAgentRequest as UpdateOpaAgentRequest, } from "@engini/client";
19
20
  export type { TriggerTypeDto, TriggerTypeDetailDto, TriggerParametersDto, TriggerInstanceView, TriggerInstanceStatus, TriggerKind, TriggerStatusReason, TriggerScheduleDto, TriggerScheduleFrequency, TriggerTimeFrameDto, TriggerEventView, TriggerEventDetailView, TriggerEventDeliveryStateDto, TriggerDeliveryAttemptView, TriggerDestinationView, TriggerDestinationCreated, TriggerDestinationStatusDto, CreateTriggerRequest, PatchTriggerRequest, CreateTriggerDestinationRequest, PatchTriggerDestinationRequest, PutDefaultDestinationRequest, } from "@engini/client";
20
21
  export type { McpServerPublicDto, McpServerConnectionDto, McpServerConnectionRequest, McpServerWorkflowDto, McpServerWorkflowRequest, McpAvailableToolDto, } from "@engini/client";
21
22
  export type { Provider, ToolCall, ToolResultOptions } from "./providers/base.js";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { ApiKeyAuth, BearerAuth, ENV_API_KEY_VAR, ENV_TOKEN_VAR, ENV_COMPANY_TOK
3
3
  export { composeUserAgent } from "./http.js";
4
4
  export { VERSION } from "./version.js";
5
5
  export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiToolsetNotFoundError, EnginiMcpServerNotFoundError, EnginiTimeoutError, EnginiToolExecutionError, EnginiOpaAgentNotFoundError, EnginiOpaAgentOfflineError, EnginiOpaApplicationAmbiguousError, EnginiOpaAgentTimeoutError, EnginiOpaAgentDispatchError, EnginiTriggerGapError, EnginiTriggerSubscribeFailedError, EnginiTriggerStreamLimitError, EnginiWebhookSignatureError, } from "./errors.js";
6
- export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
6
+ export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, AuthProvidersResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
7
7
  export { Toolset } from "./toolset.js";
8
8
  export { File } from "./files.js";
9
9
  export { OpenAIProvider } from "./providers/openai.js";
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Auth providers resource — an account's own OAuth/credential setup for one authentication
3
+ * method of one application.
4
+ *
5
+ * A provider is a name plus the values of the method's "Set on provider" connection fields,
6
+ * addressed by slot (`Key1`..`Key10`, `ApiUser`, `ApiPassword`, `BaseUrl`). A secret slot is
7
+ * write-only: it is accepted on the way in and a read returns `hasValue: true` with a null
8
+ * `value`. The server rejects a top-level `clientId` / `clientSecret`, so neither is a
9
+ * parameter here.
10
+ *
11
+ * Named `authProviders`, never bare `provider`: `client.provider` is the LLM-vendor wrapper.
12
+ *
13
+ * Listing and reading providers is manager-gated server-side; `usable()` (VIEW-gated) is the
14
+ * way for a plain member to resolve a provider by name.
15
+ */
16
+ import { type AuthProviderRedirectUriResponse, type AuthProviderResponse, type AuthProviderSourceApplication, type CreateAuthProviderRequest, type UpdateAuthProviderRequest, type UsableAuthProvider } from "@engini/client";
17
+ import { type Transport } from "../http.js";
18
+ /** Minimal client surface this resource needs (satisfied by `Engini`). */
19
+ export interface AuthProvidersClient {
20
+ _transport: Transport;
21
+ }
22
+ export declare class AuthProvidersResource {
23
+ private readonly client;
24
+ constructor(client: AuthProvidersClient);
25
+ /** Every auth provider on the account (manager-gated; password values are never returned). */
26
+ list(): Promise<AuthProviderResponse[]>;
27
+ get(id: number): Promise<AuthProviderResponse>;
28
+ /**
29
+ * Create a provider. `fieldValues` is keyed by slot; password values are write-only. A body
30
+ * carrying `clientId` / `clientSecret` is a 400 `INVALID_AUTH_PROVIDER`.
31
+ */
32
+ create(body: CreateAuthProviderRequest): Promise<AuthProviderResponse>;
33
+ /**
34
+ * Partial update: an omitted field is left alone. In `fieldValues`, an omitted slot keeps its
35
+ * stored value and `""` clears it.
36
+ */
37
+ update(id: number, body: UpdateAuthProviderRequest): Promise<AuthProviderResponse>;
38
+ /** Delete a provider; refused (409 `AUTH_PROVIDER_IN_USE`) while a connection uses it. */
39
+ delete(id: number): Promise<void>;
40
+ /**
41
+ * The callback URL to register in your own OAuth app *before* creating a provider for the
42
+ * method. `authenticationId` is optional when the application has a single eligible method.
43
+ */
44
+ redirectUri(applicationId: number, opts?: {
45
+ authenticationId?: number;
46
+ sandbox?: boolean;
47
+ }): Promise<AuthProviderRedirectUriResponse>;
48
+ /** Applications and methods a provider can be based on, with their "Set on provider" slots. */
49
+ sources(): Promise<AuthProviderSourceApplication[]>;
50
+ /** Active providers the caller may sign a connection in through; ids and names only, VIEW-gated. */
51
+ usable(): Promise<UsableAuthProvider[]>;
52
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Auth providers resource — an account's own OAuth/credential setup for one authentication
3
+ * method of one application.
4
+ *
5
+ * A provider is a name plus the values of the method's "Set on provider" connection fields,
6
+ * addressed by slot (`Key1`..`Key10`, `ApiUser`, `ApiPassword`, `BaseUrl`). A secret slot is
7
+ * write-only: it is accepted on the way in and a read returns `hasValue: true` with a null
8
+ * `value`. The server rejects a top-level `clientId` / `clientSecret`, so neither is a
9
+ * parameter here.
10
+ *
11
+ * Named `authProviders`, never bare `provider`: `client.provider` is the LLM-vendor wrapper.
12
+ *
13
+ * Listing and reading providers is manager-gated server-side; `usable()` (VIEW-gated) is the
14
+ * way for a plain member to resolve a provider by name.
15
+ */
16
+ import { authProvidersCreate, authProvidersDelete, authProvidersGet, authProvidersGetRedirectUri, authProvidersList, authProvidersListSources, authProvidersListUsable, authProvidersUpdate, } from "@engini/client";
17
+ import { call } from "../http.js";
18
+ export class AuthProvidersResource {
19
+ client;
20
+ constructor(client) {
21
+ this.client = client;
22
+ }
23
+ /** Every auth provider on the account (manager-gated; password values are never returned). */
24
+ async list() {
25
+ return call(authProvidersList, { client: this.client._transport });
26
+ }
27
+ async get(id) {
28
+ return call(authProvidersGet, { client: this.client._transport, path: { id } });
29
+ }
30
+ /**
31
+ * Create a provider. `fieldValues` is keyed by slot; password values are write-only. A body
32
+ * carrying `clientId` / `clientSecret` is a 400 `INVALID_AUTH_PROVIDER`.
33
+ */
34
+ async create(body) {
35
+ return call(authProvidersCreate, { client: this.client._transport, body });
36
+ }
37
+ /**
38
+ * Partial update: an omitted field is left alone. In `fieldValues`, an omitted slot keeps its
39
+ * stored value and `""` clears it.
40
+ */
41
+ async update(id, body) {
42
+ return call(authProvidersUpdate, { client: this.client._transport, path: { id }, body });
43
+ }
44
+ /** Delete a provider; refused (409 `AUTH_PROVIDER_IN_USE`) while a connection uses it. */
45
+ async delete(id) {
46
+ await call(authProvidersDelete, { client: this.client._transport, path: { id } });
47
+ }
48
+ /**
49
+ * The callback URL to register in your own OAuth app *before* creating a provider for the
50
+ * method. `authenticationId` is optional when the application has a single eligible method.
51
+ */
52
+ async redirectUri(applicationId, opts = {}) {
53
+ return call(authProvidersGetRedirectUri, {
54
+ client: this.client._transport,
55
+ path: { applicationId },
56
+ query: { authenticationId: opts.authenticationId, sandbox: opts.sandbox },
57
+ });
58
+ }
59
+ /** Applications and methods a provider can be based on, with their "Set on provider" slots. */
60
+ async sources() {
61
+ return call(authProvidersListSources, { client: this.client._transport });
62
+ }
63
+ /** Active providers the caller may sign a connection in through; ids and names only, VIEW-gated. */
64
+ async usable() {
65
+ return call(authProvidersListUsable, { client: this.client._transport });
66
+ }
67
+ }
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Connections resource — listing, defaults, name→id resolution, and the creation
3
- * flow (sign-in/access-token/create/check/refresh/objects/select + the
3
+ * flow (sign-in-status/create/check/refresh/objects/select + the
4
4
  * `waitForRefresh` poll helper) that backs the interactive `engini connect` CLI.
5
5
  * See `docs/superpowers/specs/2026-06-18-cli-connect-flow-design.md`.
6
6
  */
7
7
  import { type ConnectionObject, type ConnectionReplaceResult, type ConnectionPublicDetail, type ConnectionPublicListItem, type DefaultConnectionDto, type RefreshStatusResponse, type SignInUrlResponse } from "@engini/client";
8
8
  import { type Transport } from "../http.js";
9
- import type { AccessTokenResponse } from "../types.js";
9
+ import type { SignInStatusResponse } from "../types.js";
10
10
  /**
11
11
  * Whether a refresh status is terminal (finished, error, or otherwise not running).
12
12
  * Unknown descriptions count as terminal — erring that way avoids hanging on a
@@ -82,13 +82,24 @@ export declare class ConnectionsResource {
82
82
  setDefault(connectionId: number): Promise<unknown>;
83
83
  clearDefault(application: string): Promise<unknown>;
84
84
  resolve(application: string, name: string): Promise<number>;
85
- /** Begin an OAuth2 sign-in: returns `{ signInUrl, state }` to poll on. */
85
+ /**
86
+ * Begin an OAuth2 sign-in: returns `{ signInUrl, state }` to poll on.
87
+ *
88
+ * `opts.authProviderId` is tri-state: omitted = the account's default provider (if the
89
+ * caller may use it), `0` = the connector's own OAuth client, an id = that provider.
90
+ * Test it with `!== undefined` - a falsy check swallows `0`.
91
+ */
86
92
  getSignInUrl(application: string, authenticationId: number, opts?: {
87
93
  fields?: Record<string, string>;
88
94
  environment?: string;
95
+ authProviderId?: number;
89
96
  }): Promise<SignInUrlResponse>;
90
- /** Poll an OAuth2 sign-in by `state`; `status` is `completed` when done. */
91
- getAccessToken(state: string): Promise<AccessTokenResponse>;
97
+ /**
98
+ * Poll an OAuth2 sign-in by `state`. Token-free: `status` is `pending` until `signed_in`
99
+ * (or `failed` / `cancelled` / `expired`), then `create` with `oauthState` - the server
100
+ * reads the credentials from the sign-in itself.
101
+ */
102
+ getSignInStatus(state: string): Promise<SignInStatusResponse>;
92
103
  /**
93
104
  * Create a connection; returns the full connection detail.
94
105
  *
@@ -102,6 +113,7 @@ export declare class ConnectionsResource {
102
113
  create(application: string, connectionName: string, authenticationId: number, fields: Record<string, string>, opts?: {
103
114
  description?: string;
104
115
  oauthState?: string;
116
+ authProviderId?: number;
105
117
  }): Promise<ConnectionPublicDetail>;
106
118
  /** Test a connection's liveness; returns the decoded check result. */
107
119
  check(connectionId: number): Promise<unknown>;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Connections resource — listing, defaults, name→id resolution, and the creation
3
- * flow (sign-in/access-token/create/check/refresh/objects/select + the
3
+ * flow (sign-in-status/create/check/refresh/objects/select + the
4
4
  * `waitForRefresh` poll helper) that backs the interactive `engini connect` CLI.
5
5
  * See `docs/superpowers/specs/2026-06-18-cli-connect-flow-design.md`.
6
6
  */
7
- import { connectionsGetConnection, connectionsDeleteConnection, connectionsGetConnections, connectionsGetDefaultConnections, connectionsSetDefaultConnection, connectionsClearDefaultConnection, connectionsGetSignInUrl, connectionsGetAccessToken, connectionsCreateConnection, connectionsCheckConnection, connectionsRefreshObjects, connectionsGetRefreshStatus, connectionsGetConnectionObjects, connectionsSelectObjects, connectionsUpdateConnection, connectionsReplaceConnection, } from "@engini/client";
7
+ import { connectionsGetConnection, connectionsDeleteConnection, connectionsGetConnections, connectionsGetDefaultConnections, connectionsSetDefaultConnection, connectionsClearDefaultConnection, connectionsGetSignInUrl, connectionsGetSignInStatus, connectionsCreateConnection, connectionsCheckConnection, connectionsRefreshObjects, connectionsGetRefreshStatus, connectionsGetConnectionObjects, connectionsSelectObjects, connectionsUpdateConnection, connectionsReplaceConnection, } from "@engini/client";
8
8
  import { call } from "../http.js";
9
9
  import { paginate, collect } from "../pagination.js";
10
10
  import { EnginiConnectionError, EnginiTimeoutError, EnginiToolsetError } from "../errors.js";
@@ -201,7 +201,13 @@ export class ConnectionsResource {
201
201
  return matches[0].connectionId;
202
202
  }
203
203
  // --- Creation flow (backs `engini connect`) --------------------------------
204
- /** Begin an OAuth2 sign-in: returns `{ signInUrl, state }` to poll on. */
204
+ /**
205
+ * Begin an OAuth2 sign-in: returns `{ signInUrl, state }` to poll on.
206
+ *
207
+ * `opts.authProviderId` is tri-state: omitted = the account's default provider (if the
208
+ * caller may use it), `0` = the connector's own OAuth client, an id = that provider.
209
+ * Test it with `!== undefined` - a falsy check swallows `0`.
210
+ */
205
211
  async getSignInUrl(application, authenticationId, opts = {}) {
206
212
  return call(connectionsGetSignInUrl, {
207
213
  client: this.client._transport,
@@ -210,12 +216,17 @@ export class ConnectionsResource {
210
216
  authenticationId,
211
217
  ...(opts.environment !== undefined ? { environment: opts.environment } : {}),
212
218
  ...(opts.fields !== undefined ? { fields: opts.fields } : {}),
219
+ ...(opts.authProviderId !== undefined ? { authProviderId: opts.authProviderId } : {}),
213
220
  },
214
221
  });
215
222
  }
216
- /** Poll an OAuth2 sign-in by `state`; `status` is `completed` when done. */
217
- async getAccessToken(state) {
218
- return call(connectionsGetAccessToken, {
223
+ /**
224
+ * Poll an OAuth2 sign-in by `state`. Token-free: `status` is `pending` until `signed_in`
225
+ * (or `failed` / `cancelled` / `expired`), then `create` with `oauthState` - the server
226
+ * reads the credentials from the sign-in itself.
227
+ */
228
+ async getSignInStatus(state) {
229
+ return call(connectionsGetSignInStatus, {
219
230
  client: this.client._transport,
220
231
  path: { state },
221
232
  });
@@ -233,6 +244,9 @@ export class ConnectionsResource {
233
244
  async create(application, connectionName, authenticationId, fields, opts = {}) {
234
245
  return call(connectionsCreateConnection, {
235
246
  client: this.client._transport,
247
+ // A *query* parameter here, honoured only for OAuth2-without-sign-in methods (the body's own
248
+ // AuthProviderId is ignored). Same tri-state as get-sign-in-url: omitted / 0 / id.
249
+ ...(opts.authProviderId !== undefined ? { query: { authProviderId: opts.authProviderId } } : {}),
236
250
  body: {
237
251
  applicationSlug: application,
238
252
  connectionName,
@@ -3,6 +3,8 @@ export type { ToolsGetOptions, ToolsExecuteOptions } from "./tools.js";
3
3
  export { ConnectionsResource, refreshFailed } from "./connections.js";
4
4
  export { ToolsetsResource } from "./toolsets.js";
5
5
  export { McpResource } from "./mcp.js";
6
+ export { AuthProvidersResource } from "./authProviders.js";
7
+ export type { AuthProvidersClient } from "./authProviders.js";
6
8
  export { OpaResource } from "./opa.js";
7
9
  export type { OpaClient } from "./opa.js";
8
10
  export { TriggersResource, verifyWebhook } from "./triggers.js";
@@ -2,6 +2,7 @@ export { ToolsResource } from "./tools.js";
2
2
  export { ConnectionsResource, refreshFailed } from "./connections.js";
3
3
  export { ToolsetsResource } from "./toolsets.js";
4
4
  export { McpResource } from "./mcp.js";
5
+ export { AuthProvidersResource } from "./authProviders.js";
5
6
  export { OpaResource } from "./opa.js";
6
7
  export { TriggersResource, verifyWebhook } from "./triggers.js";
7
8
  export { ApplicationsResource } from "./applications.js";
@@ -10,7 +10,7 @@
10
10
  * Agents are NOT connections on this surface: `client.connections` never returns them,
11
11
  * and `connections.get(agentId)` is a 404.
12
12
  */
13
- import { type OpaAgentCreateResponse, type OpaAgentDetail, type OpaAgentListItem, type OpaAgentTokenResponse, type OpaReleaseManifest } from "@engini/client";
13
+ import { type OnPremAgentCreateResponse, type OnPremAgentDetail, type OnPremAgentListItem, type OnPremAgentTokenResponse, type OnPremAgentReleaseManifest } from "@engini/client";
14
14
  import { type Transport } from "../http.js";
15
15
  /** The settings members every write accepts. Each is independently optional. */
16
16
  interface OpaSettingsParams {
@@ -44,7 +44,7 @@ export declare class OpaResource {
44
44
  list(params?: {
45
45
  status?: string;
46
46
  name?: string;
47
- }): Promise<OpaAgentListItem[]>;
47
+ }): Promise<OnPremAgentListItem[]>;
48
48
  /**
49
49
  * One agent's status, self-reported version, last heartbeat and settings.
50
50
  *
@@ -52,7 +52,7 @@ export declare class OpaResource {
52
52
  * account, or is not an on-premise agent — the API answers 404 for all three
53
53
  * deliberately and does not distinguish them.
54
54
  */
55
- get(agentId: number): Promise<OpaAgentDetail>;
55
+ get(agentId: number): Promise<OnPremAgentDetail>;
56
56
  /**
57
57
  * Where to download the current agent installer.
58
58
  *
@@ -61,7 +61,7 @@ export declare class OpaResource {
61
61
  * are then null. A caller that needs integrity verification should refuse a degraded
62
62
  * manifest.
63
63
  */
64
- latestRelease(): Promise<OpaReleaseManifest>;
64
+ latestRelease(): Promise<OnPremAgentReleaseManifest>;
65
65
  /**
66
66
  * Build a settings object carrying ONLY what the caller supplied, or `undefined`
67
67
  * when nothing was.
@@ -96,7 +96,7 @@ export declare class OpaResource {
96
96
  name: string;
97
97
  description?: string;
98
98
  applicationSlug?: string;
99
- } & OpaSettingsParams): Promise<OpaAgentCreateResponse>;
99
+ } & OpaSettingsParams): Promise<OnPremAgentCreateResponse>;
100
100
  /**
101
101
  * Change an agent's name, description or runtime settings.
102
102
  *
@@ -110,7 +110,7 @@ export declare class OpaResource {
110
110
  update(agentId: number, params: {
111
111
  name?: string;
112
112
  description?: string;
113
- } & OpaSettingsParams): Promise<OpaAgentDetail>;
113
+ } & OpaSettingsParams): Promise<OnPremAgentDetail>;
114
114
  /** Permanently delete an agent. Workflows routed through it stop working. */
115
115
  delete(agentId: number): Promise<void>;
116
116
  /**
@@ -119,21 +119,21 @@ export declare class OpaResource {
119
119
  * A no-op on an agent that is not disabled — its reported liveness is left alone
120
120
  * rather than being reset.
121
121
  */
122
- enable(agentId: number): Promise<OpaAgentDetail>;
122
+ enable(agentId: number): Promise<OnPremAgentDetail>;
123
123
  /**
124
124
  * Disable an agent so it stops being marked online.
125
125
  *
126
126
  * Not a delete and not a pause of in-flight work: tasks it already holds still run
127
127
  * to completion.
128
128
  */
129
- disable(agentId: number): Promise<OpaAgentDetail>;
129
+ disable(agentId: number): Promise<OnPremAgentDetail>;
130
130
  /**
131
131
  * The agent's token — the credential it authenticates to Engini with.
132
132
  *
133
133
  * Treat the result as a secret: it is equivalent to the agent's identity. Reads are
134
134
  * audit-logged server-side.
135
135
  */
136
- getToken(agentId: number): Promise<OpaAgentTokenResponse>;
136
+ getToken(agentId: number): Promise<OnPremAgentTokenResponse>;
137
137
  /**
138
138
  * Issue a new token, invalidating the current one immediately.
139
139
  *
@@ -144,7 +144,7 @@ export declare class OpaResource {
144
144
  * confirmation gate belongs in the CLI, not in library code where a prompt would be
145
145
  * unreachable.
146
146
  */
147
- rotateToken(agentId: number): Promise<OpaAgentTokenResponse>;
147
+ rotateToken(agentId: number): Promise<OnPremAgentTokenResponse>;
148
148
  /**
149
149
  * Map the OPA agent-side wire codes onto their typed errors.
150
150
  *
@@ -10,7 +10,7 @@
10
10
  * Agents are NOT connections on this surface: `client.connections` never returns them,
11
11
  * and `connections.get(agentId)` is a 404.
12
12
  */
13
- import { opaAgentsCreateAgent, opaAgentsDeleteAgent, opaAgentsDisableAgent, opaAgentsEnableAgent, opaAgentsGetAgent, opaAgentsGetAgentLogs, opaAgentsGetAgentToken, opaAgentsGetLatestRelease, opaAgentsListAgents, opaAgentsRotateAgentToken, opaAgentsUpdateAgent, } from "@engini/client";
13
+ import { onPremAgentsCreateAgent, onPremAgentsDeleteAgent, onPremAgentsDisableAgent, onPremAgentsEnableAgent, onPremAgentsGetAgent, onPremAgentsGetAgentLogs, onPremAgentsGetAgentToken, onPremAgentsGetLatestRelease, onPremAgentsListAgents, onPremAgentsRotateAgentToken, onPremAgentsUpdateAgent, } from "@engini/client";
14
14
  import { call } from "../http.js";
15
15
  import { paginate, collect } from "../pagination.js";
16
16
  import { EnginiAPIError, EnginiNotFoundError, EnginiOpaAgentDispatchError, EnginiOpaAgentNotFoundError, EnginiOpaAgentOfflineError, EnginiOpaAgentTimeoutError, EnginiOpaApplicationAmbiguousError, } from "../errors.js";
@@ -43,7 +43,7 @@ export class OpaResource {
43
43
  */
44
44
  async list(params = {}) {
45
45
  const transport = this.client._transport;
46
- return collect(paginate((offset, top) => call(opaAgentsListAgents, {
46
+ return collect(paginate((offset, top) => call(onPremAgentsListAgents, {
47
47
  client: transport,
48
48
  query: { offset, top, status: params.status, name: params.name },
49
49
  })));
@@ -57,7 +57,7 @@ export class OpaResource {
57
57
  */
58
58
  async get(agentId) {
59
59
  try {
60
- return await call(opaAgentsGetAgent, {
60
+ return await call(onPremAgentsGetAgent, {
61
61
  client: this.client._transport,
62
62
  path: { id: agentId },
63
63
  });
@@ -75,7 +75,7 @@ export class OpaResource {
75
75
  * manifest.
76
76
  */
77
77
  async latestRelease() {
78
- return call(opaAgentsGetLatestRelease, { client: this.client._transport });
78
+ return call(onPremAgentsGetLatestRelease, { client: this.client._transport });
79
79
  }
80
80
  // ---- lifecycle -------------------------------------------------------------------
81
81
  /**
@@ -129,7 +129,7 @@ export class OpaResource {
129
129
  */
130
130
  async create(params) {
131
131
  try {
132
- return await call(opaAgentsCreateAgent, {
132
+ return await call(onPremAgentsCreateAgent, {
133
133
  client: this.client._transport,
134
134
  body: {
135
135
  name: params.name,
@@ -155,7 +155,7 @@ export class OpaResource {
155
155
  */
156
156
  async update(agentId, params) {
157
157
  try {
158
- return await call(opaAgentsUpdateAgent, {
158
+ return await call(onPremAgentsUpdateAgent, {
159
159
  client: this.client._transport,
160
160
  path: { id: agentId },
161
161
  body: {
@@ -172,7 +172,7 @@ export class OpaResource {
172
172
  /** Permanently delete an agent. Workflows routed through it stop working. */
173
173
  async delete(agentId) {
174
174
  try {
175
- await call(opaAgentsDeleteAgent, {
175
+ await call(onPremAgentsDeleteAgent, {
176
176
  client: this.client._transport,
177
177
  path: { id: agentId },
178
178
  });
@@ -189,7 +189,7 @@ export class OpaResource {
189
189
  */
190
190
  async enable(agentId) {
191
191
  try {
192
- return await call(opaAgentsEnableAgent, {
192
+ return await call(onPremAgentsEnableAgent, {
193
193
  client: this.client._transport,
194
194
  path: { id: agentId },
195
195
  });
@@ -206,7 +206,7 @@ export class OpaResource {
206
206
  */
207
207
  async disable(agentId) {
208
208
  try {
209
- return await call(opaAgentsDisableAgent, {
209
+ return await call(onPremAgentsDisableAgent, {
210
210
  client: this.client._transport,
211
211
  path: { id: agentId },
212
212
  });
@@ -224,7 +224,7 @@ export class OpaResource {
224
224
  */
225
225
  async getToken(agentId) {
226
226
  try {
227
- return await call(opaAgentsGetAgentToken, {
227
+ return await call(onPremAgentsGetAgentToken, {
228
228
  client: this.client._transport,
229
229
  path: { id: agentId },
230
230
  });
@@ -245,7 +245,7 @@ export class OpaResource {
245
245
  */
246
246
  async rotateToken(agentId) {
247
247
  try {
248
- return await call(opaAgentsRotateAgentToken, {
248
+ return await call(onPremAgentsRotateAgentToken, {
249
249
  client: this.client._transport,
250
250
  path: { id: agentId },
251
251
  query: { confirm: true },
@@ -298,7 +298,7 @@ export class OpaResource {
298
298
  async downloadLogs(agentId) {
299
299
  let payload;
300
300
  try {
301
- payload = await call(opaAgentsGetAgentLogs, {
301
+ payload = await call(onPremAgentsGetAgentLogs, {
302
302
  client: this.client._transport,
303
303
  path: { id: agentId },
304
304
  // `as const` is load-bearing: through `call`'s generic inference the literal
package/dist/types.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Canonical, provider-agnostic tool schema and execution result types.
3
3
  * Bound to the autogen `@engini/client` models — the SDK's public surface.
4
4
  */
5
- import type { ToolDetailDto, ActivityCondition, ActivitySort, ApplicationDto, ApplicationDetailDto, ConnectionPublicListItem, ConnectionPublicDetail, ConnectionObject as ConnectionObjectModel, WhoAmIResponse, AccessTokenResponse as ClientAccessTokenResponse } from "@engini/client";
5
+ import type { ToolDetailDto, ActivityCondition, ActivitySort, ApplicationDto, ApplicationDetailDto, ConnectionPublicListItem, ConnectionPublicDetail, ConnectionObject as ConnectionObjectModel, WhoAmIResponse, SignInStatusResponse as ClientSignInStatusResponse } from "@engini/client";
6
6
  /** Canonical tool schema (== client `ToolDetailDto`; carries `inputSchema` + `supports*`). */
7
7
  export type ToolSchema = ToolDetailDto;
8
8
  /** A connector application summary (== client `ApplicationDto`). */
@@ -18,23 +18,15 @@ export type ConnectionObject = ConnectionObjectModel;
18
18
  /** Authenticated caller identity (== client `WhoAmIResponse`). */
19
19
  export type WhoAmI = WhoAmIResponse;
20
20
  /**
21
- * Access-token poll response, incl. `fieldOptions` — legal values for a declared
22
- * connection field discovered from the signed-in org on the terminal poll of the
23
- * OAuth sign-in (WorkflowApi #1401), shaped `{ [fieldName]: { [valueToSave]: labelToShow } }`.
24
- * e.g. Salesforce's `ApiVersionUrl` -> `{ "/services/data/v60.0": "60.0" }` — the KEY is
25
- * the value a `create`/`update` must send, the VALUE is only a display label; getting
26
- * that backwards saves exactly the broken connection this feature exists to prevent.
27
- *
28
- * `@engini/client`'s generated `AccessTokenResponse` now declares `fieldOptions` itself
29
- * (required, non-null — the C# DTO is `= new()`), so this is a straight re-export, not
30
- * a local intersection. That non-nullability is deliberate, not an oversight: the merged
31
- * server (`ConnectionsController.cs`, terminal poll) maps a failed/empty lookup to `{}`
32
- * explicitly, so **absent is the only signal of an older server** (one that predates
33
- * WorkflowApi #1401); `{}` means the lookup ran and found no options, same as "the field
34
- * genuinely has none". A failed lookup is indistinguishable from "no options" once it's
35
- * on the wire (logged server-side, not surfaced here) - same as it is from absent.
21
+ * Sign-in status poll response. Carries no provider token: `fieldOptions` holds legal values for
22
+ * a declared connection field discovered from the signed-in org, shaped
23
+ * `{ [fieldName]: { [valueToSave]: labelToShow } }` (e.g. Salesforce's `ApiVersionUrl` ->
24
+ * `{ "/services/data/v60.0": "60.0" }` - the KEY is what `create`/`update` must send, the VALUE is
25
+ * only a display label), and `derivedFields` names the connection fields the server fills from the
26
+ * sign-in, so a caller must not ask for or post them. `createOutcome` (`connected` / `failed` /
27
+ * null) reports a create already made with this state and is separate from `status`.
36
28
  */
37
- export type AccessTokenResponse = ClientAccessTokenResponse;
29
+ export type SignInStatusResponse = ClientSignInStatusResponse;
38
30
  /** Execute-time filter condition (gated by `supportsFilters`). */
39
31
  export type Filter = ActivityCondition;
40
32
  /** Execute-time sort directive (gated by `supportsSort`). */
package/dist/version.d.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  * Regenerated on every build/typecheck/test (see the "pre*" scripts in
4
4
  * package.json). Un-stamped local builds yield "0.0.0".
5
5
  */
6
- export declare const VERSION = "0.24.0";
6
+ export declare const VERSION = "0.27.0";
package/dist/version.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Regenerated on every build/typecheck/test (see the "pre*" scripts in
4
4
  * package.json). Un-stamped local builds yield "0.0.0".
5
5
  */
6
- export const VERSION = "0.24.0";
6
+ export const VERSION = "0.27.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engini/sdk",
3
- "version": "0.24.0",
3
+ "version": "0.27.0",
4
4
  "description": "Engini SDK — agent-first ergonomic layer over the Engini Public API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "test": "vitest run"
28
28
  },
29
29
  "dependencies": {
30
- "@engini/client": "0.11.0",
30
+ "@engini/client": "0.13.0",
31
31
  "undici": "^6.0.0"
32
32
  },
33
33
  "devDependencies": {