@reminix/sdk 0.9.0 → 0.11.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 +45 -0
- package/README.md +53 -6
- package/client.d.mts +20 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -11
- package/client.d.ts.map +1 -1
- package/client.js +18 -6
- package/client.js.map +1 -1
- package/client.mjs +18 -6
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +57 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +57 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +108 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +102 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/agents.d.mts +273 -148
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +273 -148
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +29 -3
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +29 -3
- package/resources/agents.mjs.map +1 -1
- package/resources/conversations.d.mts +107 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +107 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +41 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +37 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/execution-logs.d.mts +93 -0
- package/resources/execution-logs.d.mts.map +1 -0
- package/resources/execution-logs.d.ts +93 -0
- package/resources/execution-logs.d.ts.map +1 -0
- package/resources/execution-logs.js +33 -0
- package/resources/execution-logs.js.map +1 -0
- package/resources/execution-logs.mjs +29 -0
- package/resources/execution-logs.mjs.map +1 -0
- package/resources/index.d.mts +5 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/projects.d.mts +5 -5
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts +5 -5
- package/resources/projects.d.ts.map +1 -1
- package/resources/tools.d.mts +152 -0
- package/resources/tools.d.mts.map +1 -0
- package/resources/tools.d.ts +152 -0
- package/resources/tools.d.ts.map +1 -0
- package/resources/tools.js +59 -0
- package/resources/tools.js.map +1 -0
- package/resources/tools.mjs +55 -0
- package/resources/tools.mjs.map +1 -0
- package/src/client.ts +96 -22
- package/src/core/pagination.ts +165 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/agents.ts +336 -165
- package/src/resources/conversations.ts +146 -0
- package/src/resources/execution-logs.ts +125 -0
- package/src/resources/index.ts +31 -8
- package/src/resources/projects.ts +5 -5
- package/src/resources/tools.ts +192 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/deployments.d.mts +0 -4
- package/resources/deployments.d.mts.map +0 -1
- package/resources/deployments.d.ts +0 -4
- package/resources/deployments.d.ts.map +0 -1
- package/resources/deployments.js +0 -9
- package/resources/deployments.js.map +0 -1
- package/resources/deployments.mjs +0 -5
- package/resources/deployments.mjs.map +0 -1
- package/resources/secrets.d.mts +0 -4
- package/resources/secrets.d.mts.map +0 -1
- package/resources/secrets.d.ts +0 -4
- package/resources/secrets.d.ts.map +0 -1
- package/resources/secrets.js +0 -9
- package/resources/secrets.js.map +0 -1
- package/resources/secrets.mjs +0 -5
- package/resources/secrets.mjs.map +0 -1
- package/src/resources/deployments.ts +0 -5
- package/src/resources/secrets.ts +0 -5
package/resources/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { Agents, type
|
|
1
|
+
export { Agents, type Agent, type AgentConfig, type ChatMessage, type StreamChunk, type AgentChatResponse, type AgentExecuteResponse, type AgentListParams, type AgentChatParams, type AgentChatParamsNonStreaming, type AgentChatParamsStreaming, type AgentExecuteParams, type AgentExecuteParamsNonStreaming, type AgentExecuteParamsStreaming, type AgentsCursor, } from "./agents.js";
|
|
2
2
|
export { ClientTokens, type ClientTokenCreateResponse, type ClientTokenCreateParams } from "./client-tokens.js";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
3
|
+
export { Conversations, type Conversation, type ConversationRetrieveResponse, type ConversationListParams, type ConversationsCursor, } from "./conversations.js";
|
|
4
|
+
export { ExecutionLogs, type ExecutionLog, type ExecutionLogListParams, type ExecutionLogsCursor, } from "./execution-logs.js";
|
|
5
|
+
export { Projects, type Project } from "./projects.js";
|
|
6
|
+
export { Tools, type Tool, type ToolExecuteResponse, type ToolListParams, type ToolExecuteParams, type ToolsCursor, } from "./tools.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAChC,KAAK,YAAY,GAClB;OACM,EAAE,YAAY,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE;OAC9E,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE;OAC1B,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB"}
|
package/resources/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.Tools = exports.Projects = exports.ExecutionLogs = exports.Conversations = exports.ClientTokens = exports.Agents = void 0;
|
|
5
5
|
var agents_1 = require("./agents.js");
|
|
6
6
|
Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
|
|
7
7
|
var client_tokens_1 = require("./client-tokens.js");
|
|
8
8
|
Object.defineProperty(exports, "ClientTokens", { enumerable: true, get: function () { return client_tokens_1.ClientTokens; } });
|
|
9
|
-
var
|
|
10
|
-
Object.defineProperty(exports, "
|
|
9
|
+
var conversations_1 = require("./conversations.js");
|
|
10
|
+
Object.defineProperty(exports, "Conversations", { enumerable: true, get: function () { return conversations_1.Conversations; } });
|
|
11
|
+
var execution_logs_1 = require("./execution-logs.js");
|
|
12
|
+
Object.defineProperty(exports, "ExecutionLogs", { enumerable: true, get: function () { return execution_logs_1.ExecutionLogs; } });
|
|
11
13
|
var projects_1 = require("./projects.js");
|
|
12
14
|
Object.defineProperty(exports, "Projects", { enumerable: true, get: function () { return projects_1.Projects; } });
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "
|
|
15
|
+
var tools_1 = require("./tools.js");
|
|
16
|
+
Object.defineProperty(exports, "Tools", { enumerable: true, get: function () { return tools_1.Tools; } });
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAgBkB;AAfhB,gGAAA,MAAM,OAAA;AAgBR,oDAA6G;AAApG,6GAAA,YAAY,OAAA;AACrB,oDAMyB;AALvB,8GAAA,aAAa,OAAA;AAMf,sDAK0B;AAJxB,+GAAA,aAAa,OAAA;AAKf,0CAAoD;AAA3C,oGAAA,QAAQ,OAAA;AACjB,oCAOiB;AANf,8FAAA,KAAK,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Agents, } from "./agents.mjs";
|
|
3
3
|
export { ClientTokens } from "./client-tokens.mjs";
|
|
4
|
-
export {
|
|
4
|
+
export { Conversations, } from "./conversations.mjs";
|
|
5
|
+
export { ExecutionLogs, } from "./execution-logs.mjs";
|
|
5
6
|
export { Projects } from "./projects.mjs";
|
|
6
|
-
export {
|
|
7
|
+
export { Tools, } from "./tools.mjs";
|
|
7
8
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,GAeP;OACM,EAAE,YAAY,EAAgE;OAC9E,EACL,aAAa,GAKd;OACM,EACL,aAAa,GAId;OACM,EAAE,QAAQ,EAAgB;OAC1B,EACL,KAAK,GAMN"}
|
package/resources/projects.d.mts
CHANGED
|
@@ -16,9 +16,9 @@ export declare class Projects extends APIResource {
|
|
|
16
16
|
* This endpoint is useful for verifying your API key is valid and retrieving
|
|
17
17
|
* project details.
|
|
18
18
|
*/
|
|
19
|
-
retrieveCurrent(options?: RequestOptions): APIPromise<
|
|
19
|
+
retrieveCurrent(options?: RequestOptions): APIPromise<Project>;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface Project {
|
|
22
22
|
/**
|
|
23
23
|
* Unique identifier for the project
|
|
24
24
|
*/
|
|
@@ -34,7 +34,7 @@ export interface ProjectRetrieveCurrentResponse {
|
|
|
34
34
|
/**
|
|
35
35
|
* Organization that owns this project
|
|
36
36
|
*/
|
|
37
|
-
organization:
|
|
37
|
+
organization: Project.Organization;
|
|
38
38
|
/**
|
|
39
39
|
* ID of the organization that owns this project
|
|
40
40
|
*/
|
|
@@ -48,7 +48,7 @@ export interface ProjectRetrieveCurrentResponse {
|
|
|
48
48
|
*/
|
|
49
49
|
updatedAt: string;
|
|
50
50
|
}
|
|
51
|
-
export declare namespace
|
|
51
|
+
export declare namespace Project {
|
|
52
52
|
/**
|
|
53
53
|
* Organization that owns this project
|
|
54
54
|
*/
|
|
@@ -68,6 +68,6 @@ export declare namespace ProjectRetrieveCurrentResponse {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
export declare namespace Projects {
|
|
71
|
-
export { type
|
|
71
|
+
export { type Project as Project };
|
|
72
72
|
}
|
|
73
73
|
//# sourceMappingURL=projects.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.mts","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"projects.d.mts","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAG/D;AAED,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC;IAEnC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yBAAiB,OAAO,CAAC;IACvB;;OAEG;IACH,UAAiB,YAAY;QAC3B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,OAAO,IAAI,OAAO,EAAE,CAAC;CACpC"}
|
package/resources/projects.d.ts
CHANGED
|
@@ -16,9 +16,9 @@ export declare class Projects extends APIResource {
|
|
|
16
16
|
* This endpoint is useful for verifying your API key is valid and retrieving
|
|
17
17
|
* project details.
|
|
18
18
|
*/
|
|
19
|
-
retrieveCurrent(options?: RequestOptions): APIPromise<
|
|
19
|
+
retrieveCurrent(options?: RequestOptions): APIPromise<Project>;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface Project {
|
|
22
22
|
/**
|
|
23
23
|
* Unique identifier for the project
|
|
24
24
|
*/
|
|
@@ -34,7 +34,7 @@ export interface ProjectRetrieveCurrentResponse {
|
|
|
34
34
|
/**
|
|
35
35
|
* Organization that owns this project
|
|
36
36
|
*/
|
|
37
|
-
organization:
|
|
37
|
+
organization: Project.Organization;
|
|
38
38
|
/**
|
|
39
39
|
* ID of the organization that owns this project
|
|
40
40
|
*/
|
|
@@ -48,7 +48,7 @@ export interface ProjectRetrieveCurrentResponse {
|
|
|
48
48
|
*/
|
|
49
49
|
updatedAt: string;
|
|
50
50
|
}
|
|
51
|
-
export declare namespace
|
|
51
|
+
export declare namespace Project {
|
|
52
52
|
/**
|
|
53
53
|
* Organization that owns this project
|
|
54
54
|
*/
|
|
@@ -68,6 +68,6 @@ export declare namespace ProjectRetrieveCurrentResponse {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
export declare namespace Projects {
|
|
71
|
-
export { type
|
|
71
|
+
export { type Project as Project };
|
|
72
72
|
}
|
|
73
73
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAG/D;AAED,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC;IAEnC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yBAAiB,OAAO,CAAC;IACvB;;OAEG;IACH,UAAiB,YAAY;QAC3B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,OAAO,IAAI,OAAO,EAAE,CAAC;CACpC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
export declare class Tools extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get details of a specific tool by name.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const tool = await client.tools.retrieve('x');
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
retrieve(name: string, options?: RequestOptions): APIPromise<Tool>;
|
|
15
|
+
/**
|
|
16
|
+
* List all tools in the project with optional filtering by type and status. Tools
|
|
17
|
+
* are automatically discovered from deployments.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* // Automatically fetches more pages as needed.
|
|
22
|
+
* for await (const tool of client.tools.list()) {
|
|
23
|
+
* // ...
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
list(query?: ToolListParams | null | undefined, options?: RequestOptions): PagePromise<ToolsCursor, Tool>;
|
|
28
|
+
/**
|
|
29
|
+
* Execute a tool with the provided input parameters.
|
|
30
|
+
*
|
|
31
|
+
* **Timeout:** Tool executions have a 60-second timeout. If the tool takes longer
|
|
32
|
+
* to respond, you will receive a 504 Gateway Timeout error.
|
|
33
|
+
*
|
|
34
|
+
* **Use cases:**
|
|
35
|
+
*
|
|
36
|
+
* - Calling custom tools from your deployment
|
|
37
|
+
* - Executing utility functions
|
|
38
|
+
* - Integrating with external services via tools
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const response = await client.tools.execute('x', {
|
|
43
|
+
* input: { name: 'World', greeting: 'Hello' },
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
execute(name: string, body: ToolExecuteParams, options?: RequestOptions): APIPromise<ToolExecuteResponse>;
|
|
48
|
+
}
|
|
49
|
+
export type ToolsCursor = Cursor<Tool>;
|
|
50
|
+
export interface Tool {
|
|
51
|
+
/**
|
|
52
|
+
* Unique tool ID
|
|
53
|
+
*/
|
|
54
|
+
id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Creation timestamp
|
|
57
|
+
*/
|
|
58
|
+
createdAt: string;
|
|
59
|
+
/**
|
|
60
|
+
* User who created the tool (for managed tools)
|
|
61
|
+
*/
|
|
62
|
+
createdBy: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* Tool description
|
|
65
|
+
*/
|
|
66
|
+
description: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* When the tool was discovered
|
|
69
|
+
*/
|
|
70
|
+
discoveredAt: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Tool name
|
|
73
|
+
*/
|
|
74
|
+
name: string;
|
|
75
|
+
/**
|
|
76
|
+
* JSON Schema for agent input parameters
|
|
77
|
+
*/
|
|
78
|
+
output: Tool.Output | null;
|
|
79
|
+
/**
|
|
80
|
+
* JSON Schema for agent input parameters
|
|
81
|
+
*/
|
|
82
|
+
parameters: Tool.Parameters | null;
|
|
83
|
+
/**
|
|
84
|
+
* Project ID
|
|
85
|
+
*/
|
|
86
|
+
projectId: string;
|
|
87
|
+
/**
|
|
88
|
+
* Tool status
|
|
89
|
+
*/
|
|
90
|
+
status: 'active' | 'inactive';
|
|
91
|
+
/**
|
|
92
|
+
* Tool type: "managed" for platform-provided, or "{language}" for custom tools
|
|
93
|
+
* (e.g., "python", "typescript")
|
|
94
|
+
*/
|
|
95
|
+
type: string;
|
|
96
|
+
/**
|
|
97
|
+
* Last update timestamp
|
|
98
|
+
*/
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
}
|
|
101
|
+
export declare namespace Tool {
|
|
102
|
+
/**
|
|
103
|
+
* JSON Schema for agent input parameters
|
|
104
|
+
*/
|
|
105
|
+
interface Output {
|
|
106
|
+
type: string;
|
|
107
|
+
properties?: {
|
|
108
|
+
[key: string]: unknown;
|
|
109
|
+
};
|
|
110
|
+
required?: Array<string>;
|
|
111
|
+
[k: string]: unknown;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* JSON Schema for agent input parameters
|
|
115
|
+
*/
|
|
116
|
+
interface Parameters {
|
|
117
|
+
type: string;
|
|
118
|
+
properties?: {
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
};
|
|
121
|
+
required?: Array<string>;
|
|
122
|
+
[k: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
export interface ToolExecuteResponse {
|
|
126
|
+
/**
|
|
127
|
+
* Output from the tool execution.
|
|
128
|
+
*/
|
|
129
|
+
output?: unknown;
|
|
130
|
+
}
|
|
131
|
+
export interface ToolListParams extends CursorParams {
|
|
132
|
+
/**
|
|
133
|
+
* Filter by tool status
|
|
134
|
+
*/
|
|
135
|
+
status?: 'active' | 'inactive';
|
|
136
|
+
/**
|
|
137
|
+
* Filter by tool type (python, typescript)
|
|
138
|
+
*/
|
|
139
|
+
type?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface ToolExecuteParams {
|
|
142
|
+
/**
|
|
143
|
+
* Input parameters for the tool. Structure depends on tool definition.
|
|
144
|
+
*/
|
|
145
|
+
input: {
|
|
146
|
+
[key: string]: unknown;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export declare namespace Tools {
|
|
150
|
+
export { type Tool as Tool, type ToolExecuteResponse as ToolExecuteResponse, type ToolsCursor as ToolsCursor, type ToolListParams as ToolListParams, type ToolExecuteParams as ToolExecuteParams, };
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=tools.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.mts","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
export declare class Tools extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get details of a specific tool by name.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const tool = await client.tools.retrieve('x');
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
retrieve(name: string, options?: RequestOptions): APIPromise<Tool>;
|
|
15
|
+
/**
|
|
16
|
+
* List all tools in the project with optional filtering by type and status. Tools
|
|
17
|
+
* are automatically discovered from deployments.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* // Automatically fetches more pages as needed.
|
|
22
|
+
* for await (const tool of client.tools.list()) {
|
|
23
|
+
* // ...
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
list(query?: ToolListParams | null | undefined, options?: RequestOptions): PagePromise<ToolsCursor, Tool>;
|
|
28
|
+
/**
|
|
29
|
+
* Execute a tool with the provided input parameters.
|
|
30
|
+
*
|
|
31
|
+
* **Timeout:** Tool executions have a 60-second timeout. If the tool takes longer
|
|
32
|
+
* to respond, you will receive a 504 Gateway Timeout error.
|
|
33
|
+
*
|
|
34
|
+
* **Use cases:**
|
|
35
|
+
*
|
|
36
|
+
* - Calling custom tools from your deployment
|
|
37
|
+
* - Executing utility functions
|
|
38
|
+
* - Integrating with external services via tools
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const response = await client.tools.execute('x', {
|
|
43
|
+
* input: { name: 'World', greeting: 'Hello' },
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
execute(name: string, body: ToolExecuteParams, options?: RequestOptions): APIPromise<ToolExecuteResponse>;
|
|
48
|
+
}
|
|
49
|
+
export type ToolsCursor = Cursor<Tool>;
|
|
50
|
+
export interface Tool {
|
|
51
|
+
/**
|
|
52
|
+
* Unique tool ID
|
|
53
|
+
*/
|
|
54
|
+
id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Creation timestamp
|
|
57
|
+
*/
|
|
58
|
+
createdAt: string;
|
|
59
|
+
/**
|
|
60
|
+
* User who created the tool (for managed tools)
|
|
61
|
+
*/
|
|
62
|
+
createdBy: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* Tool description
|
|
65
|
+
*/
|
|
66
|
+
description: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* When the tool was discovered
|
|
69
|
+
*/
|
|
70
|
+
discoveredAt: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Tool name
|
|
73
|
+
*/
|
|
74
|
+
name: string;
|
|
75
|
+
/**
|
|
76
|
+
* JSON Schema for agent input parameters
|
|
77
|
+
*/
|
|
78
|
+
output: Tool.Output | null;
|
|
79
|
+
/**
|
|
80
|
+
* JSON Schema for agent input parameters
|
|
81
|
+
*/
|
|
82
|
+
parameters: Tool.Parameters | null;
|
|
83
|
+
/**
|
|
84
|
+
* Project ID
|
|
85
|
+
*/
|
|
86
|
+
projectId: string;
|
|
87
|
+
/**
|
|
88
|
+
* Tool status
|
|
89
|
+
*/
|
|
90
|
+
status: 'active' | 'inactive';
|
|
91
|
+
/**
|
|
92
|
+
* Tool type: "managed" for platform-provided, or "{language}" for custom tools
|
|
93
|
+
* (e.g., "python", "typescript")
|
|
94
|
+
*/
|
|
95
|
+
type: string;
|
|
96
|
+
/**
|
|
97
|
+
* Last update timestamp
|
|
98
|
+
*/
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
}
|
|
101
|
+
export declare namespace Tool {
|
|
102
|
+
/**
|
|
103
|
+
* JSON Schema for agent input parameters
|
|
104
|
+
*/
|
|
105
|
+
interface Output {
|
|
106
|
+
type: string;
|
|
107
|
+
properties?: {
|
|
108
|
+
[key: string]: unknown;
|
|
109
|
+
};
|
|
110
|
+
required?: Array<string>;
|
|
111
|
+
[k: string]: unknown;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* JSON Schema for agent input parameters
|
|
115
|
+
*/
|
|
116
|
+
interface Parameters {
|
|
117
|
+
type: string;
|
|
118
|
+
properties?: {
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
};
|
|
121
|
+
required?: Array<string>;
|
|
122
|
+
[k: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
export interface ToolExecuteResponse {
|
|
126
|
+
/**
|
|
127
|
+
* Output from the tool execution.
|
|
128
|
+
*/
|
|
129
|
+
output?: unknown;
|
|
130
|
+
}
|
|
131
|
+
export interface ToolListParams extends CursorParams {
|
|
132
|
+
/**
|
|
133
|
+
* Filter by tool status
|
|
134
|
+
*/
|
|
135
|
+
status?: 'active' | 'inactive';
|
|
136
|
+
/**
|
|
137
|
+
* Filter by tool type (python, typescript)
|
|
138
|
+
*/
|
|
139
|
+
type?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface ToolExecuteParams {
|
|
142
|
+
/**
|
|
143
|
+
* Input parameters for the tool. Structure depends on tool definition.
|
|
144
|
+
*/
|
|
145
|
+
input: {
|
|
146
|
+
[key: string]: unknown;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export declare namespace Tools {
|
|
150
|
+
export { type Tool as Tool, type ToolExecuteResponse as ToolExecuteResponse, type ToolsCursor as ToolsCursor, type ToolListParams as ToolListParams, type ToolExecuteParams as ToolExecuteParams, };
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Tools = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
class Tools extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get details of a specific tool by name.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const tool = await client.tools.retrieve('x');
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
retrieve(name, options) {
|
|
18
|
+
return this._client.get((0, path_1.path) `/tools/${name}`, options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* List all tools in the project with optional filtering by type and status. Tools
|
|
22
|
+
* are automatically discovered from deployments.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* // Automatically fetches more pages as needed.
|
|
27
|
+
* for await (const tool of client.tools.list()) {
|
|
28
|
+
* // ...
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(query = {}, options) {
|
|
33
|
+
return this._client.getAPIList('/tools', (pagination_1.Cursor), { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Execute a tool with the provided input parameters.
|
|
37
|
+
*
|
|
38
|
+
* **Timeout:** Tool executions have a 60-second timeout. If the tool takes longer
|
|
39
|
+
* to respond, you will receive a 504 Gateway Timeout error.
|
|
40
|
+
*
|
|
41
|
+
* **Use cases:**
|
|
42
|
+
*
|
|
43
|
+
* - Calling custom tools from your deployment
|
|
44
|
+
* - Executing utility functions
|
|
45
|
+
* - Integrating with external services via tools
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const response = await client.tools.execute('x', {
|
|
50
|
+
* input: { name: 'World', greeting: 'Hello' },
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
execute(name, body, options) {
|
|
55
|
+
return this._client.post((0, path_1.path) `/tools/${name}/execute`, { body, ...options });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Tools = Tools;
|
|
59
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAE5E,oDAA8C;AAE9C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAY,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,UAAU,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAA,mBAAY,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,IAAY,EAAE,IAAuB,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,UAAU,IAAI,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAtDD,sBAsDC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../core/pagination.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
export class Tools extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get details of a specific tool by name.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const tool = await client.tools.retrieve('x');
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
retrieve(name, options) {
|
|
15
|
+
return this._client.get(path `/tools/${name}`, options);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* List all tools in the project with optional filtering by type and status. Tools
|
|
19
|
+
* are automatically discovered from deployments.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* // Automatically fetches more pages as needed.
|
|
24
|
+
* for await (const tool of client.tools.list()) {
|
|
25
|
+
* // ...
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
list(query = {}, options) {
|
|
30
|
+
return this._client.getAPIList('/tools', (Cursor), { query, ...options });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Execute a tool with the provided input parameters.
|
|
34
|
+
*
|
|
35
|
+
* **Timeout:** Tool executions have a 60-second timeout. If the tool takes longer
|
|
36
|
+
* to respond, you will receive a 504 Gateway Timeout error.
|
|
37
|
+
*
|
|
38
|
+
* **Use cases:**
|
|
39
|
+
*
|
|
40
|
+
* - Calling custom tools from your deployment
|
|
41
|
+
* - Executing utility functions
|
|
42
|
+
* - Integrating with external services via tools
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const response = await client.tools.execute('x', {
|
|
47
|
+
* input: { name: 'World', greeting: 'Hello' },
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
execute(name, body, options) {
|
|
52
|
+
return this._client.post(path `/tools/${name}/execute`, { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=tools.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.mjs","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAY,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,UAAU,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAA,MAAY,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,IAAY,EAAE,IAAuB,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,UAAU,IAAI,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
|