@engini/sdk 0.10.1 → 0.12.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/dist/index.d.ts +1 -0
- package/dist/resources/toolsets.d.ts +11 -0
- package/dist/resources/toolsets.js +22 -1
- package/package.json +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type { ConnectionBinding, ToolsetExecuteOptions } from "./toolset.js";
|
|
|
11
11
|
export { File } from "./files.js";
|
|
12
12
|
export type { FileWire } from "./files.js";
|
|
13
13
|
export type { ToolSchema, Filter, Sort, ToolExecuteResult, Application, ApplicationDetail, Connection, ConnectionDetail, ConnectionObject, WhoAmI, } from "./types.js";
|
|
14
|
+
export type { ToolsetConnectionDto, ToolsetConnectionRequest, ToolsetDto } from "@engini/client";
|
|
14
15
|
export type { Provider, ToolCall, ToolResultOptions } from "./providers/base.js";
|
|
15
16
|
export { OpenAIProvider } from "./providers/openai.js";
|
|
16
17
|
export type { OpenAIToolDef, OpenAIFunctionDef } from "./providers/openai.js";
|
|
@@ -16,4 +16,15 @@ export declare class ToolsetsResource {
|
|
|
16
16
|
connections: ToolsetConnectionRequest[];
|
|
17
17
|
workflows?: string[];
|
|
18
18
|
}): Promise<ToolsetDto>;
|
|
19
|
+
/**
|
|
20
|
+
* Update a toolset. `PATCH /v1/toolsets/{toolsetId}` replaces, not merges:
|
|
21
|
+
* an omitted member (`undefined`) leaves it unchanged; passing `[]` for
|
|
22
|
+
* `connections`/`workflows` replaces the set with empty (`UpdateToolsetRequest`:
|
|
23
|
+
* "Replacement connection set; null leaves it unchanged").
|
|
24
|
+
*/
|
|
25
|
+
update(toolsetId: string, params: {
|
|
26
|
+
name?: string;
|
|
27
|
+
connections?: ToolsetConnectionRequest[];
|
|
28
|
+
workflows?: string[];
|
|
29
|
+
}): Promise<ToolsetDto>;
|
|
19
30
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Toolsets resource — server-persisted toolset CRUD. */
|
|
2
|
-
import { toolsetsListToolsets, toolsetsGetToolset, toolsetsDeleteToolset, toolsetsCreateToolset, } from "@engini/client";
|
|
2
|
+
import { toolsetsListToolsets, toolsetsGetToolset, toolsetsDeleteToolset, toolsetsCreateToolset, toolsetsUpdateToolset, } from "@engini/client";
|
|
3
3
|
import { call } from "../http.js";
|
|
4
4
|
import { paginate, collect } from "../pagination.js";
|
|
5
5
|
import { EnginiNotFoundError, EnginiToolsetError } from "../errors.js";
|
|
@@ -38,4 +38,25 @@ export class ToolsetsResource {
|
|
|
38
38
|
body: { name: params.name, connections: params.connections, workflows: params.workflows },
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Update a toolset. `PATCH /v1/toolsets/{toolsetId}` replaces, not merges:
|
|
43
|
+
* an omitted member (`undefined`) leaves it unchanged; passing `[]` for
|
|
44
|
+
* `connections`/`workflows` replaces the set with empty (`UpdateToolsetRequest`:
|
|
45
|
+
* "Replacement connection set; null leaves it unchanged").
|
|
46
|
+
*/
|
|
47
|
+
async update(toolsetId, params) {
|
|
48
|
+
try {
|
|
49
|
+
return await call(toolsetsUpdateToolset, {
|
|
50
|
+
client: this.client._transport,
|
|
51
|
+
path: { toolsetId },
|
|
52
|
+
body: { name: params.name, connections: params.connections, workflows: params.workflows },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if (err instanceof EnginiNotFoundError) {
|
|
57
|
+
throw new EnginiToolsetError(`Unknown toolset id '${toolsetId}'.`);
|
|
58
|
+
}
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
41
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engini/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Engini SDK — agent-first ergonomic layer over the Engini Public API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=20"
|
|
14
|
+
},
|
|
12
15
|
"repository": {
|
|
13
16
|
"type": "git",
|
|
14
17
|
"url": "https://github.com/engini/engini-sdk",
|
|
@@ -20,7 +23,7 @@
|
|
|
20
23
|
"test": "vitest run"
|
|
21
24
|
},
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"@engini/client": "
|
|
26
|
+
"@engini/client": "0.5.0",
|
|
24
27
|
"undici": "^6.0.0"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|