@agent-os-sdk/client 0.6.0 → 0.7.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 +50 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -28
- package/package.json +1 -1
- package/src/index.ts +84 -29
package/dist/index.d.ts
CHANGED
|
@@ -1,42 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent OS SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Two APIs available:
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* 1. AUTO-GENERATED (openapi-fetch) - Types + endpoints 100% from Swagger
|
|
7
|
+
* 2. CUSTOM CLIENT (AgentOsClient) - Ergonomic wrapper with auth, modules, etc.
|
|
8
|
+
*
|
|
9
|
+
* @example Auto-Generated (new, recommended for typed endpoints)
|
|
7
10
|
* ```ts
|
|
8
|
-
* import { createClient, type paths, type
|
|
11
|
+
* import { createClient, type paths, type Schema } from "@agent-os-sdk/client";
|
|
9
12
|
*
|
|
10
|
-
* const
|
|
13
|
+
* const api = createClient({
|
|
11
14
|
* baseUrl: "https://api.example.com",
|
|
12
|
-
* headers: {
|
|
13
|
-
* Authorization: `Bearer ${token}`,
|
|
14
|
-
* "X-Workspace-Id": workspaceId,
|
|
15
|
-
* }
|
|
15
|
+
* headers: { Authorization: `Bearer ${token}` }
|
|
16
16
|
* });
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* const { data: agent } = await client.GET("/v1/api/agents/{id}", {
|
|
21
|
-
* params: { path: { id: "uuid" } }
|
|
18
|
+
* const { data } = await api.POST("/v1/api/graph/commit", {
|
|
19
|
+
* body: { agent_id: "...", graph_spec: {...} }
|
|
22
20
|
* });
|
|
21
|
+
* ```
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* }
|
|
23
|
+
* @example Custom Client (existing, has auth + ergonomic modules)
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { AgentOsClient } from "@agent-os-sdk/client";
|
|
26
|
+
*
|
|
27
|
+
* const client = new AgentOsClient({
|
|
28
|
+
* baseUrl: "https://api.example.com",
|
|
29
|
+
* auth: { type: "jwt", getToken: () => token, getWorkspaceId: () => wsId }
|
|
31
30
|
* });
|
|
32
31
|
*
|
|
33
|
-
*
|
|
34
|
-
* type Agent = Schema<"AgentResponse">;
|
|
35
|
-
* type GraphSpec = Schema<"CommitGraphSpecRequest">;
|
|
32
|
+
* const { data } = await client.graphs.commit({ agent_id: "...", graph_spec: {...} });
|
|
36
33
|
* ```
|
|
37
34
|
*/
|
|
38
|
-
export { createClient, type AgentOsClient, type ClientOptions, type Schema } from "./generated/client.js";
|
|
35
|
+
export { createClient, type AgentOsClient as GeneratedClient, type ClientOptions, type Schema } from "./generated/client.js";
|
|
39
36
|
export type { paths, components } from "./generated/openapi.js";
|
|
40
|
-
export { AgentOsClient
|
|
41
|
-
export {
|
|
37
|
+
export { AgentOsClient } from "./client/AgentOsClient.js";
|
|
38
|
+
export type { AgentOsClientOptions, AuthProvider } from "./client/auth.js";
|
|
39
|
+
export { AgentOsError, NetworkError, TimeoutError, ValidationError, UnauthorizedError, ForbiddenError, NotFoundError, ConflictError, RateLimitError, ServerError, isAuthError, isRetryableError, } from "./errors/index.js";
|
|
40
|
+
export { withRetry } from "./client/retry.js";
|
|
41
|
+
export { paginate, collectAll, getFirst } from "./client/pagination.js";
|
|
42
|
+
export type CommitGraphSpecRequest = import("./generated/openapi.js").components["schemas"]["CommitGraphSpecRequest"];
|
|
43
|
+
export type CommitGraphSpecResponse = import("./generated/openapi.js").components["schemas"]["CommitGraphSpecResponse"];
|
|
44
|
+
export type GetGraphSpecResponse = import("./generated/openapi.js").components["schemas"]["GetGraphSpecResponse"];
|
|
45
|
+
export type { Agent } from "./modules/agents.js";
|
|
46
|
+
export type { RunEvent, RunEventDto, FollowEvent, FollowOptions } from "./modules/runs.js";
|
|
47
|
+
export type { Thread, ThreadMessage, ThreadState } from "./modules/threads.js";
|
|
48
|
+
export type { Trigger } from "./modules/triggers.js";
|
|
49
|
+
export type { Credential } from "./modules/credentials.js";
|
|
50
|
+
export type { BuilderChatRequest, BuilderChatResponse, BuilderStreamEvent, GraphUpdateAction } from "./modules/builder.js";
|
|
51
|
+
export type { Member, Role } from "./modules/members.js";
|
|
52
|
+
export type { Workspace } from "./modules/workspaces.js";
|
|
53
|
+
export type { Tenant } from "./modules/tenants.js";
|
|
54
|
+
export type { StoredFile } from "./modules/files.js";
|
|
55
|
+
export type { EvalDataset, Experiment } from "./modules/evaluation.js";
|
|
56
|
+
export type { Prompt } from "./modules/prompts.js";
|
|
57
|
+
export type { Trace, Span } from "./modules/traces.js";
|
|
58
|
+
export type { CronJob } from "./modules/crons.js";
|
|
59
|
+
export type { DlqMessage } from "./modules/dlq.js";
|
|
60
|
+
export type { VectorStore } from "./modules/vectorStores.js";
|
|
61
|
+
export type { AuditLogEntry } from "./modules/audit.js";
|
|
62
|
+
export type { ServerCapabilities } from "./modules/info.js";
|
|
63
|
+
export type { Checkpoint } from "./modules/checkpoints.js";
|
|
64
|
+
export type { Tool } from "./modules/tools.js";
|
|
65
|
+
export type { SSEEvent, SSEOptions } from "./sse/client.js";
|
|
66
|
+
export type { APIResponse } from "./client/raw.js";
|
|
42
67
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAMH,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,IAAI,eAAe,EAA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kB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC3H,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACvE,YAAY,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,YAAY,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,48 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent OS SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Two APIs available:
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* 1. AUTO-GENERATED (openapi-fetch) - Types + endpoints 100% from Swagger
|
|
7
|
+
* 2. CUSTOM CLIENT (AgentOsClient) - Ergonomic wrapper with auth, modules, etc.
|
|
8
|
+
*
|
|
9
|
+
* @example Auto-Generated (new, recommended for typed endpoints)
|
|
7
10
|
* ```ts
|
|
8
|
-
* import { createClient, type paths, type
|
|
11
|
+
* import { createClient, type paths, type Schema } from "@agent-os-sdk/client";
|
|
9
12
|
*
|
|
10
|
-
* const
|
|
13
|
+
* const api = createClient({
|
|
11
14
|
* baseUrl: "https://api.example.com",
|
|
12
|
-
* headers: {
|
|
13
|
-
* Authorization: `Bearer ${token}`,
|
|
14
|
-
* "X-Workspace-Id": workspaceId,
|
|
15
|
-
* }
|
|
15
|
+
* headers: { Authorization: `Bearer ${token}` }
|
|
16
16
|
* });
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* const { data: agent } = await client.GET("/v1/api/agents/{id}", {
|
|
21
|
-
* params: { path: { id: "uuid" } }
|
|
18
|
+
* const { data } = await api.POST("/v1/api/graph/commit", {
|
|
19
|
+
* body: { agent_id: "...", graph_spec: {...} }
|
|
22
20
|
* });
|
|
21
|
+
* ```
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* }
|
|
23
|
+
* @example Custom Client (existing, has auth + ergonomic modules)
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { AgentOsClient } from "@agent-os-sdk/client";
|
|
26
|
+
*
|
|
27
|
+
* const client = new AgentOsClient({
|
|
28
|
+
* baseUrl: "https://api.example.com",
|
|
29
|
+
* auth: { type: "jwt", getToken: () => token, getWorkspaceId: () => wsId }
|
|
31
30
|
* });
|
|
32
31
|
*
|
|
33
|
-
*
|
|
34
|
-
* type Agent = Schema<"AgentResponse">;
|
|
35
|
-
* type GraphSpec = Schema<"CommitGraphSpecRequest">;
|
|
32
|
+
* const { data } = await client.graphs.commit({ agent_id: "...", graph_spec: {...} });
|
|
36
33
|
* ```
|
|
37
34
|
*/
|
|
38
35
|
// ============================================================
|
|
39
|
-
// AUTO-GENERATED CLIENT -
|
|
36
|
+
// 1. AUTO-GENERATED CLIENT (openapi-fetch)
|
|
40
37
|
// ============================================================
|
|
41
38
|
export { createClient } from "./generated/client.js";
|
|
42
39
|
// ============================================================
|
|
43
|
-
//
|
|
40
|
+
// 2. CUSTOM CLIENT (AgentOsClient with modules)
|
|
41
|
+
// ============================================================
|
|
42
|
+
export { AgentOsClient } from "./client/AgentOsClient.js";
|
|
43
|
+
// ============================================================
|
|
44
|
+
// Errors
|
|
45
|
+
// ============================================================
|
|
46
|
+
export { AgentOsError, NetworkError, TimeoutError, ValidationError, UnauthorizedError, ForbiddenError, NotFoundError, ConflictError, RateLimitError, ServerError, isAuthError, isRetryableError, } from "./errors/index.js";
|
|
47
|
+
// ============================================================
|
|
48
|
+
// Utilities
|
|
44
49
|
// ============================================================
|
|
45
|
-
|
|
46
|
-
export {
|
|
47
|
-
// Legacy error types
|
|
48
|
-
export { AgentOsError } from "./errors/index.js";
|
|
50
|
+
export { withRetry } from "./client/retry.js";
|
|
51
|
+
export { paginate, collectAll, getFirst } from "./client/pagination.js";
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,54 +1,109 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent OS SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Two APIs available:
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* 1. AUTO-GENERATED (openapi-fetch) - Types + endpoints 100% from Swagger
|
|
7
|
+
* 2. CUSTOM CLIENT (AgentOsClient) - Ergonomic wrapper with auth, modules, etc.
|
|
8
|
+
*
|
|
9
|
+
* @example Auto-Generated (new, recommended for typed endpoints)
|
|
7
10
|
* ```ts
|
|
8
|
-
* import { createClient, type paths, type
|
|
11
|
+
* import { createClient, type paths, type Schema } from "@agent-os-sdk/client";
|
|
9
12
|
*
|
|
10
|
-
* const
|
|
13
|
+
* const api = createClient({
|
|
11
14
|
* baseUrl: "https://api.example.com",
|
|
12
|
-
* headers: {
|
|
13
|
-
* Authorization: `Bearer ${token}`,
|
|
14
|
-
* "X-Workspace-Id": workspaceId,
|
|
15
|
-
* }
|
|
15
|
+
* headers: { Authorization: `Bearer ${token}` }
|
|
16
16
|
* });
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* const { data: agent } = await client.GET("/v1/api/agents/{id}", {
|
|
21
|
-
* params: { path: { id: "uuid" } }
|
|
18
|
+
* const { data } = await api.POST("/v1/api/graph/commit", {
|
|
19
|
+
* body: { agent_id: "...", graph_spec: {...} }
|
|
22
20
|
* });
|
|
21
|
+
* ```
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* }
|
|
23
|
+
* @example Custom Client (existing, has auth + ergonomic modules)
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { AgentOsClient } from "@agent-os-sdk/client";
|
|
26
|
+
*
|
|
27
|
+
* const client = new AgentOsClient({
|
|
28
|
+
* baseUrl: "https://api.example.com",
|
|
29
|
+
* auth: { type: "jwt", getToken: () => token, getWorkspaceId: () => wsId }
|
|
31
30
|
* });
|
|
32
31
|
*
|
|
33
|
-
*
|
|
34
|
-
* type Agent = Schema<"AgentResponse">;
|
|
35
|
-
* type GraphSpec = Schema<"CommitGraphSpecRequest">;
|
|
32
|
+
* const { data } = await client.graphs.commit({ agent_id: "...", graph_spec: {...} });
|
|
36
33
|
* ```
|
|
37
34
|
*/
|
|
38
35
|
|
|
39
36
|
// ============================================================
|
|
40
|
-
// AUTO-GENERATED CLIENT -
|
|
37
|
+
// 1. AUTO-GENERATED CLIENT (openapi-fetch)
|
|
41
38
|
// ============================================================
|
|
42
39
|
|
|
43
|
-
export { createClient, type AgentOsClient, type ClientOptions, type Schema } from "./generated/client.js";
|
|
40
|
+
export { createClient, type AgentOsClient as GeneratedClient, type ClientOptions, type Schema } from "./generated/client.js";
|
|
44
41
|
export type { paths, components } from "./generated/openapi.js";
|
|
45
42
|
|
|
46
43
|
// ============================================================
|
|
47
|
-
//
|
|
44
|
+
// 2. CUSTOM CLIENT (AgentOsClient with modules)
|
|
45
|
+
// ============================================================
|
|
46
|
+
|
|
47
|
+
export { AgentOsClient } from "./client/AgentOsClient.js";
|
|
48
|
+
export type { AgentOsClientOptions, AuthProvider } from "./client/auth.js";
|
|
49
|
+
|
|
50
|
+
// ============================================================
|
|
51
|
+
// Errors
|
|
52
|
+
// ============================================================
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
AgentOsError,
|
|
56
|
+
NetworkError,
|
|
57
|
+
TimeoutError,
|
|
58
|
+
ValidationError,
|
|
59
|
+
UnauthorizedError,
|
|
60
|
+
ForbiddenError,
|
|
61
|
+
NotFoundError,
|
|
62
|
+
ConflictError,
|
|
63
|
+
RateLimitError,
|
|
64
|
+
ServerError,
|
|
65
|
+
isAuthError,
|
|
66
|
+
isRetryableError,
|
|
67
|
+
} from "./errors/index.js";
|
|
68
|
+
|
|
69
|
+
// ============================================================
|
|
70
|
+
// Utilities
|
|
71
|
+
// ============================================================
|
|
72
|
+
|
|
73
|
+
export { withRetry } from "./client/retry.js";
|
|
74
|
+
export { paginate, collectAll, getFirst } from "./client/pagination.js";
|
|
75
|
+
|
|
76
|
+
// ============================================================
|
|
77
|
+
// OpenAPI Types (use these for type-safe API calls)
|
|
48
78
|
// ============================================================
|
|
49
79
|
|
|
50
|
-
|
|
51
|
-
export
|
|
80
|
+
export type CommitGraphSpecRequest = import("./generated/openapi.js").components["schemas"]["CommitGraphSpecRequest"];
|
|
81
|
+
export type CommitGraphSpecResponse = import("./generated/openapi.js").components["schemas"]["CommitGraphSpecResponse"];
|
|
82
|
+
export type GetGraphSpecResponse = import("./generated/openapi.js").components["schemas"]["GetGraphSpecResponse"];
|
|
83
|
+
|
|
84
|
+
// ============================================================
|
|
85
|
+
// Module Types (legacy - from manual modules)
|
|
86
|
+
// ============================================================
|
|
52
87
|
|
|
53
|
-
|
|
54
|
-
export {
|
|
88
|
+
export type { Agent } from "./modules/agents.js";
|
|
89
|
+
export type { RunEvent, RunEventDto, FollowEvent, FollowOptions } from "./modules/runs.js";
|
|
90
|
+
export type { Thread, ThreadMessage, ThreadState } from "./modules/threads.js";
|
|
91
|
+
export type { Trigger } from "./modules/triggers.js";
|
|
92
|
+
export type { Credential } from "./modules/credentials.js";
|
|
93
|
+
export type { BuilderChatRequest, BuilderChatResponse, BuilderStreamEvent, GraphUpdateAction } from "./modules/builder.js";
|
|
94
|
+
export type { Member, Role } from "./modules/members.js";
|
|
95
|
+
export type { Workspace } from "./modules/workspaces.js";
|
|
96
|
+
export type { Tenant } from "./modules/tenants.js";
|
|
97
|
+
export type { StoredFile } from "./modules/files.js";
|
|
98
|
+
export type { EvalDataset, Experiment } from "./modules/evaluation.js";
|
|
99
|
+
export type { Prompt } from "./modules/prompts.js";
|
|
100
|
+
export type { Trace, Span } from "./modules/traces.js";
|
|
101
|
+
export type { CronJob } from "./modules/crons.js";
|
|
102
|
+
export type { DlqMessage } from "./modules/dlq.js";
|
|
103
|
+
export type { VectorStore } from "./modules/vectorStores.js";
|
|
104
|
+
export type { AuditLogEntry } from "./modules/audit.js";
|
|
105
|
+
export type { ServerCapabilities } from "./modules/info.js";
|
|
106
|
+
export type { Checkpoint } from "./modules/checkpoints.js";
|
|
107
|
+
export type { Tool } from "./modules/tools.js";
|
|
108
|
+
export type { SSEEvent, SSEOptions } from "./sse/client.js";
|
|
109
|
+
export type { APIResponse } from "./client/raw.js";
|