@agent-os-sdk/client 0.5.3 → 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/generated/client.d.ts +20 -0
- package/dist/generated/client.d.ts.map +1 -0
- package/dist/generated/client.js +15 -0
- package/dist/index.d.ts +55 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -105
- package/package.json +1 -1
- package/src/generated/client.ts +32 -0
- package/src/index.ts +90 -192
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent OS SDK - 100% Auto-Generated Client
|
|
3
|
+
*
|
|
4
|
+
* This client is fully generated from the OpenAPI specification.
|
|
5
|
+
* NO manual types, NO manual endpoints - everything comes from swagger.json.
|
|
6
|
+
*/
|
|
7
|
+
export type { paths, components } from "./openapi.js";
|
|
8
|
+
import { type ClientOptions as OpenapiClientOptions } from "openapi-fetch";
|
|
9
|
+
import type { paths } from "./openapi.js";
|
|
10
|
+
export type ClientOptions = OpenapiClientOptions & {
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Create a fully typed API client.
|
|
15
|
+
* All endpoints and types are auto-generated from OpenAPI spec.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createClient(options: ClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
18
|
+
export type AgentOsClient = ReturnType<typeof createClient>;
|
|
19
|
+
export type Schema<T extends keyof import("./openapi.js").components["schemas"]> = import("./openapi.js").components["schemas"][T];
|
|
20
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/generated/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAsB,EAAE,KAAK,aAAa,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,gEAElD;AAGD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAG5D,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,OAAO,cAAc,EAAE,UAAU,CAAC,SAAS,CAAC,IAC3E,OAAO,cAAc,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent OS SDK - 100% Auto-Generated Client
|
|
3
|
+
*
|
|
4
|
+
* This client is fully generated from the OpenAPI specification.
|
|
5
|
+
* NO manual types, NO manual endpoints - everything comes from swagger.json.
|
|
6
|
+
*/
|
|
7
|
+
// Re-export openapi-fetch createClient
|
|
8
|
+
import _createClient, {} from "openapi-fetch";
|
|
9
|
+
/**
|
|
10
|
+
* Create a fully typed API client.
|
|
11
|
+
* All endpoints and types are auto-generated from OpenAPI spec.
|
|
12
|
+
*/
|
|
13
|
+
export function createClient(options) {
|
|
14
|
+
return _createClient(options);
|
|
15
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,83 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent OS SDK
|
|
2
|
+
* Agent OS SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* All API calls are fully typed from OpenAPI specification.
|
|
4
|
+
* Two APIs available:
|
|
6
5
|
*
|
|
7
|
-
*
|
|
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)
|
|
8
10
|
* ```ts
|
|
9
|
-
* import {
|
|
11
|
+
* import { createClient, type paths, type Schema } from "@agent-os-sdk/client";
|
|
12
|
+
*
|
|
13
|
+
* const api = createClient({
|
|
14
|
+
* baseUrl: "https://api.example.com",
|
|
15
|
+
* headers: { Authorization: `Bearer ${token}` }
|
|
16
|
+
* });
|
|
10
17
|
*
|
|
11
|
-
* const
|
|
12
|
-
*
|
|
13
|
-
* tenantId: auth.tenantId,
|
|
14
|
-
* workspaceId: auth.workspaceId,
|
|
15
|
-
* token: auth.token,
|
|
18
|
+
* const { data } = await api.POST("/v1/api/graph/commit", {
|
|
19
|
+
* body: { agent_id: "...", graph_spec: {...} }
|
|
16
20
|
* });
|
|
21
|
+
* ```
|
|
17
22
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* data.items.forEach(agent => console.log(agent.name));
|
|
22
|
-
* }
|
|
23
|
+
* @example Custom Client (existing, has auth + ergonomic modules)
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { AgentOsClient } from "@agent-os-sdk/client";
|
|
23
26
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* const client = new AgentOsClient({
|
|
28
|
+
* baseUrl: "https://api.example.com",
|
|
29
|
+
* auth: { type: "jwt", getToken: () => token, getWorkspaceId: () => wsId }
|
|
30
|
+
* });
|
|
27
31
|
*
|
|
28
|
-
*
|
|
29
|
-
* for await (const event of api.runs.createAndStream({
|
|
30
|
-
* agent_id: "...",
|
|
31
|
-
* input: { message: "Hello" },
|
|
32
|
-
* })) {
|
|
33
|
-
* console.log(event);
|
|
34
|
-
* }
|
|
32
|
+
* const { data } = await client.graphs.commit({ agent_id: "...", graph_spec: {...} });
|
|
35
33
|
* ```
|
|
36
34
|
*/
|
|
37
|
-
export { AgentOsClient, type
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export type {
|
|
48
|
-
export {
|
|
49
|
-
export
|
|
50
|
-
export
|
|
51
|
-
export
|
|
52
|
-
export {
|
|
53
|
-
export
|
|
54
|
-
export {
|
|
55
|
-
export
|
|
56
|
-
export
|
|
57
|
-
export {
|
|
58
|
-
export
|
|
59
|
-
export
|
|
60
|
-
export
|
|
61
|
-
export
|
|
62
|
-
export
|
|
63
|
-
export
|
|
64
|
-
export
|
|
65
|
-
export
|
|
66
|
-
export
|
|
67
|
-
export
|
|
68
|
-
export
|
|
69
|
-
export { McpModule, type McpServer } from "./modules/mcp.js";
|
|
70
|
-
export { MeModule, type MeResponse } from "./modules/me.js";
|
|
71
|
-
export { MetricsModule, type MetricsResponse } from "./modules/metrics.js";
|
|
72
|
-
export { PlaygroundModule, type PlaygroundSession } from "./modules/playground.js";
|
|
73
|
-
export { PromptsModule, type Prompt, type PromptListResponse, type PromptVersion } from "./modules/prompts.js";
|
|
74
|
-
export { StoreModule, type StoreValue } from "./modules/store.js";
|
|
75
|
-
export { TracesModule, type FeedbackRequest, type Span, type SpanData, type Trace, type TraceListResponse } from "./modules/traces.js";
|
|
76
|
-
export { UsageModule, type UsageQuota, type UsageResponse } from "./modules/usage.js";
|
|
77
|
-
export { VectorStoresModule, type VectorQueryResult, type VectorStore, type VectorStoreListResponse } from "./modules/vectorStores.js";
|
|
78
|
-
export { ApprovalsModule, type Approval, type ApprovalDecision, type ApprovalListResponse, type ApprovalStatus, type ApprovalStatusResponse } from "./modules/approvals.js";
|
|
79
|
-
export { ApiTokensModule, type ApiToken, type ApiTokenSecret, type CreateTokenRequest, type RotateTokenResponse } from "./modules/apiTokens.js";
|
|
80
|
-
export { MembershipsModule, type EnsureMembershipRequest, type MembershipResponse } from "./modules/memberships.js";
|
|
81
|
-
export { parseSSE, streamSSE, type RunSSEEvent, type RunStreamEvent, type SSEEvent, type SSEOptions, type RunEventDto as SSERunEventDto } from "./sse/client.js";
|
|
82
|
-
export type { AddMessageRequest, AgentBundle, Agent as AgentSchema, BatchRunResponse, CancelRunResponse, CheckpointDetail, CheckpointListResponse, CreateAgentRequest, CreateCredentialRequest, CreateCronJobRequest, CreateDatasetRequest, CreateExperimentRequest, CreatePresignedUploadRequest, CreatePromptRequest, CreatePromptVersionRequest, InviteMemberRequest, PresignedUploadResponse, ProblemDetails, ReplayRequest, RunDetailResponse, RunResponse, ThreadRequest, ThreadSearchRequest, UpdateAgentRequest, UpdateCredentialRequest, UpdateCronJobRequest, UpdateMemberRequest, VectorQueryRequest, VectorQueryResponse, VectorStoreResponse, WaitRunResponse } from "./client/raw.js";
|
|
35
|
+
export { createClient, type AgentOsClient as GeneratedClient, type ClientOptions, type Schema } from "./generated/client.js";
|
|
36
|
+
export type { paths, components } from "./generated/openapi.js";
|
|
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";
|
|
83
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,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7H,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMhE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAM3E,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,gBAAgB,GACnB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAMxE,MAAM,MAAM,sBAAsB,GAAG,OAAO,wBAAwB,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,wBAAwB,CAAC,CAAC;AACtH,MAAM,MAAM,uBAAuB,GAAG,OAAO,wBAAwB,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,yBAAyB,CAAC,CAAC;AACxH,MAAM,MAAM,oBAAoB,GAAG,OAAO,wBAAwB,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAMlH,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3F,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/E,YAAY,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,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,117 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent OS SDK
|
|
2
|
+
* Agent OS SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* All API calls are fully typed from OpenAPI specification.
|
|
4
|
+
* Two APIs available:
|
|
6
5
|
*
|
|
7
|
-
*
|
|
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)
|
|
8
10
|
* ```ts
|
|
9
|
-
* import {
|
|
11
|
+
* import { createClient, type paths, type Schema } from "@agent-os-sdk/client";
|
|
12
|
+
*
|
|
13
|
+
* const api = createClient({
|
|
14
|
+
* baseUrl: "https://api.example.com",
|
|
15
|
+
* headers: { Authorization: `Bearer ${token}` }
|
|
16
|
+
* });
|
|
10
17
|
*
|
|
11
|
-
* const
|
|
12
|
-
*
|
|
13
|
-
* tenantId: auth.tenantId,
|
|
14
|
-
* workspaceId: auth.workspaceId,
|
|
15
|
-
* token: auth.token,
|
|
18
|
+
* const { data } = await api.POST("/v1/api/graph/commit", {
|
|
19
|
+
* body: { agent_id: "...", graph_spec: {...} }
|
|
16
20
|
* });
|
|
21
|
+
* ```
|
|
17
22
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* data.items.forEach(agent => console.log(agent.name));
|
|
22
|
-
* }
|
|
23
|
+
* @example Custom Client (existing, has auth + ergonomic modules)
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { AgentOsClient } from "@agent-os-sdk/client";
|
|
23
26
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* const client = new AgentOsClient({
|
|
28
|
+
* baseUrl: "https://api.example.com",
|
|
29
|
+
* auth: { type: "jwt", getToken: () => token, getWorkspaceId: () => wsId }
|
|
30
|
+
* });
|
|
27
31
|
*
|
|
28
|
-
*
|
|
29
|
-
* for await (const event of api.runs.createAndStream({
|
|
30
|
-
* agent_id: "...",
|
|
31
|
-
* input: { message: "Hello" },
|
|
32
|
-
* })) {
|
|
33
|
-
* console.log(event);
|
|
34
|
-
* }
|
|
32
|
+
* const { data } = await client.graphs.commit({ agent_id: "...", graph_spec: {...} });
|
|
35
33
|
* ```
|
|
36
34
|
*/
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
35
|
+
// ============================================================
|
|
36
|
+
// 1. AUTO-GENERATED CLIENT (openapi-fetch)
|
|
37
|
+
// ============================================================
|
|
38
|
+
export { createClient } from "./generated/client.js";
|
|
39
|
+
// ============================================================
|
|
40
|
+
// 2. CUSTOM CLIENT (AgentOsClient with modules)
|
|
41
|
+
// ============================================================
|
|
40
42
|
export { AgentOsClient } from "./client/AgentOsClient.js";
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
// Base class
|
|
52
|
-
AgentOsError, ConflictError, ForbiddenError, NetworkError, NotFoundError, RateLimitError, ServerError, TimeoutError,
|
|
53
|
-
// Error classes
|
|
54
|
-
UnauthorizedError, ValidationError,
|
|
55
|
-
// Type guards
|
|
56
|
-
isAgentOsError, isAuthError, isClientError, isRetryableError, isServerError } from "./errors/index.js";
|
|
57
|
-
export { createErrorFromResponse } from "./errors/factory.js";
|
|
58
|
-
// ============================================================================
|
|
59
|
-
// Network Configuration
|
|
60
|
-
// ============================================================================
|
|
61
|
-
export { BACKGROUND_NETWORK_CONFIG, DEFAULT_NETWORK_CONFIG, INTERACTIVE_NETWORK_CONFIG, mergeNetworkConfig } from "./client/config.js";
|
|
62
|
-
// ============================================================================
|
|
63
|
-
// Retry & Timeout Utilities
|
|
64
|
-
// ============================================================================
|
|
65
|
-
export { sleep, withRetry } from "./client/retry.js";
|
|
66
|
-
export { createTimeoutController, withTimeout } from "./client/timeout.js";
|
|
67
|
-
// ============================================================================
|
|
68
|
-
// Pagination Utilities
|
|
69
|
-
// ============================================================================
|
|
70
|
-
export { collectAll, getFirst, paginate } from "./client/pagination.js";
|
|
71
|
-
// ============================================================================
|
|
72
|
-
// Raw Client & Core Types
|
|
73
|
-
// ============================================================================
|
|
74
|
-
export { createRawClient, createTypedClient } from "./client/raw.js";
|
|
75
|
-
// ============================================================================
|
|
76
|
-
// Module Classes
|
|
77
|
-
// ============================================================================
|
|
78
|
-
// Core modules
|
|
79
|
-
export { AgentsModule } from "./modules/agents.js";
|
|
80
|
-
export { BuilderModule } from "./modules/builder.js";
|
|
81
|
-
export { CredentialsModule } from "./modules/credentials.js";
|
|
82
|
-
export { KnowledgeModule } from "./modules/knowledge.js";
|
|
83
|
-
export { MembersModule } from "./modules/members.js";
|
|
84
|
-
export { RunsModule } from "./modules/runs.js";
|
|
85
|
-
export { TenantsModule } from "./modules/tenants.js";
|
|
86
|
-
export { ThreadsModule } from "./modules/threads.js";
|
|
87
|
-
export { ToolsModule } from "./modules/tools.js";
|
|
88
|
-
export { TriggersModule } from "./modules/triggers.js";
|
|
89
|
-
export { WorkspacesModule } from "./modules/workspaces.js";
|
|
90
|
-
// Platform modules
|
|
91
|
-
export { A2aModule } from "./modules/a2a.js";
|
|
92
|
-
export { AuditModule } from "./modules/audit.js";
|
|
93
|
-
export { CatalogModule } from "./modules/catalog.js";
|
|
94
|
-
export { CheckpointsModule } from "./modules/checkpoints.js";
|
|
95
|
-
export { CronsModule } from "./modules/crons.js";
|
|
96
|
-
export { DlqModule } from "./modules/dlq.js";
|
|
97
|
-
export { EvaluationModule } from "./modules/evaluation.js";
|
|
98
|
-
export { FilesModule } from "./modules/files.js";
|
|
99
|
-
export { GraphsModule } from "./modules/graphs.js";
|
|
100
|
-
export { InfoModule } from "./modules/info.js";
|
|
101
|
-
export { McpModule } from "./modules/mcp.js";
|
|
102
|
-
export { MeModule } from "./modules/me.js";
|
|
103
|
-
export { MetricsModule } from "./modules/metrics.js";
|
|
104
|
-
export { PlaygroundModule } from "./modules/playground.js";
|
|
105
|
-
export { PromptsModule } from "./modules/prompts.js";
|
|
106
|
-
export { StoreModule } from "./modules/store.js";
|
|
107
|
-
export { TracesModule } from "./modules/traces.js";
|
|
108
|
-
export { UsageModule } from "./modules/usage.js";
|
|
109
|
-
export { VectorStoresModule } from "./modules/vectorStores.js";
|
|
110
|
-
// Approvals is real (has backend implementation)
|
|
111
|
-
export { ApprovalsModule } from "./modules/approvals.js";
|
|
112
|
-
export { ApiTokensModule } from "./modules/apiTokens.js";
|
|
113
|
-
export { MembershipsModule } from "./modules/memberships.js";
|
|
114
|
-
// ============================================================================
|
|
115
|
-
// SSE Streaming
|
|
116
|
-
// ============================================================================
|
|
117
|
-
export { parseSSE, streamSSE } from "./sse/client.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
|
|
49
|
+
// ============================================================
|
|
50
|
+
export { withRetry } from "./client/retry.js";
|
|
51
|
+
export { paginate, collectAll, getFirst } from "./client/pagination.js";
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent OS SDK - 100% Auto-Generated Client
|
|
3
|
+
*
|
|
4
|
+
* This client is fully generated from the OpenAPI specification.
|
|
5
|
+
* NO manual types, NO manual endpoints - everything comes from swagger.json.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Re-export the generated types
|
|
9
|
+
export type { paths, components } from "./openapi.js";
|
|
10
|
+
|
|
11
|
+
// Re-export openapi-fetch createClient
|
|
12
|
+
import _createClient, { type ClientOptions as OpenapiClientOptions } from "openapi-fetch";
|
|
13
|
+
import type { paths } from "./openapi.js";
|
|
14
|
+
|
|
15
|
+
export type ClientOptions = OpenapiClientOptions & {
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a fully typed API client.
|
|
21
|
+
* All endpoints and types are auto-generated from OpenAPI spec.
|
|
22
|
+
*/
|
|
23
|
+
export function createClient(options: ClientOptions) {
|
|
24
|
+
return _createClient<paths>(options);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Type alias for the generated client
|
|
28
|
+
export type AgentOsClient = ReturnType<typeof createClient>;
|
|
29
|
+
|
|
30
|
+
// Convenience type for extracting schema types
|
|
31
|
+
export type Schema<T extends keyof import("./openapi.js").components["schemas"]> =
|
|
32
|
+
import("./openapi.js").components["schemas"][T];
|
package/src/index.ts
CHANGED
|
@@ -1,211 +1,109 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent OS SDK
|
|
2
|
+
* Agent OS SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* All API calls are fully typed from OpenAPI specification.
|
|
4
|
+
* Two APIs available:
|
|
6
5
|
*
|
|
7
|
-
*
|
|
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)
|
|
8
10
|
* ```ts
|
|
9
|
-
* import {
|
|
11
|
+
* import { createClient, type paths, type Schema } from "@agent-os-sdk/client";
|
|
10
12
|
*
|
|
11
|
-
* const api =
|
|
12
|
-
* baseUrl:
|
|
13
|
-
*
|
|
14
|
-
* workspaceId: auth.workspaceId,
|
|
15
|
-
* token: auth.token,
|
|
13
|
+
* const api = createClient({
|
|
14
|
+
* baseUrl: "https://api.example.com",
|
|
15
|
+
* headers: { Authorization: `Bearer ${token}` }
|
|
16
16
|
* });
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* }
|
|
18
|
+
* const { data } = await api.POST("/v1/api/graph/commit", {
|
|
19
|
+
* body: { agent_id: "...", graph_spec: {...} }
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* @example Custom Client (existing, has auth + ergonomic modules)
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { AgentOsClient } from "@agent-os-sdk/client";
|
|
27
26
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* }
|
|
27
|
+
* const client = new AgentOsClient({
|
|
28
|
+
* baseUrl: "https://api.example.com",
|
|
29
|
+
* auth: { type: "jwt", getToken: () => token, getWorkspaceId: () => wsId }
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* const { data } = await client.graphs.commit({ agent_id: "...", graph_spec: {...} });
|
|
35
33
|
* ```
|
|
36
34
|
*/
|
|
37
35
|
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
export { AgentOsClient, type AgentOsClientOptions, type AuthProvider } from "./client/AgentOsClient.js";
|
|
42
|
-
|
|
43
|
-
// Auth Provider Types
|
|
44
|
-
export {
|
|
45
|
-
isApiToken, isApiTokenAuth, isBrowser, isJwtAuth, isJwtToken, type ApiTokenAuth,
|
|
46
|
-
type JwtAuth
|
|
47
|
-
} from "./client/auth.js";
|
|
48
|
-
|
|
49
|
-
// ============================================================================
|
|
50
|
-
// Helpers & Utilities
|
|
51
|
-
// ============================================================================
|
|
52
|
-
export {
|
|
53
|
-
SDKError, toResult, unwrap, type PaginatedResponse, type PaginationParams, type Result,
|
|
54
|
-
type Unwrapped
|
|
55
|
-
} from "./client/helpers.js";
|
|
56
|
-
|
|
57
|
-
// ============================================================================
|
|
58
|
-
// Typed Errors (Enterprise)
|
|
59
|
-
// ============================================================================
|
|
60
|
-
export {
|
|
61
|
-
// Base class
|
|
62
|
-
AgentOsError, ConflictError, ForbiddenError, NetworkError, NotFoundError, RateLimitError,
|
|
63
|
-
ServerError, TimeoutError,
|
|
64
|
-
// Error classes
|
|
65
|
-
UnauthorizedError, ValidationError,
|
|
66
|
-
// Type guards
|
|
67
|
-
isAgentOsError, isAuthError,
|
|
68
|
-
isClientError, isRetryableError, isServerError, type ErrorOptions,
|
|
69
|
-
// Field errors
|
|
70
|
-
type FieldError
|
|
71
|
-
} from "./errors/index.js";
|
|
72
|
-
|
|
73
|
-
export { createErrorFromResponse } from "./errors/factory.js";
|
|
36
|
+
// ============================================================
|
|
37
|
+
// 1. AUTO-GENERATED CLIENT (openapi-fetch)
|
|
38
|
+
// ============================================================
|
|
74
39
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// ============================================================================
|
|
78
|
-
export {
|
|
79
|
-
BACKGROUND_NETWORK_CONFIG, DEFAULT_NETWORK_CONFIG,
|
|
80
|
-
INTERACTIVE_NETWORK_CONFIG, mergeNetworkConfig, type NetworkConfig, type RetryConfig
|
|
81
|
-
} from "./client/config.js";
|
|
40
|
+
export { createClient, type AgentOsClient as GeneratedClient, type ClientOptions, type Schema } from "./generated/client.js";
|
|
41
|
+
export type { paths, components } from "./generated/openapi.js";
|
|
82
42
|
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
export { sleep, withRetry, type RetryContext } from "./client/retry.js";
|
|
87
|
-
export { createTimeoutController, withTimeout } from "./client/timeout.js";
|
|
43
|
+
// ============================================================
|
|
44
|
+
// 2. CUSTOM CLIENT (AgentOsClient with modules)
|
|
45
|
+
// ============================================================
|
|
88
46
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// ============================================================================
|
|
92
|
-
export {
|
|
93
|
-
collectAll,
|
|
94
|
-
getFirst, paginate, type CursorPaginatedResponse, type CursorParams, type OffsetPaginatedResponse, type OffsetParams, type PaginateOptions
|
|
95
|
-
} from "./client/pagination.js";
|
|
47
|
+
export { AgentOsClient } from "./client/AgentOsClient.js";
|
|
48
|
+
export type { AgentOsClientOptions, AuthProvider } from "./client/auth.js";
|
|
96
49
|
|
|
50
|
+
// ============================================================
|
|
51
|
+
// Errors
|
|
52
|
+
// ============================================================
|
|
97
53
|
|
|
98
|
-
// ============================================================================
|
|
99
|
-
// Raw Client & Core Types
|
|
100
|
-
// ============================================================================
|
|
101
54
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// Core modules
|
|
117
|
-
export { AgentsModule, type Agent, type AgentGraphResponse, type AgentListResponse } from "./modules/agents.js";
|
|
118
|
-
export { BuilderModule, type BuilderChatRequest, type BuilderChatResponse, type BuilderStreamEvent, type GraphUpdateAction, type HintModel, type HintTargetModel, type HintDataModel } from "./modules/builder.js";
|
|
119
|
-
export { CredentialsModule, type Credential, type CredentialListResponse, type CredentialType } from "./modules/credentials.js";
|
|
120
|
-
export { KnowledgeModule, type KnowledgeDataset, type KnowledgeSearchResponse } from "./modules/knowledge.js";
|
|
121
|
-
export { MembersModule, type Member, type MemberListResponse, type Role } from "./modules/members.js";
|
|
122
|
-
export { RunsModule, type CreateRunResponse, type FollowEvent, type FollowOptions, type Run, type RunEvent, type RunEventDto, type RunEventsPollResponse, type RunEventsResponse, type RunListResponse, type RunStatus } from "./modules/runs.js";
|
|
123
|
-
export { TenantsModule, type Tenant } from "./modules/tenants.js";
|
|
124
|
-
export { ThreadsModule, type Thread, type ThreadListResponse, type ThreadMessage, type ThreadMessagesResponse, type ThreadRun, type ThreadState } from "./modules/threads.js";
|
|
125
|
-
export { ToolsModule, type Tool, type ToolListResponse } from "./modules/tools.js";
|
|
126
|
-
export { TriggersModule, type Trigger, type TriggerListResponse } from "./modules/triggers.js";
|
|
127
|
-
export { WorkspacesModule, type Workspace, type WorkspaceListResponse } from "./modules/workspaces.js";
|
|
128
|
-
|
|
129
|
-
// Platform modules
|
|
130
|
-
export { A2aModule, type A2aAgentCard, type JsonRpcRequest, type JsonRpcResponse } from "./modules/a2a.js";
|
|
131
|
-
export { AuditModule, type AuditListResponse, type AuditLogEntry } from "./modules/audit.js";
|
|
132
|
-
export { CatalogModule, type CatalogVersions, type NodeCatalogResponse, type NodeDefinition, type ToolCatalogResponse, type ToolDefinition, type TriggerCatalogResponse, type TriggerTemplate } from "./modules/catalog.js";
|
|
133
|
-
export { CheckpointsModule, type Checkpoint, type CheckpointsResponse } from "./modules/checkpoints.js";
|
|
134
|
-
export { CronsModule, type CronJob, type CronJobListResponse } from "./modules/crons.js";
|
|
135
|
-
export { DlqModule, type DlqListResponse, type DlqMessage } from "./modules/dlq.js";
|
|
136
|
-
export { EvaluationModule, type EvalDataset, type ExampleData, type Experiment } from "./modules/evaluation.js";
|
|
137
|
-
export { FilesModule, type FileListResponse, type PresignedUpload, type StoredFile } from "./modules/files.js";
|
|
138
|
-
export {
|
|
139
|
-
GraphsModule,
|
|
140
|
-
type GraphsGetResponse,
|
|
141
|
-
type GraphsCommitRequest,
|
|
142
|
-
type GraphsCommitResponse,
|
|
143
|
-
type GraphsConflictPayload,
|
|
144
|
-
type GraphsRevisionsListResponse,
|
|
145
|
-
type GraphsRevisionResponse,
|
|
146
|
-
type GraphsValidateRequest,
|
|
147
|
-
type GraphsValidateResponse,
|
|
148
|
-
type GraphsIntrospectRequest,
|
|
149
|
-
type GraphsIntrospectResponse,
|
|
150
|
-
type GraphsValidationMessage,
|
|
151
|
-
type GraphsValidationResult
|
|
152
|
-
} from "./modules/graphs.js";
|
|
153
|
-
export { InfoModule, type ServerCapabilities, type ServerInfo } from "./modules/info.js";
|
|
154
|
-
export { McpModule, type McpServer } from "./modules/mcp.js";
|
|
155
|
-
export { MeModule, type MeResponse } from "./modules/me.js";
|
|
156
|
-
export { MetricsModule, type MetricsResponse } from "./modules/metrics.js";
|
|
157
|
-
export { PlaygroundModule, type PlaygroundSession } from "./modules/playground.js";
|
|
158
|
-
export { PromptsModule, type Prompt, type PromptListResponse, type PromptVersion } from "./modules/prompts.js";
|
|
159
|
-
export { StoreModule, type StoreValue } from "./modules/store.js";
|
|
160
|
-
export { TracesModule, type FeedbackRequest, type Span, type SpanData, type Trace, type TraceListResponse } from "./modules/traces.js";
|
|
161
|
-
export { UsageModule, type UsageQuota, type UsageResponse } from "./modules/usage.js";
|
|
162
|
-
export { VectorStoresModule, type VectorQueryResult, type VectorStore, type VectorStoreListResponse } from "./modules/vectorStores.js";
|
|
163
|
-
|
|
164
|
-
// Approvals is real (has backend implementation)
|
|
165
|
-
export { ApprovalsModule, type Approval, type ApprovalDecision, type ApprovalListResponse, type ApprovalStatus, type ApprovalStatusResponse } from "./modules/approvals.js";
|
|
166
|
-
|
|
167
|
-
export { ApiTokensModule, type ApiToken, type ApiTokenSecret, type CreateTokenRequest, type RotateTokenResponse } from "./modules/apiTokens.js";
|
|
168
|
-
export { MembershipsModule, type EnsureMembershipRequest, type MembershipResponse } from "./modules/memberships.js";
|
|
169
|
-
|
|
170
|
-
// ============================================================================
|
|
171
|
-
// SSE Streaming
|
|
172
|
-
// ============================================================================
|
|
173
|
-
export { parseSSE, streamSSE, type RunSSEEvent, type RunStreamEvent, type SSEEvent, type SSEOptions, type RunEventDto as SSERunEventDto } from "./sse/client.js";
|
|
174
|
-
|
|
175
|
-
// ============================================================================
|
|
176
|
-
// Convenience Type Re-exports
|
|
177
|
-
// ============================================================================
|
|
178
|
-
export type {
|
|
179
|
-
AddMessageRequest, AgentBundle,
|
|
180
|
-
// Agent types
|
|
181
|
-
Agent as AgentSchema, BatchRunResponse,
|
|
182
|
-
CancelRunResponse,
|
|
183
|
-
// Checkpoint types
|
|
184
|
-
CheckpointDetail,
|
|
185
|
-
CheckpointListResponse, CreateAgentRequest,
|
|
186
|
-
// Credential types
|
|
187
|
-
CreateCredentialRequest,
|
|
188
|
-
// Cron types
|
|
189
|
-
CreateCronJobRequest,
|
|
190
|
-
// Evaluation types
|
|
191
|
-
CreateDatasetRequest,
|
|
192
|
-
CreateExperimentRequest,
|
|
193
|
-
// File types
|
|
194
|
-
CreatePresignedUploadRequest,
|
|
195
|
-
// Prompt types
|
|
196
|
-
CreatePromptRequest,
|
|
197
|
-
CreatePromptVersionRequest,
|
|
198
|
-
// Member types
|
|
199
|
-
InviteMemberRequest, PresignedUploadResponse,
|
|
200
|
-
// Error types
|
|
201
|
-
ProblemDetails, ReplayRequest, RunDetailResponse,
|
|
202
|
-
// Run types
|
|
203
|
-
RunResponse,
|
|
204
|
-
// Thread types
|
|
205
|
-
ThreadRequest,
|
|
206
|
-
ThreadSearchRequest, UpdateAgentRequest, UpdateCredentialRequest, UpdateCronJobRequest, UpdateMemberRequest, VectorQueryRequest,
|
|
207
|
-
VectorQueryResponse,
|
|
208
|
-
// Vector Store types
|
|
209
|
-
VectorStoreResponse, WaitRunResponse
|
|
210
|
-
} from "./client/raw.js";
|
|
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";
|
|
211
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)
|
|
78
|
+
// ============================================================
|
|
79
|
+
|
|
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
|
+
// ============================================================
|
|
87
|
+
|
|
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";
|