@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,97 @@
1
+ /**
2
+ * Vector Stores Module - Fully Typed
3
+ */
4
+ import type { RawClient, APIResponse } from "../client/raw.js";
5
+ export interface VectorStore {
6
+ id: string;
7
+ name: string;
8
+ workspace_id: string;
9
+ embedding_provider: string;
10
+ embedding_model: string;
11
+ dimension: number;
12
+ credential_binding_alias?: string;
13
+ file_count: number;
14
+ created_at: string;
15
+ }
16
+ export interface VectorStoreListResponse {
17
+ items: VectorStore[];
18
+ total: number;
19
+ }
20
+ export interface VectorSearchResult {
21
+ id: string;
22
+ chunk_index: number;
23
+ content_text: string;
24
+ score: number;
25
+ file_id?: string;
26
+ }
27
+ export interface VectorQueryResult {
28
+ query: string;
29
+ results: VectorSearchResult[];
30
+ total_results: number;
31
+ }
32
+ export interface VectorStoreFile {
33
+ id: string;
34
+ file_id: string;
35
+ filename: string;
36
+ status: "pending" | "processing" | "completed" | "failed";
37
+ created_at: string;
38
+ }
39
+ export interface VectorStoreFilesResponse {
40
+ items: VectorStoreFile[];
41
+ total: number;
42
+ }
43
+ export declare class VectorStoresModule {
44
+ private client;
45
+ private headers;
46
+ constructor(client: RawClient, headers: () => Record<string, string>);
47
+ /**
48
+ * List all vector stores.
49
+ */
50
+ list(params?: {
51
+ workspace_id?: string;
52
+ limit?: number;
53
+ offset?: number;
54
+ }): Promise<APIResponse<VectorStoreListResponse>>;
55
+ /**
56
+ * Get a vector store by ID.
57
+ */
58
+ get(storeId: string): Promise<APIResponse<VectorStore>>;
59
+ /**
60
+ * Create a new vector store.
61
+ */
62
+ create(body: {
63
+ name: string;
64
+ embedding_provider?: string;
65
+ embedding_model?: string;
66
+ dimension?: number;
67
+ credential_binding_alias?: string;
68
+ }): Promise<APIResponse<VectorStore>>;
69
+ /**
70
+ * Delete a vector store.
71
+ */
72
+ delete(storeId: string): Promise<APIResponse<void>>;
73
+ /**
74
+ * Query a vector store for similar content.
75
+ */
76
+ query(storeId: string, body: {
77
+ query: string;
78
+ top_k?: number;
79
+ min_score?: number;
80
+ }): Promise<APIResponse<VectorQueryResult>>;
81
+ /**
82
+ * List files in a vector store.
83
+ */
84
+ listFiles(storeId: string, params?: {
85
+ limit?: number;
86
+ offset?: number;
87
+ }): Promise<APIResponse<VectorStoreFilesResponse>>;
88
+ /**
89
+ * Attach a file to a vector store.
90
+ */
91
+ attachFile(storeId: string, fileId: string): Promise<APIResponse<VectorStoreFile>>;
92
+ /**
93
+ * Remove a file from a vector store.
94
+ */
95
+ removeFile(storeId: string, fileId: string): Promise<APIResponse<void>>;
96
+ }
97
+ //# sourceMappingURL=vectorStores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectorStores.d.ts","sourceRoot":"","sources":["../../src/modules/vectorStores.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAM3E,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,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
4
+ export class VectorStoresModule {
5
+ client;
6
+ headers;
7
+ constructor(client, headers) {
8
+ this.client = client;
9
+ this.headers = headers;
10
+ }
11
+ /**
12
+ * List all vector stores.
13
+ */
14
+ async list(params) {
15
+ return this.client.GET("/v1/api/vector-stores", {
16
+ params: { query: params },
17
+ headers: this.headers(),
18
+ });
19
+ }
20
+ /**
21
+ * Get a vector store by ID.
22
+ */
23
+ async get(storeId) {
24
+ return this.client.GET("/v1/api/vector-stores/{id}", {
25
+ params: { path: { id: storeId } },
26
+ headers: this.headers(),
27
+ });
28
+ }
29
+ /**
30
+ * Create a new vector store.
31
+ */
32
+ async create(body) {
33
+ return this.client.POST("/v1/api/vector-stores", {
34
+ body,
35
+ headers: this.headers(),
36
+ });
37
+ }
38
+ /**
39
+ * Delete a vector store.
40
+ */
41
+ async delete(storeId) {
42
+ return this.client.DELETE("/v1/api/vector-stores/{id}", {
43
+ params: { path: { id: storeId } },
44
+ headers: this.headers(),
45
+ });
46
+ }
47
+ // ======================== Query ========================
48
+ /**
49
+ * Query a vector store for similar content.
50
+ */
51
+ async query(storeId, body) {
52
+ return this.client.POST("/v1/api/vector-stores/{id}/query", {
53
+ params: { path: { id: storeId } },
54
+ body,
55
+ headers: this.headers(),
56
+ });
57
+ }
58
+ // ======================== Files ========================
59
+ /**
60
+ * List files in a vector store.
61
+ */
62
+ async listFiles(storeId, params) {
63
+ return this.client.GET("/v1/api/vector-stores/{id}/files", {
64
+ params: { path: { id: storeId }, query: params },
65
+ headers: this.headers(),
66
+ });
67
+ }
68
+ /**
69
+ * Attach a file to a vector store.
70
+ */
71
+ async attachFile(storeId, fileId) {
72
+ return this.client.POST("/v1/api/vector-stores/{id}/files", {
73
+ params: { path: { id: storeId } },
74
+ body: { file_id: fileId },
75
+ headers: this.headers(),
76
+ });
77
+ }
78
+ /**
79
+ * Remove a file from a vector store.
80
+ */
81
+ async removeFile(storeId, fileId) {
82
+ return this.client.DELETE("/v1/api/vector-stores/{id}/files/{fileId}", {
83
+ params: { path: { id: storeId, fileId } },
84
+ headers: this.headers(),
85
+ });
86
+ }
87
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Workspaces Module - Fully Typed
3
+ */
4
+ import type { RawClient, APIResponse } from "../client/raw.js";
5
+ export interface Workspace {
6
+ id: string;
7
+ tenant_id: string;
8
+ name: string;
9
+ is_default: boolean;
10
+ settings?: Record<string, unknown>;
11
+ created_at: string;
12
+ updated_at: string;
13
+ }
14
+ export interface WorkspaceListResponse {
15
+ items: Workspace[];
16
+ total: number;
17
+ }
18
+ export declare class WorkspacesModule {
19
+ private client;
20
+ private getTenantId;
21
+ private headers;
22
+ constructor(client: RawClient, getTenantId: () => string, headers: () => Record<string, string>);
23
+ /**
24
+ * List all workspaces.
25
+ */
26
+ list(params?: {
27
+ limit?: number;
28
+ offset?: number;
29
+ }): Promise<APIResponse<WorkspaceListResponse>>;
30
+ /**
31
+ * Get a workspace by ID.
32
+ */
33
+ get(workspaceId: string): Promise<APIResponse<Workspace>>;
34
+ /**
35
+ * Create a new workspace.
36
+ */
37
+ create(body: {
38
+ name: string;
39
+ is_default?: boolean;
40
+ }): Promise<APIResponse<Workspace>>;
41
+ /**
42
+ * Update a workspace.
43
+ */
44
+ update(workspaceId: string, body: {
45
+ name?: string;
46
+ }): Promise<APIResponse<Workspace>>;
47
+ /**
48
+ * Delete a workspace.
49
+ */
50
+ delete(workspaceId: string): Promise<APIResponse<void>>;
51
+ }
52
+ //# sourceMappingURL=workspaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/modules/workspaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAI3E,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAA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
+ client;
6
+ getTenantId;
7
+ headers;
8
+ constructor(client, getTenantId, headers) {
9
+ this.client = client;
10
+ this.getTenantId = getTenantId;
11
+ this.headers = headers;
12
+ }
13
+ /**
14
+ * List all workspaces.
15
+ */
16
+ async list(params) {
17
+ return this.client.GET("/v1/api/workspaces", {
18
+ params: { query: params },
19
+ headers: this.headers(),
20
+ });
21
+ }
22
+ /**
23
+ * Get a workspace by ID.
24
+ */
25
+ async get(workspaceId) {
26
+ return this.client.GET("/v1/api/workspaces/{id}", {
27
+ params: { path: { id: workspaceId } },
28
+ headers: this.headers(),
29
+ });
30
+ }
31
+ /**
32
+ * Create a new workspace.
33
+ */
34
+ async create(body) {
35
+ return this.client.POST("/v1/api/workspaces", {
36
+ body,
37
+ headers: this.headers(),
38
+ });
39
+ }
40
+ /**
41
+ * Update a workspace.
42
+ */
43
+ async update(workspaceId, body) {
44
+ return this.client.PUT("/v1/api/workspaces/{id}", {
45
+ params: { path: { id: workspaceId } },
46
+ body,
47
+ headers: this.headers(),
48
+ });
49
+ }
50
+ /**
51
+ * Delete a workspace.
52
+ */
53
+ async delete(workspaceId) {
54
+ return this.client.DELETE("/v1/api/workspaces/{id}", {
55
+ params: { path: { id: workspaceId } },
56
+ headers: this.headers(),
57
+ });
58
+ }
59
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Agent OS SDK - SSE Client
3
+ *
4
+ * Typed Server-Sent Events client for streaming endpoints.
5
+ */
6
+ export type SSEEvent<T = unknown> = {
7
+ id?: string;
8
+ event: string;
9
+ data: T;
10
+ retry?: number;
11
+ };
12
+ export type SSEOptions = {
13
+ headers?: Record<string, string>;
14
+ onOpen?: () => void;
15
+ onError?: (error: Error) => void;
16
+ signal?: AbortSignal;
17
+ };
18
+ /**
19
+ * Creates a typed SSE stream from a URL.
20
+ */
21
+ export declare function streamSSE<T>(url: string, options?: SSEOptions): AsyncGenerator<SSEEvent<T>>;
22
+ /**
23
+ * SSE Event types for Run streaming
24
+ */
25
+ export type RunStreamEvent = {
26
+ type: "run_started";
27
+ run_id: string;
28
+ status: string;
29
+ } | {
30
+ type: "node_started";
31
+ node_name: string;
32
+ timestamp: string;
33
+ } | {
34
+ type: "node_completed";
35
+ node_name: string;
36
+ output: unknown;
37
+ } | {
38
+ type: "tool_call";
39
+ tool_name: string;
40
+ args: unknown;
41
+ } | {
42
+ type: "tool_result";
43
+ tool_name: string;
44
+ result: unknown;
45
+ } | {
46
+ type: "checkpoint";
47
+ checkpoint_id: string;
48
+ step_name: string;
49
+ } | {
50
+ type: "waiting_for_human";
51
+ prompt: string;
52
+ } | {
53
+ type: "run_completed";
54
+ output: unknown;
55
+ } | {
56
+ type: "run_failed";
57
+ error: unknown;
58
+ } | {
59
+ type: "heartbeat";
60
+ timestamp: string;
61
+ };
62
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/sse/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,OAAO,IAAI;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,wBAAuB,SAAS,CAAC,CAAC,EAC9B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,UAAe,GACzB,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CA0D7B;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GACpB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Agent OS SDK - SSE Client
3
+ *
4
+ * Typed Server-Sent Events client for streaming endpoints.
5
+ */
6
+ /**
7
+ * Creates a typed SSE stream from a URL.
8
+ */
9
+ export async function* streamSSE(url, options = {}) {
10
+ const response = await fetch(url, {
11
+ method: "GET",
12
+ headers: {
13
+ Accept: "text/event-stream",
14
+ ...options.headers,
15
+ },
16
+ signal: options.signal,
17
+ });
18
+ if (!response.ok) {
19
+ throw new Error(`SSE connection failed: ${response.status}`);
20
+ }
21
+ if (!response.body) {
22
+ throw new Error("No response body");
23
+ }
24
+ options.onOpen?.();
25
+ const reader = response.body.getReader();
26
+ const decoder = new TextDecoder();
27
+ let buffer = "";
28
+ try {
29
+ while (true) {
30
+ const { done, value } = await reader.read();
31
+ if (done)
32
+ break;
33
+ buffer += decoder.decode(value, { stream: true });
34
+ const lines = buffer.split("\n");
35
+ buffer = lines.pop() ?? "";
36
+ let currentEvent = { event: "message" };
37
+ for (const line of lines) {
38
+ if (line.startsWith("event:")) {
39
+ currentEvent.event = line.slice(6).trim();
40
+ }
41
+ else if (line.startsWith("data:")) {
42
+ const dataStr = line.slice(5).trim();
43
+ try {
44
+ currentEvent.data = JSON.parse(dataStr);
45
+ }
46
+ catch {
47
+ currentEvent.data = dataStr;
48
+ }
49
+ }
50
+ else if (line.startsWith("id:")) {
51
+ currentEvent.id = line.slice(3).trim();
52
+ }
53
+ else if (line.startsWith("retry:")) {
54
+ currentEvent.retry = parseInt(line.slice(6).trim(), 10);
55
+ }
56
+ else if (line === "" && currentEvent.data !== undefined) {
57
+ yield currentEvent;
58
+ currentEvent = { event: "message" };
59
+ }
60
+ }
61
+ }
62
+ }
63
+ finally {
64
+ reader.releaseLock();
65
+ }
66
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@agent-os-sdk/client",
3
+ "version": "0.1.0",
4
+ "description": "Official TypeScript SDK for Agent OS platform",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "scripts": {
16
+ "generate": "tsx scripts/generate.ts",
17
+ "build": "tsc",
18
+ "dev": "tsc --watch",
19
+ "typecheck": "tsc --noEmit",
20
+ "prepublishOnly": "pnpm build"
21
+ },
22
+ "keywords": [
23
+ "agent-os",
24
+ "sdk",
25
+ "ai",
26
+ "agents",
27
+ "typescript"
28
+ ],
29
+ "author": "Agent OS Team",
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/yuri12344/agent-os.git"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "openapi-fetch": "^0.13.0"
40
+ },
41
+ "devDependencies": {
42
+ "openapi-typescript": "^7.4.0",
43
+ "tsx": "^4.19.0",
44
+ "typescript": "^5.5.0"
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "src"
49
+ ]
50
+ }