@mutagent/cli 0.1.3 → 0.1.5

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.js CHANGED
@@ -185,9 +185,9 @@ function serverURLFromOptions(options) {
185
185
  var SDK_METADATA = {
186
186
  language: "typescript",
187
187
  openapiDocVersion: "2.0.0",
188
- sdkVersion: "0.2.21",
188
+ sdkVersion: "0.2.23",
189
189
  genVersion: "2.812.2",
190
- userAgent: "speakeasy-sdk/typescript 0.2.21 2.812.2 2.0.0 @mutagent/sdk"
190
+ userAgent: "speakeasy-sdk/typescript 0.2.23 2.812.2 2.0.0 @mutagent/sdk"
191
191
  };
192
192
  // ../mutagent-sdk/dist/esm/lib/http.js
193
193
  var DEFAULT_FETCHER = (input, init) => {
@@ -13431,19 +13431,21 @@ class SDKClientWrapper {
13431
13431
  }
13432
13432
  async updatePrompt(id, data) {
13433
13433
  try {
13434
- const response = await this.sdk.prompt.updatePrompt({
13435
- id: parseInt(id, 10),
13436
- body: {
13437
- description: data.description ?? undefined,
13438
- isLatest: data.isLatest ?? undefined,
13439
- systemPrompt: data.systemPrompt ?? undefined,
13440
- humanPrompt: data.humanPrompt ?? undefined,
13441
- rawPrompt: data.rawPrompt ?? undefined,
13442
- outputSchema: data.outputSchema,
13443
- metadata: data.metadata,
13444
- tags: data.tags ?? undefined
13445
- }
13446
- });
13434
+ const body = {
13435
+ description: data.description ?? undefined,
13436
+ isLatest: data.isLatest ?? undefined,
13437
+ systemPrompt: data.systemPrompt ?? undefined,
13438
+ humanPrompt: data.humanPrompt ?? undefined,
13439
+ rawPrompt: data.rawPrompt ?? undefined,
13440
+ outputSchema: data.outputSchema,
13441
+ metadata: data.metadata,
13442
+ tags: data.tags ?? undefined
13443
+ };
13444
+ if (data.name !== undefined) {
13445
+ body.name = data.name;
13446
+ }
13447
+ const updateArgs = { id: parseInt(id, 10), body };
13448
+ const response = await this.sdk.prompt.updatePrompt(updateArgs);
13447
13449
  return response;
13448
13450
  } catch (error) {
13449
13451
  this.handleError(error);
@@ -13807,6 +13809,32 @@ async function validateApiKey(apiKey, endpoint) {
13807
13809
  return false;
13808
13810
  }
13809
13811
  }
13812
+ async function fetchOrganizations(apiKey, endpoint) {
13813
+ try {
13814
+ const response = await fetch(`${endpoint}/api/organizations`, {
13815
+ headers: { "x-api-key": apiKey }
13816
+ });
13817
+ if (!response.ok)
13818
+ return [];
13819
+ const data = await response.json();
13820
+ return data.data ?? [];
13821
+ } catch {
13822
+ return [];
13823
+ }
13824
+ }
13825
+ async function fetchWorkspaces(apiKey, endpoint, orgId) {
13826
+ try {
13827
+ const response = await fetch(`${endpoint}/api/workspaces`, {
13828
+ headers: { "x-api-key": apiKey, "x-organization-id": orgId }
13829
+ });
13830
+ if (!response.ok)
13831
+ return [];
13832
+ const data = await response.json();
13833
+ return data.workspaces ?? [];
13834
+ } catch {
13835
+ return [];
13836
+ }
13837
+ }
13810
13838
  // src/lib/output.ts
13811
13839
  import chalk from "chalk";
13812
13840
  function getJsonFlag(command) {
@@ -13943,5 +13971,5 @@ export {
13943
13971
  ApiError
13944
13972
  };
13945
13973
 
13946
- //# debugId=460687AAB930C83264756E2164756E21
13974
+ //# debugId=551F24DFEBB2827E64756E2164756E21
13947
13975
  //# sourceMappingURL=index.js.map