@agent-os-sdk/client 0.1.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.
Files changed (147) hide show
  1. package/README.md +71 -0
  2. package/dist/client/AgentOsClient.d.ts +161 -0
  3. package/dist/client/AgentOsClient.d.ts.map +1 -0
  4. package/dist/client/AgentOsClient.js +217 -0
  5. package/dist/client/helpers.d.ts +63 -0
  6. package/dist/client/helpers.d.ts.map +1 -0
  7. package/dist/client/helpers.js +55 -0
  8. package/dist/client/raw.d.ts +138 -0
  9. package/dist/client/raw.d.ts.map +1 -0
  10. package/dist/client/raw.js +97 -0
  11. package/dist/generated/index.d.ts +2 -0
  12. package/dist/generated/index.d.ts.map +1 -0
  13. package/dist/generated/index.js +1 -0
  14. package/dist/generated/openapi.d.ts +6810 -0
  15. package/dist/generated/openapi.d.ts.map +1 -0
  16. package/dist/generated/openapi.js +5 -0
  17. package/dist/index.d.ts +72 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +86 -0
  20. package/dist/modules/a2a.d.ts +48 -0
  21. package/dist/modules/a2a.d.ts.map +1 -0
  22. package/dist/modules/a2a.js +37 -0
  23. package/dist/modules/agents.d.ts +137 -0
  24. package/dist/modules/agents.d.ts.map +1 -0
  25. package/dist/modules/agents.js +154 -0
  26. package/dist/modules/audit.d.ts +55 -0
  27. package/dist/modules/audit.d.ts.map +1 -0
  28. package/dist/modules/audit.js +38 -0
  29. package/dist/modules/builder.d.ts +65 -0
  30. package/dist/modules/builder.d.ts.map +1 -0
  31. package/dist/modules/builder.js +119 -0
  32. package/dist/modules/checkpoints.d.ts +53 -0
  33. package/dist/modules/checkpoints.d.ts.map +1 -0
  34. package/dist/modules/checkpoints.js +39 -0
  35. package/dist/modules/credentials.d.ts +89 -0
  36. package/dist/modules/credentials.d.ts.map +1 -0
  37. package/dist/modules/credentials.js +79 -0
  38. package/dist/modules/crons.d.ts +72 -0
  39. package/dist/modules/crons.d.ts.map +1 -0
  40. package/dist/modules/crons.js +66 -0
  41. package/dist/modules/dlq.d.ts +60 -0
  42. package/dist/modules/dlq.d.ts.map +1 -0
  43. package/dist/modules/dlq.js +56 -0
  44. package/dist/modules/evaluation.d.ts +119 -0
  45. package/dist/modules/evaluation.d.ts.map +1 -0
  46. package/dist/modules/evaluation.js +96 -0
  47. package/dist/modules/files.d.ts +68 -0
  48. package/dist/modules/files.d.ts.map +1 -0
  49. package/dist/modules/files.js +66 -0
  50. package/dist/modules/graphs.d.ts +51 -0
  51. package/dist/modules/graphs.d.ts.map +1 -0
  52. package/dist/modules/graphs.js +29 -0
  53. package/dist/modules/info.d.ts +27 -0
  54. package/dist/modules/info.d.ts.map +1 -0
  55. package/dist/modules/info.js +27 -0
  56. package/dist/modules/knowledge.d.ts +91 -0
  57. package/dist/modules/knowledge.d.ts.map +1 -0
  58. package/dist/modules/knowledge.js +80 -0
  59. package/dist/modules/mcp.d.ts +39 -0
  60. package/dist/modules/mcp.d.ts.map +1 -0
  61. package/dist/modules/mcp.js +38 -0
  62. package/dist/modules/me.d.ts +27 -0
  63. package/dist/modules/me.d.ts.map +1 -0
  64. package/dist/modules/me.js +19 -0
  65. package/dist/modules/members.d.ts +77 -0
  66. package/dist/modules/members.d.ts.map +1 -0
  67. package/dist/modules/members.js +77 -0
  68. package/dist/modules/metrics.d.ts +16 -0
  69. package/dist/modules/metrics.d.ts.map +1 -0
  70. package/dist/modules/metrics.js +24 -0
  71. package/dist/modules/playground.d.ts +42 -0
  72. package/dist/modules/playground.d.ts.map +1 -0
  73. package/dist/modules/playground.js +48 -0
  74. package/dist/modules/prompts.d.ts +87 -0
  75. package/dist/modules/prompts.d.ts.map +1 -0
  76. package/dist/modules/prompts.js +87 -0
  77. package/dist/modules/runs.d.ts +181 -0
  78. package/dist/modules/runs.d.ts.map +1 -0
  79. package/dist/modules/runs.js +187 -0
  80. package/dist/modules/store.d.ts +37 -0
  81. package/dist/modules/store.d.ts.map +1 -0
  82. package/dist/modules/store.js +48 -0
  83. package/dist/modules/tenants.d.ts +42 -0
  84. package/dist/modules/tenants.d.ts.map +1 -0
  85. package/dist/modules/tenants.js +45 -0
  86. package/dist/modules/threads.d.ts +181 -0
  87. package/dist/modules/threads.d.ts.map +1 -0
  88. package/dist/modules/threads.js +178 -0
  89. package/dist/modules/tools.d.ts +44 -0
  90. package/dist/modules/tools.d.ts.map +1 -0
  91. package/dist/modules/tools.js +39 -0
  92. package/dist/modules/traces.d.ts +79 -0
  93. package/dist/modules/traces.d.ts.map +1 -0
  94. package/dist/modules/traces.js +56 -0
  95. package/dist/modules/triggers.d.ts +71 -0
  96. package/dist/modules/triggers.d.ts.map +1 -0
  97. package/dist/modules/triggers.js +67 -0
  98. package/dist/modules/usage.d.ts +26 -0
  99. package/dist/modules/usage.d.ts.map +1 -0
  100. package/dist/modules/usage.js +19 -0
  101. package/dist/modules/vectorStores.d.ts +97 -0
  102. package/dist/modules/vectorStores.d.ts.map +1 -0
  103. package/dist/modules/vectorStores.js +87 -0
  104. package/dist/modules/workspaces.d.ts +52 -0
  105. package/dist/modules/workspaces.d.ts.map +1 -0
  106. package/dist/modules/workspaces.js +59 -0
  107. package/dist/sse/client.d.ts +62 -0
  108. package/dist/sse/client.d.ts.map +1 -0
  109. package/dist/sse/client.js +66 -0
  110. package/package.json +50 -0
  111. package/src/client/AgentOsClient.ts +269 -0
  112. package/src/client/helpers.ts +98 -0
  113. package/src/client/raw.ts +241 -0
  114. package/src/generated/index.ts +2 -0
  115. package/src/generated/openapi.ts +6810 -0
  116. package/src/generated/swagger.json +8549 -0
  117. package/src/index.ts +161 -0
  118. package/src/modules/a2a.ts +64 -0
  119. package/src/modules/agents.ts +229 -0
  120. package/src/modules/audit.ts +74 -0
  121. package/src/modules/builder.ts +166 -0
  122. package/src/modules/checkpoints.ts +78 -0
  123. package/src/modules/credentials.ts +144 -0
  124. package/src/modules/crons.ts +114 -0
  125. package/src/modules/dlq.ts +93 -0
  126. package/src/modules/evaluation.ts +189 -0
  127. package/src/modules/files.ts +112 -0
  128. package/src/modules/graphs.ts +50 -0
  129. package/src/modules/info.ts +35 -0
  130. package/src/modules/knowledge.ts +147 -0
  131. package/src/modules/mcp.ts +59 -0
  132. package/src/modules/me.ts +32 -0
  133. package/src/modules/members.ts +117 -0
  134. package/src/modules/metrics.ts +27 -0
  135. package/src/modules/playground.ts +68 -0
  136. package/src/modules/prompts.ts +147 -0
  137. package/src/modules/runs.ts +277 -0
  138. package/src/modules/store.ts +65 -0
  139. package/src/modules/tenants.ts +67 -0
  140. package/src/modules/threads.ts +287 -0
  141. package/src/modules/tools.ts +65 -0
  142. package/src/modules/traces.ts +117 -0
  143. package/src/modules/triggers.ts +113 -0
  144. package/src/modules/usage.ts +32 -0
  145. package/src/modules/vectorStores.ts +160 -0
  146. package/src/modules/workspaces.ts +89 -0
  147. package/src/sse/client.ts +100 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Files Module - Fully Typed
3
+ */
4
+
5
+ import type { RawClient, APIResponse, components } from "../client/raw.js";
6
+
7
+ type CreatePresignedUploadRequest = components["schemas"]["CreatePresignedUploadRequest"];
8
+ type PresignedUploadResponse = components["schemas"]["PresignedUploadResponse"];
9
+ type ConfirmUploadRequest = components["schemas"]["ConfirmUploadRequest"];
10
+
11
+ export interface StoredFile {
12
+ id: string;
13
+ filename: string;
14
+ content_type: string;
15
+ size_bytes: number;
16
+ sha256: string;
17
+ storage_uri: string;
18
+ workspace_id: string;
19
+ uploaded_by?: string;
20
+ status: "pending" | "confirmed" | "deleted";
21
+ created_at: string;
22
+ }
23
+
24
+ export interface FileListResponse {
25
+ items: StoredFile[];
26
+ total: number;
27
+ }
28
+
29
+ export interface PresignedUpload {
30
+ file_id: string;
31
+ upload_url: string;
32
+ expires_at: string;
33
+ }
34
+
35
+ export interface PresignedDownload {
36
+ download_url: string;
37
+ expires_at: string;
38
+ }
39
+
40
+ export class FilesModule {
41
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
42
+
43
+ /**
44
+ * List all files.
45
+ */
46
+ async list(params?: {
47
+ workspace_id?: string;
48
+ limit?: number;
49
+ offset?: number;
50
+ }): Promise<APIResponse<FileListResponse>> {
51
+ return this.client.GET<FileListResponse>("/v1/api/files", {
52
+ params: { query: params },
53
+ headers: this.headers(),
54
+ });
55
+ }
56
+
57
+ /**
58
+ * Get a file by ID.
59
+ */
60
+ async get(fileId: string): Promise<APIResponse<StoredFile>> {
61
+ return this.client.GET<StoredFile>("/v1/api/files/{id}", {
62
+ params: { path: { id: fileId } },
63
+ headers: this.headers(),
64
+ });
65
+ }
66
+
67
+ /**
68
+ * Create a presigned upload URL.
69
+ */
70
+ async createUpload(body: {
71
+ filename: string;
72
+ content_type: string;
73
+ size_bytes?: number;
74
+ expected_sha256?: string;
75
+ }): Promise<APIResponse<PresignedUpload>> {
76
+ return this.client.POST<PresignedUpload>("/v1/api/files/upload", {
77
+ body,
78
+ headers: this.headers(),
79
+ });
80
+ }
81
+
82
+ /**
83
+ * Confirm an upload.
84
+ */
85
+ async confirmUpload(fileId: string, sha256: string): Promise<APIResponse<StoredFile>> {
86
+ return this.client.POST<StoredFile>("/v1/api/files/{id}/confirm", {
87
+ params: { path: { id: fileId } },
88
+ body: { sha256 },
89
+ headers: this.headers(),
90
+ });
91
+ }
92
+
93
+ /**
94
+ * Get a presigned download URL.
95
+ */
96
+ async getDownloadUrl(fileId: string): Promise<APIResponse<PresignedDownload>> {
97
+ return this.client.GET<PresignedDownload>("/v1/api/files/{id}/download", {
98
+ params: { path: { id: fileId } },
99
+ headers: this.headers(),
100
+ });
101
+ }
102
+
103
+ /**
104
+ * Delete a file.
105
+ */
106
+ async delete(fileId: string): Promise<APIResponse<void>> {
107
+ return this.client.DELETE<void>("/v1/api/files/{id}", {
108
+ params: { path: { id: fileId } },
109
+ headers: this.headers(),
110
+ });
111
+ }
112
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Graphs Module - Validation and Introspection
3
+ */
4
+
5
+ import type { RawClient, APIResponse, components } from "../client/raw.js";
6
+
7
+ export interface GraphValidationResult {
8
+ valid: boolean;
9
+ errors?: string[];
10
+ warnings?: string[];
11
+ }
12
+
13
+ export interface GraphIntrospectionResult {
14
+ nodes: Array<{ id: string; type: string; label?: string }>;
15
+ edges: Array<{ from: string; to: string }>;
16
+ entrypoints?: string[];
17
+ }
18
+
19
+ export class GraphsModule {
20
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
21
+
22
+ /**
23
+ * Validate a graph specification.
24
+ */
25
+ async validate(body: {
26
+ graph_spec: {
27
+ type: string;
28
+ nodes: Array<{ id: string; type: string; label?: string }>;
29
+ edges: Array<{ from: string; to: string }>;
30
+ };
31
+ }): Promise<APIResponse<GraphValidationResult>> {
32
+ return this.client.POST<GraphValidationResult>("/v1/api/graphs/validate", {
33
+ body,
34
+ headers: this.headers(),
35
+ });
36
+ }
37
+
38
+ /**
39
+ * Introspect a graph to get its structure.
40
+ */
41
+ async introspect(body: {
42
+ agent_id?: string;
43
+ graph_spec?: Record<string, unknown>;
44
+ }): Promise<APIResponse<GraphIntrospectionResult>> {
45
+ return this.client.POST<GraphIntrospectionResult>("/v1/api/graphs/introspect", {
46
+ body,
47
+ headers: this.headers(),
48
+ });
49
+ }
50
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Info Module - Fully Typed
3
+ */
4
+
5
+ import type { RawClient, APIResponse } from "../client/raw.js";
6
+
7
+ export interface ServerInfo {
8
+ name: string;
9
+ version: string;
10
+ environment: string;
11
+ features?: string[];
12
+ uptime_seconds?: number;
13
+ }
14
+
15
+ export class InfoModule {
16
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
17
+
18
+ /**
19
+ * Get server information.
20
+ */
21
+ async get(): Promise<APIResponse<ServerInfo>> {
22
+ return this.client.GET<ServerInfo>("/v1/api/info", {
23
+ headers: this.headers(),
24
+ });
25
+ }
26
+
27
+ /**
28
+ * Health check endpoint.
29
+ */
30
+ async health(): Promise<APIResponse<{ status: string }>> {
31
+ return this.client.GET<{ status: string }>("/health", {
32
+ headers: this.headers(),
33
+ });
34
+ }
35
+ }
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Knowledge Module - Fully Typed
3
+ */
4
+
5
+ import type { RawClient, APIResponse } from "../client/raw.js";
6
+
7
+ export interface KnowledgeDataset {
8
+ id: string;
9
+ name: string;
10
+ description?: string;
11
+ workspace_id: string;
12
+ file_count: number;
13
+ total_chunks: number;
14
+ created_at: string;
15
+ updated_at: string;
16
+ }
17
+
18
+ export interface KnowledgeListResponse {
19
+ items: KnowledgeDataset[];
20
+ total: number;
21
+ }
22
+
23
+ export interface KnowledgeFile {
24
+ id: string;
25
+ dataset_id: string;
26
+ filename: string;
27
+ size_bytes: number;
28
+ chunk_count: number;
29
+ status: "pending" | "processing" | "completed" | "failed";
30
+ created_at: string;
31
+ }
32
+
33
+ export interface KnowledgeFileListResponse {
34
+ items: KnowledgeFile[];
35
+ total: number;
36
+ }
37
+
38
+ export interface KnowledgeSearchResult {
39
+ chunk_id: string;
40
+ file_id: string;
41
+ content: string;
42
+ score: number;
43
+ metadata?: Record<string, unknown>;
44
+ }
45
+
46
+ export interface KnowledgeSearchResponse {
47
+ results: KnowledgeSearchResult[];
48
+ total: number;
49
+ }
50
+
51
+ export class KnowledgeModule {
52
+ constructor(
53
+ private client: RawClient,
54
+ private getWorkspaceId: () => string,
55
+ private headers: () => Record<string, string>
56
+ ) { }
57
+
58
+ /**
59
+ * List all knowledge datasets.
60
+ */
61
+ async list(params?: {
62
+ workspace_id?: string;
63
+ limit?: number;
64
+ offset?: number;
65
+ }): Promise<APIResponse<KnowledgeListResponse>> {
66
+ return this.client.GET<KnowledgeListResponse>("/v1/api/knowledge", {
67
+ params: { query: params },
68
+ headers: this.headers(),
69
+ });
70
+ }
71
+
72
+ /**
73
+ * Get a knowledge dataset by ID.
74
+ */
75
+ async get(datasetId: string): Promise<APIResponse<KnowledgeDataset>> {
76
+ return this.client.GET<KnowledgeDataset>("/v1/api/knowledge/{id}", {
77
+ params: { path: { id: datasetId } },
78
+ headers: this.headers(),
79
+ });
80
+ }
81
+
82
+ /**
83
+ * Create a new knowledge dataset.
84
+ */
85
+ async create(body: {
86
+ name: string;
87
+ description?: string;
88
+ }): Promise<APIResponse<KnowledgeDataset>> {
89
+ return this.client.POST<KnowledgeDataset>("/v1/api/knowledge", {
90
+ body,
91
+ headers: this.headers(),
92
+ });
93
+ }
94
+
95
+ /**
96
+ * Delete a knowledge dataset.
97
+ */
98
+ async delete(datasetId: string): Promise<APIResponse<void>> {
99
+ return this.client.DELETE<void>("/v1/api/knowledge/{id}", {
100
+ params: { path: { id: datasetId } },
101
+ headers: this.headers(),
102
+ });
103
+ }
104
+
105
+ // ======================== Files ========================
106
+
107
+ /**
108
+ * List files in a dataset.
109
+ */
110
+ async listFiles(datasetId: string, params?: {
111
+ limit?: number;
112
+ offset?: number;
113
+ }): Promise<APIResponse<KnowledgeFileListResponse>> {
114
+ return this.client.GET<KnowledgeFileListResponse>("/v1/api/knowledge/{id}/files", {
115
+ params: { path: { id: datasetId }, query: params },
116
+ headers: this.headers(),
117
+ });
118
+ }
119
+
120
+ /**
121
+ * Add a file to a dataset.
122
+ */
123
+ async addFile(datasetId: string, fileId: string): Promise<APIResponse<KnowledgeFile>> {
124
+ return this.client.POST<KnowledgeFile>("/v1/api/knowledge/{id}/files", {
125
+ params: { path: { id: datasetId } },
126
+ body: { file_id: fileId },
127
+ headers: this.headers(),
128
+ });
129
+ }
130
+
131
+ // ======================== Search ========================
132
+
133
+ /**
134
+ * Search within a knowledge dataset.
135
+ */
136
+ async search(datasetId: string, body: {
137
+ query: string;
138
+ top_k?: number;
139
+ min_score?: number;
140
+ }): Promise<APIResponse<KnowledgeSearchResponse>> {
141
+ return this.client.POST<KnowledgeSearchResponse>("/v1/api/knowledge/{id}/search", {
142
+ params: { path: { id: datasetId } },
143
+ body,
144
+ headers: this.headers(),
145
+ });
146
+ }
147
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * MCP Module - Fully Typed (Model Context Protocol)
3
+ */
4
+
5
+ import type { RawClient, APIResponse } from "../client/raw.js";
6
+
7
+ export interface McpServer {
8
+ id: string;
9
+ name: string;
10
+ url: string;
11
+ status: "connected" | "disconnected" | "error";
12
+ capabilities?: string[];
13
+ created_at: string;
14
+ }
15
+
16
+ export interface McpServerListResponse {
17
+ items: McpServer[];
18
+ total: number;
19
+ }
20
+
21
+ export interface McpToolCallResult {
22
+ success: boolean;
23
+ output?: unknown;
24
+ error?: string;
25
+ }
26
+
27
+ export class McpModule {
28
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
29
+
30
+ /**
31
+ * List MCP servers.
32
+ */
33
+ async listServers(): Promise<APIResponse<McpServerListResponse>> {
34
+ return this.client.GET<McpServerListResponse>("/v1/api/mcp/servers", {
35
+ headers: this.headers(),
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Get an MCP server.
41
+ */
42
+ async getServer(serverId: string): Promise<APIResponse<McpServer>> {
43
+ return this.client.GET<McpServer>("/v1/api/mcp/servers/{id}", {
44
+ params: { path: { id: serverId } },
45
+ headers: this.headers(),
46
+ });
47
+ }
48
+
49
+ /**
50
+ * Call an MCP tool.
51
+ */
52
+ async callTool(serverId: string, toolName: string, args: unknown): Promise<APIResponse<McpToolCallResult>> {
53
+ return this.client.POST<McpToolCallResult>("/v1/api/mcp/servers/{id}/tools/{toolName}/call", {
54
+ params: { path: { id: serverId, toolName } },
55
+ body: { arguments: args },
56
+ headers: this.headers(),
57
+ });
58
+ }
59
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Me Module - Fully Typed
3
+ */
4
+
5
+ import type { RawClient, APIResponse } from "../client/raw.js";
6
+
7
+ export interface MeResponse {
8
+ user_id: string;
9
+ email: string;
10
+ display_name?: string;
11
+ avatar_url?: string;
12
+ member_id?: string;
13
+ tenant_id?: string;
14
+ workspaces?: {
15
+ id: string;
16
+ name: string;
17
+ role: string;
18
+ }[];
19
+ }
20
+
21
+ export class MeModule {
22
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
23
+
24
+ /**
25
+ * Get current user information.
26
+ */
27
+ async get(): Promise<APIResponse<MeResponse>> {
28
+ return this.client.GET<MeResponse>("/v1/api/me", {
29
+ headers: this.headers(),
30
+ });
31
+ }
32
+ }
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Members Module - Fully Typed
3
+ *
4
+ * Naming conventions:
5
+ * - get* for singular items
6
+ * - list* for collections
7
+ * - create*, update*, delete* for mutations (NOT remove!)
8
+ */
9
+
10
+ import type { RawClient, APIResponse } from "../client/raw.js";
11
+ import type { PaginationParams, PaginatedResponse } from "../client/helpers.js";
12
+
13
+ export interface Member {
14
+ id: string;
15
+ tenant_id: string;
16
+ user_id?: string;
17
+ email?: string;
18
+ display_name?: string;
19
+ avatar_url?: string;
20
+ role_id?: string;
21
+ role_name?: string;
22
+ workspace_ids?: string[];
23
+ status: "active" | "pending" | "disabled";
24
+ created_at: string;
25
+ updated_at: string;
26
+ }
27
+
28
+ export interface MemberInviteResponse {
29
+ member_id: string;
30
+ invite_token?: string;
31
+ email: string;
32
+ }
33
+
34
+ export type MemberListResponse = PaginatedResponse<Member>;
35
+
36
+ export class MembersModule {
37
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
38
+
39
+ /**
40
+ * List all members in the tenant.
41
+ */
42
+ async list(params?: PaginationParams & {
43
+ workspace_id?: string;
44
+ role_id?: string;
45
+ status?: string;
46
+ }): Promise<APIResponse<MemberListResponse>> {
47
+ return this.client.GET<MemberListResponse>("/v1/api/members", {
48
+ params: { query: params },
49
+ headers: this.headers(),
50
+ });
51
+ }
52
+
53
+ /**
54
+ * Get a member by ID.
55
+ */
56
+ async get(memberId: string): Promise<APIResponse<Member>> {
57
+ return this.client.GET<Member>("/v1/api/members/{id}", {
58
+ params: { path: { id: memberId } },
59
+ headers: this.headers(),
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Invite a new member.
65
+ */
66
+ async invite(body: {
67
+ email: string;
68
+ role_id?: string;
69
+ workspace_ids?: string[];
70
+ }): Promise<APIResponse<MemberInviteResponse>> {
71
+ return this.client.POST<MemberInviteResponse>("/v1/api/members/invite", {
72
+ body,
73
+ headers: this.headers(),
74
+ });
75
+ }
76
+
77
+ /**
78
+ * Update a member.
79
+ */
80
+ async update(memberId: string, body: {
81
+ role_id?: string;
82
+ workspace_ids?: string[];
83
+ }): Promise<APIResponse<Member>> {
84
+ return this.client.PUT<Member>("/v1/api/members/{id}", {
85
+ params: { path: { id: memberId } },
86
+ body,
87
+ headers: this.headers(),
88
+ });
89
+ }
90
+
91
+ /**
92
+ * Remove a member from the tenant.
93
+ * Note: Use delete() - remove() is provided as alias for backwards compatibility.
94
+ */
95
+ async delete(memberId: string): Promise<APIResponse<void>> {
96
+ return this.client.DELETE<void>("/v1/api/members/{id}", {
97
+ params: { path: { id: memberId } },
98
+ headers: this.headers(),
99
+ });
100
+ }
101
+
102
+ /**
103
+ * Alias for delete() (backwards compatibility)
104
+ * @deprecated Use delete() instead
105
+ */
106
+ remove = (memberId: string) => this.delete(memberId);
107
+
108
+ /**
109
+ * Resend invitation email.
110
+ */
111
+ async resendInvite(memberId: string): Promise<APIResponse<void>> {
112
+ return this.client.POST<void>("/v1/api/members/{id}/resend-invite", {
113
+ params: { path: { id: memberId } },
114
+ headers: this.headers(),
115
+ });
116
+ }
117
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Metrics Module - Fully Typed
3
+ */
4
+
5
+ export interface MetricsResponse {
6
+ raw: string;
7
+ }
8
+
9
+ export class MetricsModule {
10
+ constructor(private baseUrl: string, private headers: () => Record<string, string>) { }
11
+
12
+ /**
13
+ * Get Prometheus metrics.
14
+ */
15
+ async get(): Promise<MetricsResponse> {
16
+ const response = await fetch(`${this.baseUrl}/metrics`, {
17
+ headers: this.headers(),
18
+ });
19
+
20
+ if (!response.ok) {
21
+ throw new Error(`Failed to fetch metrics: ${response.status}`);
22
+ }
23
+
24
+ const raw = await response.text();
25
+ return { raw };
26
+ }
27
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Playground Module - Fully Typed
3
+ */
4
+
5
+ import type { RawClient, APIResponse } from "../client/raw.js";
6
+
7
+ export interface PlaygroundSession {
8
+ session_id: string;
9
+ agent_id: string;
10
+ thread_id: string;
11
+ status: "active" | "expired";
12
+ created_at: string;
13
+ expires_at: string;
14
+ }
15
+
16
+ export interface PlaygroundMessageResponse {
17
+ run_id: string;
18
+ message_id: string;
19
+ content: string;
20
+ }
21
+
22
+ export class PlaygroundModule {
23
+ constructor(private client: RawClient, private headers: () => Record<string, string>) { }
24
+
25
+ /**
26
+ * Create a playground session.
27
+ */
28
+ async createSession(body: {
29
+ agent_id: string;
30
+ thread_id?: string;
31
+ }): Promise<APIResponse<PlaygroundSession>> {
32
+ return this.client.POST<PlaygroundSession>("/v1/api/playground/sessions", {
33
+ body,
34
+ headers: this.headers(),
35
+ });
36
+ }
37
+
38
+ /**
39
+ * Get a playground session.
40
+ */
41
+ async getSession(sessionId: string): Promise<APIResponse<PlaygroundSession>> {
42
+ return this.client.GET<PlaygroundSession>("/v1/api/playground/sessions/{id}", {
43
+ params: { path: { id: sessionId } },
44
+ headers: this.headers(),
45
+ });
46
+ }
47
+
48
+ /**
49
+ * Send a message in a playground session.
50
+ */
51
+ async sendMessage(sessionId: string, message: string): Promise<APIResponse<PlaygroundMessageResponse>> {
52
+ return this.client.POST<PlaygroundMessageResponse>("/v1/api/playground/sessions/{id}/messages", {
53
+ params: { path: { id: sessionId } },
54
+ body: { content: message },
55
+ headers: this.headers(),
56
+ });
57
+ }
58
+
59
+ /**
60
+ * Delete a playground session.
61
+ */
62
+ async deleteSession(sessionId: string): Promise<APIResponse<void>> {
63
+ return this.client.DELETE<void>("/v1/api/playground/sessions/{id}", {
64
+ params: { path: { id: sessionId } },
65
+ headers: this.headers(),
66
+ });
67
+ }
68
+ }