@engini/sdk 0.3.0 → 0.5.1

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -5
  3. package/package.json +2 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Engini AI Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,9 +1,64 @@
1
1
  # @engini/sdk
2
2
 
3
- Agent-first TypeScript SDK for the [Engini](https://engini.io) Public API.
3
+ Agent-first TypeScript SDK for the [Engini](https://engini.io) Public API — discover tools,
4
+ execute them against your connected apps, and wrap them as LLM tool definitions.
4
5
 
5
- > **Pre-release scaffold.** The public surface is defined; behavior ships in
6
- > Phase 3 (after the `@engini/client` autogen package lands). Install betas
7
- > with `npm install @engini/sdk@beta`.
6
+ ```bash
7
+ npm install @engini/sdk
8
+ ```
8
9
 
9
- Source: <https://github.com/engini/engini-sdk>
10
+ ## Quickstart
11
+
12
+ ```ts
13
+ import { Engini } from "@engini/sdk";
14
+
15
+ const client = new Engini({ apiKey: "eng_…" }); // or set ENGINI_API_KEY
16
+
17
+ // Discover canonical tool schemas
18
+ const tools = await client.tools.get({ applications: ["salesforce"], search: "accounts", limit: 5 });
19
+
20
+ // Execute a tool against a connection
21
+ const [{ connectionId }] = await client.connections.list("salesforce");
22
+ const result = await client.tools.execute(
23
+ "salesforce_getrecords",
24
+ { sobject: "Account" },
25
+ { connectionId },
26
+ );
27
+ console.log(result.output);
28
+ ```
29
+
30
+ JWT auth is the fallback: `new Engini({ token: "<jwt>", companyToken: "<id>" })`, or set
31
+ `ENGINI_API_TOKEN` / `ENGINI_COMPANY_TOKEN`. With an API key the company is bound to the key,
32
+ so no company token is needed. Point at another host with `new Engini({ …, baseUrl })`.
33
+
34
+ ## Use with an LLM
35
+
36
+ `Provider` adapters wrap canonical schemas into vendor tool definitions **client-side, with no
37
+ vendor SDK dependency**. OpenAI is the default; Anthropic is also available.
38
+
39
+ ```ts
40
+ // Bind applications → connections once, then drive a tool-calling loop
41
+ const toolset = client.toolset({
42
+ tools: ["salesforce_getrecords"],
43
+ connections: { salesforce: "Prod" },
44
+ });
45
+
46
+ const openaiTools = client.provider.wrapTools(await toolset.tools()); // plain OpenAI tool-JSON
47
+ // … send openaiTools to the model, get a response …
48
+ const results = await toolset.handleToolCalls(llmResponse); // runs the calls, returns results
49
+ ```
50
+
51
+ `client.toolset(...)` builds a local toolset (no I/O until used) or loads a server one via
52
+ `client.toolset({ toolsetId })`.
53
+
54
+ ## What this adds over the raw REST client
55
+
56
+ Built on the autogenerated [`@engini/client`](https://www.npmjs.com/package/@engini/client), the
57
+ SDK adds what the generated client deliberately lacks: typed errors (the `EnginiError` family),
58
+ retry/backoff, auto-pagination, pluggable auth (`ApiKeyAuth` / `BearerAuth`), `Provider`
59
+ adapters for OpenAI/Anthropic, and the ergonomic `Toolset` object.
60
+
61
+ There's also a machine-first CLI, [`@engini/cli`](https://www.npmjs.com/package/@engini/cli),
62
+ built on this SDK.
63
+
64
+ Source & docs: <https://github.com/engini/engini-sdk>
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@engini/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.5.1",
4
4
  "description": "Engini SDK — agent-first ergonomic layer over the Engini Public API",
5
- "license": "UNLICENSED",
5
+ "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",