@axiom-lattice/client-sdk 2.1.63 → 3.0.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.mjs CHANGED
@@ -2089,6 +2089,36 @@ var AbstractClient = class {
2089
2089
  method: "DELETE"
2090
2090
  }
2091
2091
  );
2092
+ },
2093
+ localA2A: {
2094
+ list: async () => {
2095
+ const response = await this.makeRequest("/api/local-a2a");
2096
+ return response.data.records;
2097
+ },
2098
+ get: async (assistantId) => {
2099
+ const response = await this.makeRequest(`/api/local-a2a/${assistantId}`);
2100
+ return response.data;
2101
+ },
2102
+ start: async (assistantId) => {
2103
+ const response = await this.makeRequest(`/api/local-a2a/${assistantId}/start`, { method: "POST" });
2104
+ return response.data;
2105
+ },
2106
+ stop: async (assistantId) => {
2107
+ const response = await this.makeRequest(`/api/local-a2a/${assistantId}/stop`, { method: "POST" });
2108
+ return response.data;
2109
+ },
2110
+ restart: async (assistantId) => {
2111
+ const response = await this.makeRequest(`/api/local-a2a/${assistantId}/restart`, { method: "POST" });
2112
+ return response.data;
2113
+ },
2114
+ templates: {
2115
+ list: async () => {
2116
+ const response = await this.makeRequest(
2117
+ "/api/local-a2a/templates"
2118
+ );
2119
+ return response.data.records;
2120
+ }
2121
+ }
2092
2122
  }
2093
2123
  };
2094
2124
  /**
@@ -3076,13 +3106,17 @@ var _Client = class extends AbstractClient {
3076
3106
  try {
3077
3107
  const fullUrl = url.startsWith("http") ? url : `${this.config.baseURL}${url}`;
3078
3108
  const workspaceHeaders = _Client.getWorkspaceHeaders();
3109
+ const mergedHeaders = {
3110
+ ...this.headers,
3111
+ ...workspaceHeaders,
3112
+ ...options.headers || {}
3113
+ };
3114
+ if (options.body instanceof FormData) {
3115
+ delete mergedHeaders["Content-Type"];
3116
+ }
3079
3117
  const response = await fetch(fullUrl, {
3080
3118
  ...options,
3081
- headers: {
3082
- ...this.headers,
3083
- ...workspaceHeaders,
3084
- ...options.headers || {}
3085
- },
3119
+ headers: mergedHeaders,
3086
3120
  signal: controller.signal
3087
3121
  });
3088
3122
  return await this.handleResponse(response);
@@ -3162,7 +3196,12 @@ var _Client = class extends AbstractClient {
3162
3196
  headers: requestHeaders
3163
3197
  };
3164
3198
  if (options?.body) {
3165
- requestOptions.body = JSON.stringify(options.body);
3199
+ if (options.body instanceof FormData) {
3200
+ requestOptions.body = options.body;
3201
+ delete requestHeaders["Content-Type"];
3202
+ } else {
3203
+ requestOptions.body = JSON.stringify(options.body);
3204
+ }
3166
3205
  }
3167
3206
  return this.fetchWithTimeout(url, requestOptions);
3168
3207
  }
@@ -3844,6 +3883,19 @@ var WorkspaceClient = class {
3844
3883
  }
3845
3884
  return `${this.baseURL}/api/workspaces/${workspaceId}/projects/${projectId}/viewfile?${params}`;
3846
3885
  }
3886
+ /**
3887
+ * Browse local filesystem directories for the folder picker.
3888
+ *
3889
+ * Restricted to the user's home directory for security.
3890
+ */
3891
+ async browseFilesystem(fsPath) {
3892
+ const params = new URLSearchParams();
3893
+ if (fsPath) {
3894
+ params.set("path", fsPath);
3895
+ }
3896
+ const response = await this.request(`/api/filesystem/browse?${params}`);
3897
+ return response.data;
3898
+ }
3847
3899
  };
3848
3900
 
3849
3901
  // src/export-import.ts